Resample Waveforms with One Simple Express VI

Publish Date: Jul 11, 2014 | 10 Ratings | 2.80 out of 5 |  PDF

Overview

Software-based resampling is one of the many features built-in to LabVIEW. This is done using the Align and Resample Express VI.

Table of Contents

  1. Introduction
  2. Linear Interpolation
  3. Coerce Method
  4. Spline Interpolation
  5. FIR Filter-Based Interpolation

1. Introduction

Signal comparison is often not a trivial task. Even simple tasks, such as adding or subtracting waveforms, can be difficult – especially if the signals you are comparing lack common timestamps, sampling rates, and durations. You can either acquire simultaneously sampled signals which share the same timing settings, or acquire multiple signals of different timing settings. When using different timing settings for each signal, you can resample waveforms of different time parameters to change timestamps, sample period, and duration of one signal to match another signal.

A common example of the usefulness of resampling is performing audio manipulation with professional audio equipment. While these devices typically use a sampling rate of 48.0 kHz, home equipment typically processes sound at 44.1 kHz. Transferring sound from one system to the other requires that you resample one of the signals to match the other. With care, you can accomplish this without affecting the quality of the sound.

Software-based resampling is one of the many features built-in to LabVIEW, which includes an interactive Align and Resample Express VI. In short, interpolation, as applied to resampling, predicts new values based on existing signal samples that you input. The LabVIEW Express VI, gives you four methods of interpolation, discussed below.

Back to Top

2. Linear Interpolation

The linear interpolation method assumes that you know two neighboring samples of the waveform, and that between those two samples the signal changes at a constant rate. The algorithm essentially draws a straight line between these two samples and returns the appropriate point along that line.

 

Back to Top

3. Coerce Method

This method returns an output sample value equal to the input sample value closest to the output sample value in time. An advantage of the coerce method is that it requires almost no computation.

Back to Top

4. Spline Interpolation

The spline method uses the spline interpolation algorithm to compute the resampled values. The Express VI implementation relies on a cubic spline, yielding smooth transitions between the samples and good quality on single-shot short records.

Back to Top

5. FIR Filter-Based Interpolation

This method applies a digital finite impulse response (FIR) filter to compute the resampled values. With the Express VI implementation, you can set the attenuation level of aliased signal components. A normalized bandwidth selection also specifies the fraction of the smallest of input and output not attenuated. For example, when going from 44.1 to 48 kHz or from 48.0 to 44.1 kHz, you would always define these rates as the specified fraction of 44.1 kHz. This method provides excellent results for frequency analysis, although it is more intensive computationally.

Resampling is not only useful in the time domain. You also can use the resampling functionality to compare spectra with different df or f0. Or, you can use it to compare, for example, a logarithmic frequency-swept SPICE model with a linear frequency-axis FFT measurement.

The Align and Resample Express VI is optimized for two modes of operation -- single-shot and continuous. In single-shot mode, the function has a time-symmetric behavior and distributes the interpolation settling error on both sides, while the continuous settles only at the beginning of the first record but then expects the following input blocks to be time contiguous. For example, you can use the continuous mode to resample one hour of music from 44.1 to 48 kHz in one-second blocks.

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit