PicoScope 5000 Series

Flexible resolution oscilloscopes

PicoScope 5000 Series - Elektra Awards Winner 2013

High speed and high resolution. Breakthrough ADC technology switches from 8 to 16 bits in the same oscilloscope.

From just £739.00

More

MATLAB – using Signal Processing Toolbox features to analyze PicoScope data

Introduction

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.

Comparing data captures using 8-bit and 16-bit resolution

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.

Setup

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.

Post-capture – inspecting data plots

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:

  • 8-bit: 39.1 mV
  • 16-bit: ~0.153 mV

The trigger point is marked with a red 'X'.

PicoScope 5000 Series Block Capture at 8-bit Resolution

Block data capture (8-bit)

PicoScope 5000 Series Block Capture at 8-bit Resolution

Block data capture (16-bit)

The difference in the waveform data can be seen more clearly when viewing a portion at the top of the sine wave after the trigger point for both captures:

PicoScope 5000 Series Zoom on Block Capture at 8-bit Resolution

Zoom on block capture at 8-bit resolution

PicoScope 5000 Series Zoom on Block Capture at 16-bit Resolution

Zoom on block capture at 16-bit resolution

Post-capture – obtaining measurements

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:

Measurements Using Signal Processing Toolbox functions on PicoScope 5000 Series Oscilloscope Data

Tabulated measurements

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.

When we call some of the measurement functions, MATLAB also displays a plot. Below are examples of rise time plots for the 8-bit and 16-bit data captures - the annotations on the graph are automatically added.

Rise Time Plot for 8-bit resolution data generated by Signal Processing Toolbox rise time function

Rise time plot (8-bit resolution)

Rise Time Plot for 16-bit resolution data generated by Signal Processing Toolbox rise time function

Rise time plot (16-bit resolution)

Performing a fast Fourier transform on a signal and analyzing data

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.

Setup

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.

Post-capture – applying a fast Fourier transform

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.

Discrete Fourier Transform (DFT) of PicoScope 5000 Series Data using Fast Fourier Transform Algorithm

PicoScope 5000 series data and DFT plot

Post-capture – analyzing waveform data

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.

A MATLAB plot generated by the Signal Processing Toolbox overshoot function on data collected using a PicoScope 5000 Series Oscilloscope.

Plot generated by overshoot 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.

A MATLAB plot generated by the Signal Processing Toolbox pulsewidth function on data collected using a PicoScope 5000 Series Oscilloscope.

Plot generated by pulsewidth function

Assigning the output of the pulsewidth function to a variable, pw, results in the following,

pw =

   4.9990e-04

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:

dutyCycle =

    0.5001

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:

avgFreq =

  999.9999

Calculate the total jitter by finding the standard deviation of the array of pulse period values:

totalJitter =

   1.5070e-07

Applying post-capture filtering to streaming data

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.

An arbitrary waveform defined for use with demonstrating data capture and filtering using MATLAB, Instrument Control Toolbox and Signal Processing Toolbox.

Arbitrary waveform plot

Setup

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).

Signal Processing Toolbox Filter Design and Analysis Tool being used to design a Low Pass Butterworth Filter.

Low pass Butterworth filter design using FDATool

Filter design

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.

Post-capture filtering and plot

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.

PicoScope 5000 Series Data collected in Streaming Mode with Signal Processing Toolbox Low Pass Butterworth Filter applied.

PicoScope 5000 series streaming data with filter applied

MATLAB is a registered trademark of The MathWorks, Inc. and Instrument Control Toolbox and Signal Processing Toolbox are trademarks of The MathWorks, Inc.