Control the sample rate of digitized signals

Digital instruments sample analog waveforms and operate on the samples with the assurance that the data can be restored to continuous analog form. The sampling theorem states that a signal digitized by uniform sampling at greater than two times the highest frequency component can be recovered or reconstructed without error. But, did you know that you can change the sample rate of the digitized data?

Decimation and Interpolation

Two of the most useful tools for dealing with digitized data are the mathematical functions of decimation and interpolation, these may be optional math functions on some oscilloscopes. Decimation, also known as sparsing or down sampling, is used to reduce the effective sample rate at which the data was digitized. Interpolation or up sampling allows the sampling rate to be effectively increased.

Figure 1 provides an example of both operations. The 10 MHz waveform was digitized at 100 MSamples/s yielding 10 samples/cycle (center-left grid). To the right of the original waveform is a horizontal expansion or zoom of the waveform showing the digitized samples as dots on the waveform trace. The top-left waveform shows the effects of a 2:1 decimation and the associated zoom trace (top-right) clearly shows the waveform now has only five points per cycle. The trace on the bottom left shows the effects of a 2:1 interpolation, the zoom trace in the lower-right.


Figure 1. The detailed time-domain effects of decimating and interpolating a digitized waveform. Center traces are the original waveform. Top traces show the effects of 2:1 decimation. The bottom trace shows the effects of a 2:1 interpolation.

You must take care when applying either operation to assure that the you meet the Nyquist criteria of sampling at greater than twice the highest frequency within the waveform. In the case of decimation, the final sample rate must be greater than twice the signal’s highest frequency component. Likewise, the original digitized signal must meet the criteria before interpolation is applied.

Decimation and interpolation applications

An example of interpolation is right up front in most digital oscilloscopes (DSOs). They apply Sin(x)/x interpolation to the acquired samples to “smooth” the waveform as shown in Figure 2.


Figure 2. Sin(x)/x interpolation increases the number of samples in the acquired waveform and visually smooths the acquired signal.

The top trace in Fig. 2 is the acquired waveform displayed with linear interpolation, basically a “connect the dots” view of the waveform. Bright dots show the position of the real samples. Sin(x)/x interpolation is applied to the waveform and the resultant waveform is shown in the lower trace. This oscilloscope performs a 10:1 interpolation so there are ten times as many samples in the lower trace. The result is a waveform that looks smoother. Keep in mind that this works well only when the Nyquist criteria for sampling is met. More on that later.

The most obvious use for decimation is to reduce the size of a digitized waveform. Decimation saves memory and speeds signal processing by reducing the number of samples in a waveform. Another use is to perform multi-rate filtering. The range of band edge frequencies of a digital filter is a function of the signal’s effective sampling rate. To lower the cutoff frequency of a digital filter to a more useable value, you must reduce the effective sampling rate.

There are two ways to accomplish this in an oscilloscope. The first is to reduce the length of the acquisition memory. The second is to decimate the data using the sparse or decimation function. Reducing the sampling rate increases the possibility of aliasing the data, especially when capturing harmonic-rich signals. To limit the possibility of aliasing, the data can be sampled at a high rate to prevent aliasing then low-pass filtered using a digital filter before decimation. This combination of filtering and decimation prior to performing another filtering operation on the data is called “multi-stage, multi-rate” digital filtering. It offers the ability to reduce the effective sampling rate with a minimum risk of aliasing an example is shown in Figure 3.


Figure 3. The series of math operation used to implement a multi-stage, multi-rate digital filter to eliminate a 60 Hz component from a 63 kHz signal.

This type of signal is common in switching-power-supply measurements. The measured waveform contains a 63 kHz pulse width modulated signal riding on top of a 60 Hz sinusoidal waveform. Removal of the 60 Hz component requires a high-pass filter with a pass-band edge above 60 Hz. This type of filter can be implemented using a finite-impulse-response (FIR) digital filter. Using this filter on a signal with at a 10 MSample/s sample rate will require filters with a very large number of taps, which compute slowly. To reduce the required number of filter taps to a more useable value, you can reduce the effective sampling rate using the combination of analog filtering, decimation, and digital filtering.
The upper trace in Fig. 3 is the acquired waveform sampled at 10 MSamples/s. The goal is to reduce the sample rate by 10:1, which you can accomplish by first low-pass filtering the acquired data with a bandwidth of less than 1/2 the desired effective sampling rate of 1 MSample/s.

Math trace F2, second from the top, is the signal after being low-pass filtered with a bandwidth of 500 kHz. Math Trace F3, third from the top, applies the 10:1 decimation function. The resultant decimation reduces the effective sample rate to 1 MSample/s.

Math trace F4, the bottom trace, is the set up for the high-pass filter. The cutoff frequency is 200 Hz with a transition zone width of 50 Hz. Note that the 60 Hz component has been reduced significantly by the filtering process and is no longer visible.

Decimation has broadened the range of the digital filter used to remove the 60 Hz component.

Source link

Spread the love

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.