corrupted matlab files

Forum for discussing PicoScope version 6 (non-automotive version)
Post Reply
MVel
Newbie
Posts: 0
Joined: Tue Sep 17, 2013 9:28 am

corrupted matlab files

Post by MVel »

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.

Hitesh

Re: corrupted matlab files

Post by Hitesh »

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,

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

Re: corrupted matlab files

Post by MVel »

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

Hitesh

Re: corrupted matlab files

Post by Hitesh »

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,

justinb
Newbie
Posts: 0
Joined: Fri Dec 13, 2013 5:32 pm

Re: corrupted matlab files

Post by justinb »

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

Hitesh

Re: corrupted matlab files

Post by Hitesh »

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,

justinb
Newbie
Posts: 0
Joined: Fri Dec 13, 2013 5:32 pm

Re: corrupted matlab files

Post by justinb »

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.

Hitesh

Re: corrupted matlab files

Post by Hitesh »

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,

justinb
Newbie
Posts: 0
Joined: Fri Dec 13, 2013 5:32 pm

Re: corrupted matlab files

Post by justinb »

I've sent in a file. It only has 1000000 samples per channel. The file comes from version 6.7.40.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: corrupted matlab files

Post by Martyn »

Have you tried this with the 6.8.6 RC version on our website ?
Martyn
Technical Support Manager

justinb
Newbie
Posts: 0
Joined: Fri Dec 13, 2013 5:32 pm

Re: corrupted matlab files

Post by justinb »

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.

Post Reply