Tuesday, August 28, 2007

What is the Frequency, Kenneth?

There are mathematical proofs, there are empirical tests, and there are good narratives. When push comes to shove, the good story gets more believers.

Last year, at an SF convention, I attended a panel titled, The “Future in Oil,” which was about oil painting, and had three artists on it. One of them wound up talking about the difference between CDs and vinyl records (because a subject like oil painting tends to get a lot of artistic musing). The cherished narrative is that vinyl is better than digital. I did try to set the record straight, but there were true believers in the audience, as well as one tech guy who thought he knew what it was all about (he did not). I don’t try to win unwinnable arguments very often these days, though I do kvetch about it afterwards, hence this essay.

In my own personal history, one of the most fascinating courses I ever took was a graduate level thing “Voice and Image Processing.” It’s been interesting watching the technology of voice, sound, and video over the past thirty years catch up to the things we learned in that course. Add to that the fact that I’ve also had a number of friends and acquaintances who were sound and music nuts, and I will claim some expertise on the subject. Whatever else may be said, I am not uninformed, nor am I lacking for opinions.

So why do so many people think that vinyl LPs are better than CD? We’ll leave aside whatever buried agendas are being worked out (rebellion against the digital age, simple nostalgia, etc.). In fact, I’ll stipulate that many people have had experiences that are consistent with the hypothesis that vinyl is better than digital. Why?

I know of three answers to that question, one kinda obvious and unsurprising, one that gets seriously arcane, and one that’s just counter-intuitive.

Let’s first take the one that’s unsurprising. In the production process for making an LP or CD, there is a thing called the “Master” tape, which is mixed, balanced, and frequency adjusted for the medium. Not surprisingly, CDs and LPs have different frequency responses. In fact, the old LPs had a lot of special things done to the frequency response to compensate the need to put all the sound in those little, inherently noisy, grooves. Then, on playback the “phono” jack on the pre-amplifier had a frequency response curve built into it to undo all those special tweaks. The net result was an RIAA standard “compensation curve” built into the master, to achieve closer to a flat frequency response for the final product.

When CDs first came out, and the record companies realized that they could make tons of money selling baby boomers their favorite music yet again (first on LP, then cassette, then CDs, and some poor guys had the Beatles on 8-track, too). In a few cases, they didn’t bother re-mastering the tapes, and the things sounded just horrible, especially in the high frequencies, which were artificially “bright.” In other cases, they did “digitally re-master” the tapes, but the guys who did it weren’t as good as the guys who had originally done it. So CDs got a reputation as being “harsh.”

Then there was the fact that early CD players weren’t up to properly implement the theory of sound sampling.

To understand what went wrong there, let’s start with the Nyquist Sampling Theorem. Short version: you can perfectly reconstruct any wave form like a sound signal, provided you sample it at a rate that is at least twice the frequency of the highest frequency in the signal. In the above noted course, we actually went through the proof of the NST, and while I can no more reproduce it than you can reproduce an aria by sampling it at ten samples per second, I did once know it well enough to have the sort of belief in it that qualifies as “faith” for my kind.

So CDs use a standard that samples at 44,000 samples per second, which, theoretically can perfectly reproduce sound up to 22 kHz, but actually is set up to go to 20 kHz, because you need to put in a high frequency cut-off.

See, if you try to reproduce sound at something less than the Nyquist rate, you get a phenomenon known as “aliasing,” where the lower frequencies also have an “alias” signal that is frequency shifted up to higher frequencies. This isn’t the same as a harmonic, because the frequency shift is related to the sampling rate, not to the original signal. I’ve heard aliased sound, and it’s one of the most unpleasant things I’ve ever heard, but I can’t think of any analogies for it. It just sounds alien and wrong.

So above 22 kHz in the analog signal that is reconstructed from a CD, you get this horrible noise. You can try to filter it out of the analog signal, but filters are imperfect, so some faint residual alias remains. Worse, real circuits have some slight non-linear responses, non-linear in the mathematical sense, not in the sense of a “linear frequency response.” What a mathematically non-linear effect can do it to take a high frequency signal and leak some of it to a lower frequency. Thus, the aliased signal above 22 kHz could result in some faint distortion down where even hearing-damaged Boomers could hear it.

Again, more for the CD reputation of “harshness.”

The aliasing problem was eventually solved by digital filtering. What later generation CD players do is to use “oversampling.” Basically, the original 44,000 samples per second is converted through interpolation to many more samples (12X oversampling is common). Then, use a digital filter to make damn sure that there aren’t any aliased frequencies in the thing, so when you finally do the digital-to-analog conversion, you only need a pretty good high-frequency cutoff filter. This winds up being both effective and cheap. Win/win.

Finally we come to the strange one. I think I saw it in Science a couple of years ago. I’m not even sure if it spoke to the issue with CDs vs LPs, but the implications were obvious, even if the result was counter-intuitive. Simply put, our perception of sound is such that we hear things more clearly if there is a little bit of low level noise in the mix. I think the speculation was that the noise allows us to “calibrate” our perceptions on the fly. Whatever the reason, it flies in the face of everything in sound reproduction in the past century. Noise is supposed to be your enemy, not your friend.

But the implication is that the slight surface noise that you get on even the best turntable with an LP actually assists your sound perception. Go figure.

In any case, I’ve made CDs of vinyl LPs; not all LPs have been re-issued, and besides, I don’t like buying the same thing twice. I’ve listened to the resultant CDs, and I don’t believe that anyone can tell the difference between the CD and the source LP. Furthermore, there have been many, many, controlled A/B tests of whether or not anyone can tell the difference, and it’s a simple fact that whatever differences there may be, they are imperceptible to human beings.

And if that’s not enough, Frank Zappa looked into the matter and he agreed; CDs can perfectly reproduce vinyl, if you want them to.

None of this will convince anyone who is sure that LPs, vinyl, and analog are better than CDs and bitstreams. Vinyl is “organic” (which is perfectly true in the chemical sense), while CDs and digital are harsh and artificial. And that’s a simple narrative, as opposed to what I’ve just described, which is convoluted (little math joke there) and knurdish.

I’m fine with that; I’d rather be right than win an argument.


Lab Rat said...

As an imperfect receiver has a minimum threshold below which otherwise-clear signals are not detectable, introducing random noise can actually improve reception.

One runs into this in radio systems - sometimes noise is introduced INSIDE the receiver to take advantage of this property.

Blogger said...

Quantum Binary Signals

Professional trading signals sent to your cell phone every day.

Follow our trades NOW & gain up to 270% a day.