Name
Rate -- change audio sampling rate
Synopsis
rate [-q|-l|-m|-h|-v] [override-options] RATE[k]
Function
Change the audio sampling rate (i.e. resample the audio) to any given RATE using a quality level defined as follows:

Here is an overview of the quality level options:

-q
Sets quality level to "quick". The band-width is n/a. The Rej dB is around 30 @ Fs/4. The typical use is playback on Fs/4 ancient hardware.

-l
Sets quality level to "low". The band-width is 80%. The Rej dB is 100. The typical use is playback on old hardware.

-m
Sets quality level to "medium". The band-width is 95%. The Rej dB is 100. The typical use is audio playback.

-h
Sets quality level to "high". The band-width is 95%. The Rej dB is 125. The typical use is 16-bit mastering (use with dither).

-v
Sets quality level to "very high". The band-width is 95%. The Rej dB is 175. The typical use is 24-bit mastering.

Band-width is the percentage of the audio frequency band that is preserved and Rej dB is the level of noise rejection. Increasing levels of resampling quality come at the expense of increasing amounts of time to process the audio. If no quality option is given, the quality level used is "high".

The "quick" algorithm uses cubic interpolation; all others use band-limited interpolation. By default, all algorithms have a "linear" phase response; for "medium", "high" and "very high", the phase response is configurable (see below).

The simple quality selection described above provides settings that satisfy the needs of the vast majority of resampling tasks. Occasionally, however, it may be desirable to fine-tune the resampler's filter response; this can be achieved using override options, as detailed in the following table:

-M/-I/-L
Phase response = minimum/intermediate/linear

-s
Steep filter (band-width = 99%)

-a
Allow aliasing/imaging above the pass-band

-b 74-99.7
Any band-width %

-p 0-100
Any phase response (0 = minimum, 25 = intermediate, 50 = linear, 100 = maximum)

N.B. Override options cannot be used with the "quick" or "low" quality algorithms.

All resamplers use filters that can sometimes create "echo" (a.k.a. "ringing") artefacts with transient signals such as those that occur with "finger snaps" or other highly percussive sounds. Such artefacts are much more noticeable to the human ear if they occur before the transient ("pre-echo") than if they occur after it ("post-echo"). Note that frequency of any such artefacts is related to the smaller of the original and new sampling rates but that if this is at least 44.1kHz, then the artefacts will lie outside the range of human hearing.

A phase response setting may be used to control the distribution of any transient echo between "pre" and "post": with minimum phase, there is no pre-echo but the longest post-echo; with linear phase, pre and post echo are in equal amounts (in signal terms, but not audibility terms); the intermediate phase setting attempts to find the best compromise by selecting a small length (and level) of pre-echo and a medium lengthed post-echo.

Minimum, intermediate, or linear phase response is selected using the -M, -I, or -L option; a custom phase response can be created with the -p option. Note that phase responses between "linear" and "maximum" (greater than 50) are rarely useful.

A resampler's band-width setting determines how much of the frequency content of the original signal (w.r.t. the original sample rate when up-sampling, or the new sample rate when down-sampling) is preserved during conversion. The term "pass-band" is used to refer to all frequencies up to the band-width point (e.g. for 44.1kHz sampling rate, and a resampling band-width of 95%, the pass-band represents frequencies from 0Hz (D.C.) to circa 21kHz). Increasing the resampler's band-width results in a slower conversion and can increase transient echo artefacts (and vice versa).

The -s "steep filter" option changes resampling band-width from the default 95% (based on the 3dB point), to 99%. The -b option allows the band-width to be set to any value in the range 74-99.7 %, but note that band-width values greater than 99% are not recommended for normal use as they can cause excessive transient echo.

If the -a option is given, then aliasing/imaging above the passband is allowed. For example, with 44.1kHz sampling rate, and a resampling band-width of 95%, this means that frequency content above 21kHz can be distorted; however, since this is above the pass-band (i.e. above the highest frequency of interest/audibility), this may not be a problem. The benefits of allowing aliasing/imaging are reduced processing time, and reduced (by almost half) transient echo artefacts. Note that if this option is given, then the minimum band-width allowable with -b increases to 85%.

Examples:

 
rate -s -a 44100 dither -s

This does default (high) quality resampling; overrides: steep filter, allow aliasing; to 44.1kHz sample rate; noise-shaped dither.

 
rate -v -I -b 90 48k

This does very high quality resampling; overrides: intermediate phase, band-width 90%; to 48k sample rate.

The pitch and speed effects use the rate effect at their core.


Show TOC