Test and Measurement Forum

# samples when going from .psdata to .mat

Forum for discussing PicoScope version 6 (non-automotive version)

# samples when going from .psdata to .mat

Postby ckw » Tue Feb 04, 2014 1:45 pm

I am running into an issue with the number of samples written to the .mat file. When I load a .psdata file into PicoScope6, PicoScope6 indicates the number of samples. If I save the waveform in a .csv file I get a few more (4) than PicoScope6 says, but all samples seem to be real. If I save the waveform to a .mat file I get quite a few more samples and the extra samples (in excess of those in the .csv file) are all zeros. This seems to be a bug. When I load the .mat file in matlab, the "A" array has the extra samples and the "Length" variable indicates the larger size.

For example
Picoscope6 - No.Samples: 55,557
.csv file - No. Samples: 55,561
.mat file - No. Samples: 59, 641 with all values zero above index 55,561

Am I doing something wrong
Ken
ckw
Newbie
 
Posts: 0
Joined: Tue Feb 04, 2014 12:43 pm

Re: # samples when going from .psdata to .mat

Postby Hitesh » Wed Feb 05, 2014 11:18 am

Hi Ken,

Which version of PicoScope 6 are you using?

Please could you send your psdata file to support@picotech.com and we can export the data and take a look here.

Thanks,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2009
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: # samples when going from .psdata to .mat

Postby ckw » Wed Feb 05, 2014 12:59 pm

I am using 6.8.6.9, but had the same issue with earlier versions. I just switched to this version to see if the problem was already corrected in this lastest version.

I have sent a sample file as requested.
Ken
ckw
Newbie
 
Posts: 0
Joined: Tue Feb 04, 2014 12:43 pm

Re: # samples when going from .psdata to .mat

Postby Hitesh » Mon Feb 10, 2014 10:38 am

Hi Ken,

Thank you for replying here.

I've referred this to a colleague for clarification and will post back here/respond to your e-mail.

Thanks,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2009
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: # samples when going from .psdata to .mat

Postby Bob Mehew » Wed Apr 23, 2014 8:42 am

Hi

just came across this bug from another direction. I normally save my 2 channels worth of data to psdata file format and subsequently transform it to a mat file format for onward processing. Usually my 2 channels of data is collected using the single trigger mode, so I collect one full buffer memory of data. This gives me no problems in the psdata to mat conversion. But I have just recently saved an incomplete buffer memory of data. The conversion gives me a mat file with no second channel's worth of data. I am using ver 6.8.11.20 but first found it on 6.6.50. HTH
Bob Mehew
Active User
Active User
 
Posts: 6
Joined: Tue Jun 16, 2009 10:07 am
Location: Southport

Re: # samples when going from .psdata to .mat

Postby Hitesh » Wed Apr 23, 2014 2:36 pm

Hi Bob,

Could you please post your data file here or send it to support@picotech.com

This might be a bug that has already been fixed and should be available in the next Beta release.

The workaround is to load in only channel A into MATLAB, and then export only channel B to .mat file.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2009
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: # samples when going from .psdata to .mat

Postby Bob Mehew » Wed Apr 23, 2014 3:10 pm

The file is too large to attach so I will send it.

I presume when you say "The workaround is to load in only channel A into MATLAB, and then export only channel B to .mat file." you are not referring to using the Picosoft 'save as' function. Our process is having recorded the data and saved it as a psdat file, to then using coding in MathCad, open the psdata file with Picosoft, then use the save as function matlab option to save the data in .mat format and then open the .mat file in MathCad. Recording a complete sheet / memory using the single trigger option seems to avoid the bug. I also see if I record more than one sheet then bug also appears
Bob Mehew
Active User
Active User
 
Posts: 6
Joined: Tue Jun 16, 2009 10:07 am
Location: Southport

Re: # samples when going from .psdata to .mat

Postby Hitesh » Fri Apr 25, 2014 8:54 am

Hi Bob,

In PicoScope 6, you can use the Views -> Channels menu option to hide channels then export using the File -> Save As... menu option.

Hope this helps.
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2009
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: # samples when going from .psdata to .mat

Postby Bob Mehew » Fri Apr 25, 2014 2:53 pm

Ah, I had not appreciated that channel hide had that power. I must save data before looking at it to avoid that problem / benefit. Thanks for the info.
Bob Mehew
Active User
Active User
 
Posts: 6
Joined: Tue Jun 16, 2009 10:07 am
Location: Southport

Re: # samples when going from .psdata to .mat

Postby Bob Mehew » Mon Feb 16, 2015 2:00 pm

Hi

has this bug been dealt with yet? I still seem to have the same problem in v6.10.11.15. It would be nice to work directly rather than having to separately record and then stitch back together the data.

Bob
Bob Mehew
Active User
Active User
 
Posts: 6
Joined: Tue Jun 16, 2009 10:07 am
Location: Southport

Re: # samples when going from .psdata to .mat

Postby Hitesh » Thu Feb 19, 2015 12:12 pm

Hi Bob,

It looks as though the bug has not been fixed. Could you please send a psdata file to support@picotech.com and I can test it here and notify our Development Team accordingly.

Update: File has been received via our Support e-mail system (thanks :D ). The file can be exported and loaded into MATLAB. It looks as though the incorrect length is specified for Channel A (as the trace stopped before the end of the time axis) so please use the Length parameter to extract the correct portion of data.

Many thanks,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2009
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: # samples when going from .psdata to .mat

Postby Bob Mehew » Fri Feb 20, 2015 3:02 pm

The simple work around is to always use the trigger function in single shot mode so the data ends at end of screen. That way the conversion from .psdata to .mat works and we can read all channels OK.

However from time to time, we like to use PicoSoft in continuous display mode which gives rise to our problem. Our setup uses MathCad software and the .mat file as a convenient way of transferring the data into MathCad. Unfortunately it appears MathCad is sensitive to errors in the .mat file which the MatLab software apparently can cope with. Our reading of error messages indicates that Channel B data was corrupted by not ending properly and Ch A data is OK.

Thanks for issuing a reminder on the bug report.
Bob Mehew
Active User
Active User
 
Posts: 6
Joined: Tue Jun 16, 2009 10:07 am
Location: Southport


Return to PicoScope 6 for Windows

Who is online

Users browsing this forum: No registered users and 0 guests