Sample Rate Conversion - Digital Sample Rate Conversion

Digital Sample Rate Conversion

There are at least two ways to perform digital sample rate conversion:

  • (a) If the two frequencies are in a fixed ratio, the conversion can be done as follows: Let F = lowest common multiple of the two frequencies. Generate a signal sampled at F by interpolating 0s in the original sample. This will also introduce replicas at multiples of the baseband frequency. Remove these with a digital low pass filter, until only the signals with less than half of the output sample frequency remain. Then reduce the sample rate by discarding the appropriate samples.
  • (b) Another approach is to treat the samples as a time series, and create any needed new points by interpolation. In theory any interpolation method can be used, though linear (for simplicity) and a truncated sinc function (from theory) are most common. If samples are being removed(lower sample rate), a low pass filter at half the output frequency can be applied to bandlimit the signal before interpolation, reducing the likelihood of aliasing.

Although the two approaches seem very different, they are mathematically identical. Picking an interpolation function in the second scheme is equivalent to picking the impulse response of the digital filter in the first scheme. Linear interpolation is equivalent to a triangular impulse response; sinc will be an approximation to a brick-wall filter (it approaches the desirable "brick wall" filter as the number of points increase).

If the sample rate ratios are known, fixed, and rational, method (a) is better, in theory. The length of the impulse response of the filter in (a) is the same as choosing the number of points used in interpolation in (b). In approach (a), a slow precomputation such as the Remez algorithm can be used to compute the "best" response possible given the number of points (best in terms of peak error in various frequency bands, and so on). Note that a truncated sinc function, though correct in the limit of an infinite number of points, is not the most accurate filter for a finite number of points.

However, method (b) will work in more general cases, where the sample rate ratios are not rational, or two real time streams must be accommodated, or the sample rates are time varying. An important distinction in method (b) is whether the result contains more or fewer samples: if the result is upsampled(more samples), the form of interpolation has the most impact on the final result; conversely, if the result is downsampled(fewer samples), the ability of the low-pass filter to bandlimit - or whether any filter is used - becomes increasingly important as the differential in sampling frequency increases.

Normally, due to the mathematical operations employed, the output samples of sample rate conversion are almost always computed to more precision than the output format can hold. Conversion to the output bit size can be done by simple rounding, or more sophisticated methods such as dither or noise shaping can be employed.

Read more about this topic:  Sample Rate Conversion

Famous quotes containing the words sample, rate and/or conversion:

    The present war having so long cut off all communication with Great-Britain, we are not able to make a fair estimate of the state of science in that country. The spirit in which she wages war is the only sample before our eyes, and that does not seem the legitimate offspring either of science or of civilization.
    Thomas Jefferson (1743–1826)

    Unless a group of workers know their work is under surveillance, that they are being rated as fairly as human beings, with the fallibility that goes with human judgment, can rate them, and that at least an attempt is made to measure their worth to an organization in relative terms, they are likely to sink back on length of service as the sole reason for retention and promotion.
    Mary Barnett Gilson (1877–?)

    The conversion of a savage to Christianity is the conversion of Christianity to savagery.
    George Bernard Shaw (1856–1950)