Test and Measurement Forum

Problem converting .psdata to .mat

Post your MATLAB discussions here

Problem converting .psdata to .mat

Postby bahamut314 » Sun Feb 14, 2016 5:44 am

Hello,

We're having trouble reading the resultant .mat files after converting from the .psdata file. The .psdata was taken from a Picoscope 3406D MSO using software version 6.11.10.1608 and has the following properties:

Sample interval: 1 ns
Sample rate: 1 GS/s
No. samples 100,000,004
Channel A
Range +/-5V
Coupling DC
Digital Channels: Off

When trying to load the data in MATLAB, it gives the error:
Error using load
Unable to read MAT-file ..\filename.mat
File may be corrupt.

I have also tried Octave and it gives a similar error. The reason we need to use the binary file format is for the large dataset. I think CSV and txt are both limited to 1 million per channel. Any ideas?

Thanks.
bahamut314
Newbie
 
Posts: 0
Joined: Sun Feb 14, 2016 5:31 am

Re: Problem converting .psdata to .mat

Postby Hitesh » Mon Feb 15, 2016 10:02 am

Hi bahamut314,

The PicoScope 6 software saves to MATLAB v4 file format. Unfortunately, MATLAB is only able to handle arrays with 100 million elements or less when saved in this format.

Please e-mail support@picotech.com and we will look to assist you further. It would be helpful if you can indicate which version of MATLAB you are using and whether it is 32-bit or 64-bit.

Regards,
Hitesh

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

Re: Problem converting .psdata to .mat

Postby herwigk » Tue May 24, 2016 6:35 am

Hello,

I have the same problem here.
(PicoScope 5444b, channels A&B&C, 500ms/div, 5mio samples total)

I use 3 channels with 5.000.000 samples each.

With R6.10.18 I got a truncated mat-file with partly invalid data.
(Only about 1.600.000 samples for A and B each and about 490.000 samples for C)

With R6.11.12 and R6.12.2beta I get the complete channels A and B with correct data, but for channel C I get the
message (GNU octave; no Matlab available):

Code: Select all
error: load: reading matrix data for 'C'
error: load: trouble reading binary file 'D:/Audi_MLB_Redesign/Test/20160519_Webasto_8Nm_gebremst/20160519-0002e_ungebremst.mat'

Is there any other possibility to get at least an excerpt (of the end) of the data into a correct mat-file?

Thank You.
herwigk
Newbie
 
Posts: 0
Joined: Tue May 24, 2016 6:00 am

Re: Problem converting .psdata to .mat

Postby Hitesh » Tue May 24, 2016 9:56 am

Hi herwigk,

There should be a fix in the next PicoScope 6.12 version which should resolve the issue.

There are two possible workarounds for this:

1. Enable channel D, then load only channels A, B and C into MATLAB from the file using the command prompt or a script.

2. Using PicoScope Beta 6.12.2, export the data to csv or text file and then use the Import tool in MATLAB to load the data in.

The second option might take a bit longer due to file size.

Hope this helps.
Hitesh

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

Re: Problem converting .psdata to .mat

Postby herwigk » Tue May 24, 2016 12:59 pm

Thank you Hitesh,

I already tried Beta 6.12.2 with no success with mat files.
But I just tried as you suggested to save the data as txt file and it worked (so far).

The errors still present are:
- The first column, representing the time, starts with unit (ms) but the values switch then to (s) without notice, so I
would read out the wrong time stamps.
- Somewhere later on (at time 2.655116s) the header is repeated in the data stream, but now with time unit (s). The
measured data values at that timestamp are lost, which would represent a discontinuity in time.

For now I can continue with this workaround. Thank You!

Best regards, Herwig
herwigk
Newbie
 
Posts: 0
Joined: Tue May 24, 2016 6:00 am

Re: Problem converting .psdata to .mat

Postby Hitesh » Tue May 24, 2016 3:13 pm

Hi Herwig,

Could you please send the corresponding PicoScope psdata file to support@picotech.com and I can check the export to see if I can repeat the issue described.

Thanks,
Hitesh

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

Re: Problem converting .psdata to .mat

Postby herwigk » Wed May 25, 2016 5:22 am

Hello Hitesh,

is there a possibility to upload the file somewhere? The file size is 12MB.

Regards,
Herwig
herwigk
Newbie
 
Posts: 0
Joined: Tue May 24, 2016 6:00 am

Re: Problem converting .psdata to .mat

Postby Hitesh » Wed May 25, 2016 8:37 am

Hi Herwig,

Did you try e-mailing it to support@picotech.com?

You can save one waveform if you have multiple waveforms in a file and post it here.

Regards,
Hitesh

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


Return to MATLAB

Who is online

Users browsing this forum: No registered users and 0 guests