Resampling Audio: Technical Information
Note: if you are recording audio at a sample rate of 44.1 kHz (standard CD quality), the discussion below will not concern you, because you are not using audio resampling.
The non- power-of-two factored resampling algorithms used in Pure Vinyl are designed to be mathematically "correct:" that is, we upsample, zero-pad, filter, then downsample (which itself may involve a series of individual filtering and downsampling steps).
For example, starting with a 192 kHz sample rate, to obtain an exact-pitch decimation to 44.1 kHz requires a resampling factor of 147/(160 * 4) (common dividend of 441/(480 * 4)), e.g., upsample to 28,224 kHz, zero-pad, filter, downsample by 640.
We take the extra effort of using 64-bit (double precision) floating-point math for all filtering operations. In the Recorder, the signal path remains 64-bit floating point from the moment any filtering or equalization is performed, all the way to the very last possible moment when the audio is converted to 16, 24, or 32 bit format, preserving as much as possible the quality of the precious audio.
Clearly, a lot of computation is involved. Samples sourced at 192 kHz, already a respectably high sample rate, spawn an audio stream at 28,224 kHz - that's OVER TWENTY-EIGHT THOUSAND KILOHERTZ - a tremendous amount of number crunching. And we do it all with 64-bit math (which, as it turns out in this case, is REQUIRED to prevent accumulation of excessive computational rounding errors).
Too hot to handle
Unfortunately, the Exact resampler above requires more CPU resources than are available, and cannot be reliably performed in real-time (from 192 kHz) on today's personal computer hardware running a preemptive multitasking system like OS X.
There is no other way, mathematically, around this. Other software that decimates 192 KHz to 44.1 kHz at significantly (two times or more) faster than real-time is "cheating" by using simple interpolation or insufficient antialias filtering, that is guaranteed to introduce audible artifacts into your audio files. (Double-precision math is required by the filters necessary for this task - unfortunately, AltiVec single-precision vector processing isn't usable without introducing rounding errors that are unacceptable for destination resolutions greater than 16 bit). These problems easily can be verified through appropriate testing (verify sufficient filter attenuation; check for aliasing from out-of-band signals); but that's beyond the scope of this document.
Note that decimating from an "even" (or integer) multiple of two is trivial: just filter and downsample (skip every 2nd or 4th sample). That's why the decimation to 44.1 kHz from 88.2 or 176.4 kHz is MUCH faster - there are far fewer computations to perform. The hard case discussed here involves starting with 48, 96 or 192 kHz and decimating to 44.1 kHz.
The Pure Vinyl solution to high CPU requirements for decimation
The Pure Vinyl "Best" quality filter uses a slightly different technique, which significantly diminishes the CPU resources required. At 192 kHz, the Pure Vinyl "Best" quality filter upsamples by 11 (to 2,112 kHz), zero pads, filters, then downsamples by 48. "Best" also uses a relatively soft-kneed, gentle sloped high-order Butterworth filter, with a generous >117 dB attenuation at the Nyquist frequency, and even greater attenuation at higher frequencies. (The other, faster decimation options use a higher-order combination of elliptical filters with comparable attenuation at Nyquist.) This technique is MUCH faster than the Exact resampler above, because significantly less than one tenth of the computations are required.
What's the tradeoff? By using 11/(12 * 4) instead of 147/(160 * 4), a TINY pitch error of 0.2 percent (sharp) is introduced. How much is 0.2 percent? A note recorded at 440 Hz (sampled at 48, 96 or 192 kHz) will play back (after the "Best" decimation) at 441 Hz. This amount of pitch difference is imperceptible to most people.
Now, to a perfectionist, this might seem like a bad idea, but there are some good reasons for doing it this way.
Pitch error is usually there anyway
If the minor pitch shift introduced by the "Best" decimation option seems bothersome, consider that most synchronous (and even DC motor) turntables can have speed (pitch) errors of 1 percent or more! This is much larger than the 0.2 percent pitch error introduced by the "Best" decimator. (Exception being a quartz-locked direct drive deck, such as used by DJs. But these are undesirable for archiving vinyl because of motor-induced "cogging" jitter; belt drive is the preferred drive mechanism used by nearly 100% of high-end "audiophile" type turntables - VPI, Linn, SOTA, Michell, Rega, etc.)
Also consider that "most of us" can't hear the difference between a 440 Hz and 441 Hz pitch musical note (as an example of the pitch shift introduced). Another way of looking at it is that a song that's actually 7 minutes, 35 seconds long will play back in 7 minutes, 34 seconds. (As an aside, some radio stations actually played back music speeded up by as much as TEN PERCENT, to cram more programming content into an hour!)
The Best filter is the Best filter
We believe that the reduced computations of "Best" also result in an overall sonic benefit (less accumulation of mathematical rounding errors). This is true of any resampling to 44.1 kHz from non-integer multiples (48, 96, 192 kHz). The "gentle" rolloff knee (-1 dB at 20 kHz) of the high-order Butterworth filter used also causes less high-frequency ringing. And, it's what we use for making our own CD and iTunes jukebox conversions from vinyl (recording at 192 kHz)...
(Note that we also provide a "Better" quality 34/37 decimator that will operate concurrently with recording, and reduces the pitch error over "Best" by a factor of 10, to -0.02 percent (flat). In other words, a 441 Hz musical note will play back at 440.9 Hz; or the 7 minute, 35 second song above will be lengthened (by one tenth of a second) to 7 minutes, 35.1 seconds. The filters used in the 34/37 decimator are elliptical type, similar to the "Faster" and "Better" 0.2 percent decimator options.)
An Experiment
If you're still not convinced, try this experiment:
1. Decimate a high sample rate audio file with the Pure Vinyl editor, first using Best quality, then Exact quality. You'll only need a few minutes' worth (besides, the Exact decimation is going to take a while).
2. Create a Garage Band project and load both files into the project. Insure that the beginning of both files are aligned at exactly the same offset.
3. Play the tracks together. There should be no audible echo for at least several seconds, and no discernible "beating" due to the slightly different pitches of the tracks.
4. Disable one of the tracks. Hit Play. Note the pitch of the music.
5. Disable the first track. Play the other track. Can you hear any difference? If not, then use the "Best" decimator.
For the perfect-pitch perfectionist
If you still are bothered by this, and absolutely require that the decimated, CD quality audio have "perfect" pitch (and presuming that you're CERTAIN that your turntable is running at EXACTLY the correct speed, within 0.2 or 0.02 percent), and also want to archive the audio at a high sample rate and resolution, you have two other choices:
1. Downsample the high sample rate file later, in the Pure Vinyl editor, using the Exact option. Keep in mind that this will be VERY slow (taking about the same amount of time as the duration of the original recording - even if you have a relatively new computer to use; an older computer will be even slower).
2. Use an 88.2 or 176.4 kHz sample rate. This will permit downsampling directly to 44.1 kHz while recording, and will have exactly the "correct" pitch.