Test and Measurement Forum

Batch convert .psdata files to .mat files

Post your MATLAB discussions here

Batch convert .psdata files to .mat files

Postby liangyin » Sat Jul 26, 2014 1:24 am

I have a bunch of .psdata files, each of them contains several waveforms (taken sequentially)--some of them contains 3, some contains 2 and the other contains 1. Now I want to batch convert the 1st waveform in each .psdata file into .mat file. 1) I tried picoscope /c c:\*.psdata /f mat /q /b. This command converted the last waveform in each .psdata file into .mat file, which was not what I wanted.

2) Then I tried picoscope /c c:\*.psdata /f mat /q /b 1:1. This command converted the last waveform in each .psdata file into .mat file. But the process got stuck at the .psdata files which contains only 1 waveform.

3)Then I tried picoscope /c c:\*.psdata /f mat /q /b all. This command converted all waveform in each .psdata file into .mat files. But the process also got stuck at the .psdata files which contains only 1 waveform.
liangyin
Newbie
 
Posts: 0
Joined: Sat Jul 26, 2014 12:54 am

Re: Batch convert .psdata files to .mat files

Postby Hitesh » Thu Jul 31, 2014 9:16 am

Hi liangyin,

It appears that there is a bug in the conversion process so I will report this.

Please note that with the data files with multiple waveforms, the default waveform to convert will be the last one if you use

Code: Select all
picoscope /c c:\*.psdata /f mat /q /b


Instead use

Code: Select all
picoscope /c C:\*.psdata /f mat /q /b 1


For now, if possible, convert your data files containing a single waveform in a separate directory using the following:

Code: Select all
picoscope /c "C:\<dir name>\*.psdata" /f mat


I 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: Batch convert .psdata files to .mat files

Postby JWard » Tue Mar 10, 2015 10:32 am

This is great stuff. The answer I was looking for was in the original post.

NB the system call can be made from the Matlab prompt:

system('picoscope /c *.psdata /f mat /q /b all')

Providing your Matlab workspace contains the '*.psdata' files you are trying to convert.
:P

The spectrum analyser options seem unavailable from opening *.psdata into PC Oscilloscope Version: 6.10.11.15
Are more options available in real time than can be used in post processing? Had the spectrum analyser been available for reloaded *.psdata, I may not have needed Matlab at all...

P.S. saturated time traces contain both +'ve and -'ve infinities in the converted *.mat files. These features are what sets PicoTech scopes above the rest.
-----------------------------------------------------------------------
(one should regard the plural of infinity with the same suspicion as the collective noun for hermits).
Mal Pete, 1947 - 2015
-----------------------------------------------------------------------
JWard
Newbie
 
Posts: 0
Joined: Mon Mar 09, 2015 4:45 pm

Re: Batch convert .psdata files to .mat files

Postby Hitesh » Wed Mar 18, 2015 1:09 pm

Hi JWard,

The same FFT options should be available when collecting data and post-capture.

It is possible to add a Spectrum View once you have captured data in order to view the data in the frequency domain.

There are two ways to do this:

1. From the menu click Views -> Add View -> Spectrum, or

2. Right click in the oscilloscope display and select Add View -> Spectrum

As long as the Viewport is selected, you can then export the data to .mat from PicoScope 6 or you can use the batch conversion process as well naming the Viewport to use.

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


Return to MATLAB

Who is online

Users browsing this forum: No registered users and 1 guest