Jump to content

Sample-rate conversion

From Wikipedia, the free encyclopedia
(Redirected fromSample rate conversion)

Sample-rate conversion,sampling-frequency conversionorresamplingis the process of changing thesampling rateor sampling frequency of adiscrete signalto obtain a new discrete representation of the underlyingcontinuous signal.[1]Application areas includeimage scaling[2]and audio/visual systems, where different sampling rates may be used for engineering, economic, or historical reasons.

For example,Compact Disc Digital AudioandDigital Audio Tapesystems use different sampling rates, and American television, European television, and movies all use differentframe rates.Sample-rate conversion prevents changes in speed andpitchthat would otherwise occur when transferring recorded material between such systems.

More specific types of resampling include:upsamplingorupscaling;downsampling,downscaling,ordecimation;andinterpolation. The termmulti-rate digital signal processingis sometimes used to refer to systems that incorporate sample-rate conversion.

Techniques

[edit]

Conceptual approaches to sample-rate conversion include: converting to an analog continuous signal, then re-sampling at the new rate, orcalculatingthe values of the new samples directly from the old samples. The latter approach is more satisfactory since it introduces less noise and distortion.[3]Two possible implementation methods are as follows:

  1. If the ratio of the two sample rates is (or can be approximated by)[A][4]a fixed rational numberL/M:generate an intermediate signal by insertingL− 1 zeros between each of the original samples. Low-pass filter this signal at half of the lower of the two rates. Select everyM-th sample from the filtered output, to obtain the result.[5]
  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 (according to application requirements). Commonly used are:zero-order hold(for film/video frames),cubic(for image processing) andwindowedsinc function(for audio).

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 abrick-wall filter(it approaches the desirable brick-wall filter as the number of points increases). 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 (such as theRemez algorithm) can be used to obtain an optimal (per application requirements) 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.

Seedecimationandupsamplingfor further information on sample-rate conversion filter design/implementation.

Examples

[edit]

Film and television

[edit]

Theslow-scan TVsignals from theApolloMoon 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.[6]

Movies (shot at 24 frames per second) areconverted to television(roughly 50 or 60 fields[B]per second). To convert a 24 frame/sec movie to 60 field/sec television, for example,alternate movie frames are shown 2 and 3 times, respectively.For 50 Hz systems such asPALeach 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 asPAL speed-up.This is often accepted for simplicity, but more complex methods are possible that preserve the running time and pitch. Everytwelfth frame can be repeated 3 timesrather than twice, or digital interpolation (see above) can be used in avideo scaler.

Audio

[edit]

Audio onCompact Dischas a sampling rate of 44.1 kHz; to transfer it to a digital medium that uses 48 kHz, method 1 above can be used withL= 160,M= 147 (since 48000/44100 = 160/147).[5]For the reverse conversion, the values ofLandMare swapped. Per above, in both cases, the low-pass filter should be set to 22.05 kHz.

See also

[edit]

Sample rate conversion in multiple dimensions:

Techniques and processing that may involve sample-rate conversion:

Techniques used in related processes:

Notes

[edit]
  1. ^For example, the irrational ratio 21/12,corresponding to one equal-temperament semitone, might be approximated by 196/185 (roughly 0.99994 semitones).
  2. ^A field is half of an interlaced frame – just the odd or even lines.

References

[edit]
  1. ^ Oppenheim, Alan V.;Schafer, Ronald W.;Buck, John R. (1999).Discrete-time signal processing(2nd ed.). Upper Saddle River, N.J.: Prentice Hall.ISBN0-13-754920-2.
  2. ^ Lyons, Richard (2010). "10. Sample Rate Conversion".Understanding Digital Signal Processing.Prentice Hall.ISBN978-0137027415.In satellite and medical image processing, sample rate conversion is necessary for image enhancement, scale change, and image rotation
  3. ^ Antoniou, Andreas (2006).Digital Signal Processing.McGraw-Hill. p. 830.ISBN0-07-145424-1.An alternative and more satisfactory approach...
  4. ^ Partch, Harry (2009).Genesis of a Music(Second ed.). Da Capo Press. p. 101.ISBN978-0306801068.The ratios of the "equal semitone" are, with progressive accuracy: 18/17, 89/84, 196/185
  5. ^ab Rajamani, K.; Yhean-Sen Lai; Furrow, C. W. (2000)."An efficient algorithm for sample rate conversion from CD to DAT"(PDF).IEEE Signal Processing Letters.7(10): 288.Bibcode:2000ISPL....7..288R.doi:10.1109/97.870683.
  6. ^ Bill Wood (2005),Apollo Television(PDF),NASA, p. 5

Further reading

[edit]
[edit]