PicoScope 7 Software
Available on Windows, Mac and Linux
High speed and high resolution. Breakthrough ADC technology switches from 8 to 16 bits in the same oscilloscope.
The articles on this page demonstrate the use of Signal Processing ToolboxTM features to perform analysis and filtering on data collected directly into the MATLAB® Environment using a PicoScope 5000 Series Flexible Resolution Oscilloscope and its corresponding MATLAB Instrument Driver for Instrument Control ToolboxTM.
In the examples below, we used a PicoScope 5244B oscilloscope.
In this example, we compare and contrast data acquisition of the same signal source first with the PicoScope set to 8-bit resolution, then to 16-bit resolution.
Through a MATLAB script, we configured the signal generator to output a ±2 volt sine wave with a frequency of 1 kHz and set a trigger for a rising edge through 1 V on Channel A. We connected the 'Gen' output on the PicoScope to the Channel A input.
The script set up the PicoScope to capture a block of data with 2048 pre-trigger and 2048 post-trigger samples at a sampling interval of 496 ns (~2 MS/s), first at 8-bit resolution and then at 16-bit resolution.
From the resulting waveforms captured we can see that the 16-bit resolution capture provides a much smoother sine wave compared to the capture at 8-bit resolution. At 16-bit resolution we have 65536 quantization levels over the full-scale voltage range compared to 256 quantization levels at 8-bit resolution.
Given that the voltage range used was ±5 volts, each quantization level corresponds to the following:
The trigger point is marked with a red 'X'.
Once the data is captured we can use functions provided by Signal Processing Toolbox to obtain the following measurements:
The measurements can easily be tabulated using the table function:
Comparing the data for both captures, the difference in the values obtained can be attributed to the number of quantization levels as mentioned above, which in turn has an impact on the data values used in the calculations.
In this example, a fast Fourier transform (FFT) is applied to a square wave captured using the PicoScope followed by measurements on the square wave itself.
Our MATLAB script configured the signal generator to output a ±2 volt square wave with a frequency of 1 kHz and set a trigger for a rising edge through 1 V on Channel A. We connected the 'Gen' output on the PicoScope to the Channel A input.
The script set up the PicoScope to capture a block of data with 3500 pre-trigger and 3500 post-trigger samples at a sampling interval of 50 µs (20 MS/s) at 14-bit resolution.
Once the data has been captured, we can compute the discrete Fourier transform (DFT) of the data to view it in the frequency domain using the fft function. The figure shows the fundamental frequency and odd-harmonic components of the waveform in the bottom sub-plot.
Signal Processing Toolbox also provides functions to find overshoot, undershoot, pulse width and duty cycle of a waveform.
Here, the overshoot function plots and annotates a sub-section of the waveform data that is passed as an argument to the function.
Calling the pulsewidth function on the same sub-section of the waveform data without assigning the output of the function results in a plot of the data with annotation.
Assigning the output of the pulsewidth function to a variable,
pw, results in the following,
This corresponds to the time for half a cycle of a square wave at 1 kHz frequency, which is 500 µs.
The dutycycle function can be applied to the sub-section of the waveform data and this results in:
This is close enough to the 50% that would be expected for this square wave.
Use the pulseperiod function to calculate the average frequency of the waveform data by taking the reciprocal of the mean value found:
Calculate the total jitter by finding the standard deviation of the array of pulse period values:
In this example, we use the Filter Design and Analysis Tool available in the Signal Processing Toolbox to design a filter that can be applied as a post-capture operation on data containing random noise values.
Our MATLAB script configured the signal generator to output an arbitrary waveform defined as a sine wave with random added noise (shown on the right) with an amplitude of ±2 volts and frequency of 1 Hz.
The script set a trigger for a rising edge through 500 mV on Channel A. We connected the 'Gen' output on the PicoScope to the Channel A input.
The script set up the PicoScope to capture data in streaming mode at a sampling rate of 1 MS/s and to stop after capturing 10 million post-trigger samples (10 seconds).
You can use the Filter Design and Analysis Tool (FDATool) to design a filter which can be applied to the data post-capture.
The image to the right shows the configuration used for a low-pass Butterworth Infinite Impulse Response (IIR) Filter. It shows the parameters as well as the magnitude and phase response.
Once the filter is designed, you can export it to a MATLAB function via the FDATool User Interface. The function when called returns a discrete-time filter object. You can pass some properties of this filter object to the filtfilt function as arguments along with the waveform data in order to apply zero-phase digital filtering.
After you have captured several cycles of the arbitrary waveform, you can then apply the low-pass filter as a post-capture operation.
The figure shows a portion of the data collected with the filtered waveform shown on the same plot as the original waveform data. The resulting filtered waveform is a smooth sine wave with zero phase delay.
MATLAB is a registered trademark of The MathWorks, Inc. and Instrument Control Toolbox and Signal Processing Toolbox are trademarks of The MathWorks, Inc.