SoX has a high quality resampling algorithm that is also highly configurable. A comparison of resampling with several different settings (albeit for only one particular conversion) and with various other tools can be found at http://src.infinitewave.ca. The five sets of graphs shown for SoX there are the results of giving the following options with the rate effect:
|SoX 14.4 High Quality:||No options (this is the default setting)|
|SoX 14.4 High Quality (Aliasing Enabled):||-b 90 -a|
|SoX 14.4 VHQ Linear Phase:||-v -s|
|SoX 14.4 VHQ Intermediate Phase:||-v -s -I|
|SoX 14.4 VHQ Minimum Phase:||-v -s -M|
The VHQ settings produce 'sweep' graphs with impressively black backgrounds, but in fact these settings are overkill for most situations. See the FAQ for a simple guide to selecting rate settings.
The resampler is also available separately as the SoX Resampler library (libsoxr).
For advanced use, the graphs referenced below give further examples of how the parameters to the 'rate' effect control SoX's resampling filter, affecting in particular, the amounts of potential pre- and post- transient echo.
The X-axis shows time in seconds. Each line shows the affect of resampling a single sample impulse with the given rate options, thus revealing the filter's impulse response. The Y-axis is in dB; each peak (at 0 seconds) is minus a few dBFS; the minimum displayed value is minus 96dBFS.
The last four lines are from other popular resamplers (Secret Rabbit Code src & Shibatch ssrc) and are shown for comparison with SoX.
A linear phase response is characterised by an impulse that is symmetrical about the peak.