Perform signal processing with an oscilloscope

Article By : Arthur Pini

An oscilloscope performing signal processing is interactive with graphical displays, and it can document each step without any programming.

It’s always fun to do something out of the ordinary with an instrument like an oscilloscope. I recently had an opportunity to use some oscilloscope black magic for a project. I obtained several ASCII multi-channel cardiac waveforms from a Holter recorder intended for import into an arbitrary waveform generator (AWG).

Unfortunately, the recorded data had been digitized at 200 samples per second (S/s) and the AWG had a minimum sampling rate of 1k S/s. Importing the waveform at the higher rate would result in the key frequencies of the waveform being spectrally expanded. So, I needed to process the waveform using an interpolator to increase the sample rate to 1k S/s. Having access to an oscilloscope, I was able to use a couple of its features to solve the problem.

DSO’s waveform features

One of the great features of digital storage oscilloscopes (DSOs) is the ability to save and restore waveforms. It’s the first capability needed for this project. Most mid- and high-range oscilloscopes can save data in multiple formats. The primary format for saving data is the scope’s native binary format. These binary files may have file extensions like ‘.TRC’ or ‘.WFM’ that are proprietary file formats intended to be recalled into the scope or the scope manufacturer’s off-line analysis utility program.

Most DSOs can also save waveforms in a variety of ASCII formats. That includes straight ASCII, comma delimited ASCII files for import into spreadsheets, .DAT files for use with MATLAB, and .PRN files for MATHCAD. The ASCII files can be saved as vertical data alone, time and vertical data, and time and vertical data with a header to provide a wide range of compatibility.

One interesting thing is that Teledyne LeCroy oscilloscopes, with their MAUI operating system, have the ability to read ASCII files with headers back into the scope. This feature permits data from other sources to be imported into the oscilloscope for graphical display, measurement, or signal processing.

The oscilloscope ASCII format with header requires both time and vertical data along with a simple header, as shown partially in Figure 1.

screenshot of an Excel spreadsheet showing the format of the header

Figure 1 This screenshot of an Excel spreadsheet shows the format of the header in an ‘ASCII with header’ file format.

The Holter channel data was imported into Excel, and the time data was created to match the amplitude data using a 5-ms increment (200 Hz). The header information, including record length, sample interval, trigger point, trigger time, and horizontal offset was generated and entered with appropriate labels.

The DSO requires that text fields be enclosed in double quotes. Excel does not use this format for text, so the quotation marks were added in Notepad (Figure 2).

Figure 2 This Notepad screenshot shows the final form of the ASCII format with the header waveform file format to be imported into the oscilloscope.

The resultant file was imported into the oscilloscope, as shown in Figure 3.

oscilloscope screenshot after file was importedFigure 3 The imported waveform is in the upper left, a zoomed view of the same waveform is in the lower left, and the Fast Fourier Transform of the imported waveform is on the right side.

The imported waveform has 60k sample points and represents 5 minutes of recorded data at the 200 Hz sample rate, as shown in the upper left grid. The horizontally-expanded zoom view of that data provides a detailed view and appears in the lower-left grid. Measurements of the number of data points in the recalled record and the frequency are also shown below the waveform traces. The Fast Fourier Transform (FFT) of the imported waveform appears in the right-side grid. The span of this spectral display is the Nyquist frequency of 100 Hz. The primary spectral content is at low frequencies below 5 Hz. There is another peak with a measured frequency of 50 Hz at the center of the FFT span.

How interpolation works

The imported waveform, like any waveform in the DSO, can be measured, analyzed, and processed. The goal in this project was to increase the sampling rate of this waveform from 200 Hz to 1 kHz. That requires the use of the interpolate math function. Figure 4 shows the steps involved and how the interpolation process affects this signal.

oscilloscope screenshot showing a comparison of the imported waveform and the interpolated waveformFigure 4 A comparison of the imported waveform (left side) and the interpolated waveform (right side) shows the processing steps to increase the effective sample rate.

The ASCII Holter recorder waveform is imported into memory trace M1 shown in the upper left grid. The math trace F1 is set up to interpolate by a factor of 5:1 using a Sin(x)/x interpolator. The interpolated waveform appears in the display at the upper right. The number of points measurement parameter for both waveforms appear below the trace grids. The imported trace has 60k sample points, while the interpolated function has 299.8k samples. The interpolated waveform is truncated slightly from 300k samples due to the overhead of the interpolation filter used, but it has nominally five times the number of points as the original waveform.

Both waveforms are horizontally-expanded to show the details of the sampling process. The second trace from the top on the left shows the original signal. The intensified dots show the real sample points. The second trace down on the right shows the same portion of the interpolated waveform. The increased sample rate—1 kHz—is evident by the closer spacing of the samples.

The key difference is seen in comparing the FFTs. The FFT of the imported waveform, third from the top on the left, has a span of half the sampling rate (Nyquist frequency), and it covers the frequencies from DC to 100 Hz. The FFT of the interpolated waveform, third down on the right, has a span of 500 Hz—again, half the 1 kHz sampling rate. Note that the spectral content only extends to just above 100 Hz.

If the interpolated FFT is expanded to show the range from 0 to 100 Hz (lower right), the spectrum is almost identical to that of the imported waveform on the lower left. There is some rounding of the amplitude spectrum near 100 Hz caused by the interpolation filter, but this is minor because the important information is all under 5 Hz.

Problem solved

The interpolated waveform, now sampled at 1 kHz, can be exported from the oscilloscope, again in ASCII format, and imported directly into the AWG, where it can be generated with the correct frequency range. Problem solved; mission accomplished.

Not all oscilloscope applications involve signal acquisition. This one uses the scope as a signal processor instead of using a third-party analysis program. The advantage is that the scope processing is interactive with graphical displays to document each step, and it does not require any programming.

Arthur Pini has over 50 years of experience in electronics test and measurement. See all of his EDN oscilloscope articles.

Related articles:

Leave a comment