This page should probably be re-written, broken down into sub-pages, cleaned up, etc. Anyone want to do it? Go ahead!
SOUNDFILE CONVERSION
Changing a soundfile to a different sample rate or bit depth while maintaining maximum quality is not necessarily easy.
Another situation in which people like using 48 kHz is when the signal will go through some analog processing (such as mastering with expensive tweaked-out vintage compressors or some such) before the final 44.1 kHz product, in which case digital resampling is not an issue and some people think that initially working at 48 kHz is a bit better than 44.1.
One place to get more information is the rec.audio.pro FAQ at http://www.cs.ruu.nl/wais/html/na-dir/AudioFAQ/pro-audio-faq.html. Another great source of information on digital audio, with articles on many topics including normalization and dithering, is the Digital Domain site at www.digido.com/. Most of the information in this section was cribbed from those sources.
The ubiquitous tool for these jobs on Unix systems is SoX?.
SoX? is at: http://home.sprynet.com/~cbagwell/sox.html SoX? works, but you need a recent version. Early versions of SoX? had a reputation for poor sample-rate conversion. This has been addressed. Also, there are now alternatives to SoX? - see Joachim Thiemann's note about AFsp? below.
As of now (September 2000), SoX? version 12.17 supports three methods of sample rate conversion. It's important to use the right one.
Synopsis (as of SoX? 12.16 - I haven't checked out 12.17 yet): linear is fastest, and worst sounding (lots of aliasing). resample is probably best-sounding. Old bugs in resample seem to have been removed in version 12.16 and further improvements were made in 12.17. polyphase is slowest, and not generally as accurate as resample, but has been improved in version 12.17.
Sox now also provides simple 1/2 bit dithering via the mask effect. Noise-shaped dithering is not currently an option. (To learn more than you ever wanted to know about dither, do a dejanews search for dither in rec.audio.pro.)
Joachim Thiemann
"...The solution to the problem is to either resample the file to a "nice" division of 44.1kHz, like 22050Hz or 11025Hz, or to simply play the 8kHz file at 8018Hz rate - the <0.225% difference in playback speed is not perceptible. For the latter solution I had to write my own replacement for "play" (<100 lines of C)."
" --- The following is a blatant plug for our own software :-) We here at the McGill? signal processing lab have our own Audio processing code - see http://www.tsp.ece.mcgill.ca/software/index.html - which allowed me to write the above replacement for "play" in so little code. Also, the ResampAudio? utility (part of the AFsp? package) does a much better job at resampling than Sox does (and we can prove it, too! ;-)"
| Page history | Last edited Fri, 22 Feb 2008 08:38:10 +0000 | Edit this page |