Test and Measurement Forum

Bode plots in Matlab using numerous imported PicoScope files

Post your MATLAB discussions here

Bode plots in Matlab using numerous imported PicoScope files

Postby figarila » Tue Oct 27, 2015 10:21 pm

So new to using PicoScope equipment. Im using 2204a model. I want to create some phase diagrams and Bode plots from some experimental data in Matlab.

I would like to take numerous PicoScope files of a circuit. Where each file represents a 100Hz increase and has two different voltage signals. I want to import (phase difference, V(a), V(b)) from each PicoScope file into a single Matlab file.

Not really where to even start here. I'd appreciate a nudge in the right direction. Thanks again.
Posts: 0
Joined: Tue Oct 27, 2015 10:03 pm

Re: Bode plots in Matlab using numerous imported PicoScope f

Postby Bilal » Wed Oct 28, 2015 3:37 pm


If you have saved your data from PicoScope 6 into a .CSV file, you can read it into Matlab using the following command method:

filename = 'csvlist.csv';
M = csvread(filename)

This will take the contents of the file and store it into variable M In the form of a matrix. Then you can use the matrix (or separate into vectors) and carry out your intended operations.

Bilal Patel
Technical Support Engineer.
Bilal Patel
Technical Support Engineer
Pico Technology
Posts: 33
Joined: Mon Oct 05, 2015 12:19 pm

Re: Bode plots in Matlab using numerous imported PicoScope f

Postby hexamer » Wed Oct 28, 2015 5:27 pm

Is it a requirement that you use Matlab? If not, you could consider my application to solve your general problem: http://bitbucket.org/hexamer/fra4picoscope/wiki/Home It does require Windows (it's not cross-platform yet). Version 0.4b supports 2204A.

Otherwise, if you need to use Matlab, then I would ask where you are intending to do the phase and magnitude calculations - in the PicoScope app or in Matlab?

There is a math channel formula posted numerous places on this board that computes phase shift within the PicoScope App: acos(integral(A*B)/(sqrt(integral(A*A))*sqrt(integral(B*B))))/Pi*180
If your signals are clean that might work well.

If you're using Matlab, then there are many options for computing phase shift between two signals. One option is to compute DFTs for each signal, then subtract phases. The DFT could be done with FFT, plain (naive) DFT, or Goertzel. Once you're using a DFT, youll get magnitude as well.

If your question is more about importing and manipulating the data, then I'll defer to someone who has more experience there.
Advanced User
Advanced User
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Return to MATLAB

Who is online

Users browsing this forum: No registered users and 0 guests