Test and Measurement Forum

corrupted matlab files

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

corrupted matlab files

Postby MVel » Tue Sep 17, 2013 9:33 am

Good morning,
I am using PicoScope6 and I never had this problem before.
I save in psdata and then I export in .mat the data. When I try to save the two channel in the same .mat structure, the B channel is corrupted and matlab can not open it.
Did somebody have the same issue? And which solution?

Thank you.
MVel
Newbie
 
Posts: 0
Joined: Tue Sep 17, 2013 9:28 am

Re: corrupted matlab files

Postby Hitesh » Tue Sep 17, 2013 11:04 am

Hi MVel,

How many samples are you capturing per channel?

We have been advised by Mathworks that the MAT 4 version that we use for the .mat files only supports up to 100 million elements in an array.

Best wishes,
Hitesh

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

Re: corrupted matlab files

Postby MVel » Wed Sep 18, 2013 2:21 pm

Hello,

I have 1 milion samples for channel. I've already recorded 1M samples on the 2 channels and exported them in .mt without any problem.
If I separate the channels and export them separately there is no problem.
If I try to export them in the same file then channel B is corrupted.

Is there any possibility to open psdata files directly in matlab?

Thank you

MVel
MVel
Newbie
 
Posts: 0
Joined: Tue Sep 17, 2013 9:28 am

Re: corrupted matlab files

Postby Hitesh » Mon Sep 23, 2013 9:17 am

HI,

Can you either post a sample data file here or mail it to support@picotech.com please?

Which PicoScope are you using? Depending on the model, you might be able to use one of our Generic Instrument Drivers if you have the Instrument Control Toolbox to acquire the data into MATLAB.

The psdata file format is proprietary so cannot be read in MATLAB.

Regards,
Hitesh

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

Re: corrupted matlab files

Postby justinb » Fri Dec 13, 2013 9:56 pm

I'm running into the same issue. For some reason, Picoscope seems to be truncating part of the last matrix; it absolutely isn't an issue with matlab opening the file. I can see this even by checking the filesize -- Tstart, Tinterval and length take 35, 38, 31 bytes respectively. Channels A and B given 2000020 samples each should take (20 + 2 + 2000020 * 4) * 2 bytes; all told the file should be 16000308 bytes; picoscope is consistently giving a file with 16000244 bytes.

For this one, the difference is a few bytes; but I have another file I need binary output from where it's off by 70ish MBs; all from that last channel.

(I don't actually think this has to do with the last channel at all -- this actually seems a lot like something bad is happening to the file handle object before it's finished flushing it's contents)

(http://www.mathworks.com/help/pdf_doc/m ... format.pdf for where I got that math).

I'm going to e-mail links of the smaller example to the support e-mail. Running 6.7.40.3 on Win7 x64.

Also; it'd be really nice to have mat bin files of just the integer output from the ADC itself. As it is; storing a 32 bit float which is pulled from an 8 bit sample is annoying.

Have a good one,
Justin
justinb
Newbie
 
Posts: 0
Joined: Fri Dec 13, 2013 5:32 pm

Re: corrupted matlab files

Postby Hitesh » Mon Dec 16, 2013 4:07 pm

Hi Justin,

There appears to be an issue with exporting data to MATLAB files using PicoScope 6.7.40 if resolution enhancement is turned on.

The next release candidate of PicoScope 6 should resolve this but in the meantime you can export the data without the resolution enhancement and then apply a moving average filter in MATLAB to obtain the resolution enhancement.

I hope this helps.

Regards,
Hitesh

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

Re: corrupted matlab files

Postby justinb » Mon Dec 16, 2013 7:12 pm

I can confirm that this fixed the issue with a few files, but larger ones still have issues. I can send in a 3mb file that should turn into a ~160mb mat file if that'll help narrow down the issue. My workaround so far is to split out each channel seperately then recombine them; which works but is a bit annoying.

I've also downloaded the beta which seems to have the same issue.
justinb
Newbie
 
Posts: 0
Joined: Fri Dec 13, 2013 5:32 pm

Re: corrupted matlab files

Postby Hitesh » Wed Dec 18, 2013 2:03 pm

Hi justinb,

How many samples per channel do you have in the large files? MATLAB can only read in .mat v4 files that have up to 100 million elements per array.

If the number of samples is less than 100 million per channel, please could you e-mail the files to support@picotech.com as before as this will help in the investigation process.

Thanks,
Hitesh

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

Re: corrupted matlab files

Postby justinb » Mon Jan 13, 2014 11:02 pm

I've sent in a file. It only has 1000000 samples per channel. The file comes from version 6.7.40.
justinb
Newbie
 
Posts: 0
Joined: Fri Dec 13, 2013 5:32 pm

Re: corrupted matlab files

Postby Martyn » Tue Jan 14, 2014 11:14 am

Have you tried this with the 6.8.6 RC version on our website ?
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2280
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: corrupted matlab files

Postby justinb » Tue Jan 14, 2014 7:06 pm

It helps, but there are still some files that it processes incorrectly. It seems an awful lot like there is something cutting off the files at about 97mb. I meant to send in that file yesterday with the other one, but seems I did not. Sending it in now.
justinb
Newbie
 
Posts: 0
Joined: Fri Dec 13, 2013 5:32 pm


Return to PicoScope 6 for Windows

Who is online

Users browsing this forum: No registered users and 0 guests