Sample-rate conversion


Sample-rate conversion is the process of changing the sampling rate of a discrete signal to obtain a new discrete representation of the underlying continuous signal. Application areas include image scaling and audio/visual systems, where different sampling rates may be used for engineering, economic, or historical reasons.
For example, Compact Disc Digital Audio and Digital Audio Tape systems use different sampling rates, and American television, European television, and movies all use different frame rates. Sample-rate conversion prevents changes in speed and pitch that would otherwise occur when transferring recorded material between such systems.
Within specific domains or for specific conversions, the following alternative terms for sample-rate conversion are also used: sampling-frequency conversion, resampling, upsampling, downsampling, interpolation, decimation, upscaling, downscaling. The term multi-rate digital signal processing is sometimes used to refer to systems that incorporate sample-rate conversion.

Techniques

Conceptual approaches to sample-rate conversion include: converting to an analog continuous signal, then re-sampling at the new rate, or calculating the values of the new samples directly from the old samples. The latter approach is more satisfactory, since it introduces less noise and distortion. Two possible implementation methods are as follows:
  1. If the ratio of the two sample rates is a fixed rational number L/M: generate an intermediate signal by inserting L − 1 0s between each of the original samples. Low-pass filter this signal at half of the lower of the two rates. Select every M-th sample from the filtered output, to obtain the result.
  2. Treat the samples as geometric points and create any needed new points by interpolation. Choosing an interpolation method is a trade-off between implementation complexity and conversion quality. Commonly used are: ZOH, cubic and windowed sinc function.
The two methods are mathematically identical: picking an interpolation function in the second scheme is equivalent to picking the impulse response of the filter in the first scheme. Linear interpolation is equivalent to a triangular impulse response; windowed sinc approximates a brick-wall filter. The length of the impulse response of the filter in method 1 corresponds to the number of points used in interpolation in method 2.
In method 1, a slow pre-computation can be used to obtain an optimal filter design. Method 2 will work in more general cases, e.g. where the ratio of sample rates is not rational, or two real-time streams must be accommodated, or the sample rates are time-varying.
See decimation and upsampling for further information on sample-rate conversion filter design/implementation.

Examples

Film and television

The slow-scan TV signals from the Apollo moon missions were converted to the conventional TV rates for the viewers at home. Digital interpolation schemes were not practical at that time, so analog conversion was used. This was based on a TV rate camera viewing a monitor displaying the Apollo slow-scan images.
Movies are converted to television. To convert a 24 frame/sec movie to 60 field/sec television, for example,. For 50 Hz systems such as PAL each frame is shown twice. Since 50 is not exactly 2×24, the movie will run 50/48 = 4% faster, and the audio pitch will be 4% higher, an effect known as PAL speed-up. This is often accepted for simplicity, but more complex methods are possible that preserve the running time and pitch. Every rather than twice, or digital interpolation can be used in a video scaler.

Audio

Audio on Compact Disc has a sampling rate of 44.1 kHz; to transfer it to a digital medium that uses 48 kHz, method 1 above can be used with L = 160, M = 147. For the reverse conversion, the values of L and M are swapped. Per above, in both cases, the low-pass filter should be set to 22.05 kHz.