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