Showing posts with label sampling rate. Show all posts
Showing posts with label sampling rate. Show all posts

Tuesday, January 24, 2012

All Bits are Significant; Some are More Significant Than Others


Neil Young told MTV News that listeners of MP3 audio hear only "5 percent" of the data in an original recording. He continued: "We're in the 21st century and we have the worst sound that we've ever had. It's worse than a 78 [rpm record]."

The math is solid. Looking at raw numbers, 24-bit/96KHz LPCM sound has 18x the bit rate of a 256K MP3. Invert that, and you get an MP3 worth roughly 5% of the original.

[Image credit: ~4ntigravity.]



But is bit rate alone a good relative measure? I'd like to convince you that it is not. Sample size is key.

In any discussion of bit rates, a chart like this is employed at some point. I'm guilty of using it myself. The trouble is, if you're trying to be more specific in making format comparisons than simply 'more is better,' reducing the argument to numeric multipliers is simplistic. All bits are significant; some are more significant than others.

Information increases exponentially with bit width.
Information is a measure of decrease in uncertainty. Saying that a sound sample can be encoded in N bits implies that N yes/no questions must be answered to resolve the uncertainty of its actual value. The maximal uncertainty to resolve (and hence potential information content) grows exponentially as sample size N increases.

As Carl Sagan said, not all bits have equal value. The greatest uncertainty is  removed by question 1, or the most significant bit (MSB), so this bit has the highest information value. The smallest uncertainty is removed by question N, or the least significant bit (LSB), so this bit has the lowest information value. Paradoxically, answering the questions becomes increasingly harder as you progress from MSB to LSB due to greater detail being supplied, i.e. the more sample bits you want, the more difficult they become to obtain.

In contrast, information content grows linearly with sampling rate. Doubling your rate produces twice as much information. Tripling the rate triples information, and so on.

Thus information contributed by sample size and sampling rate increase on different scales. While 24 16-bit samples and 16 24-bit samples have the same bit total, the larger samples took more effort to obtain and are more valuable bit-for-bit. I previously said you should seek and preserve maximum bits in the vinyl-to-digital transfer process. What I really meant was, seek and preserve information value.

Choose bigger samples over higher sampling rate if you can't maximize both.

              Vinyl-to-Digital Restoration #12              

Title: Live Rust
Artist: Neil Young & Crazy Horse
Genre: Rock
Year: 1979



Music buyers who only know an industry dominated by iTunes can't imagine a time when you needed to buy an entire double LP set just to get the one or two tracks you really wanted. The most significant bits for me on this title are from "Powderfinger" and "Like a Hurricane." Well worth the effort to obtain.


© 2012 Thomas G. Dennehy. All rights reserved.

Tuesday, January 17, 2012

100% Fidelity is Possible as We Approach Infinity. Are We There Yet?

A back-of-a-napkin capture of the Riemann Integral. 
The first step in ephemeralizing your LPs is to record them digitally, creating permanent archival copies. This is a step you only have to take once for each of your titles, but if you do it right, once is enough.

Recall that an information-rich map is always better than a back-of-a-napkin drawing. Create rich 24-bit/96KHz copies of your source material for archiving. Why? Read on.

Because we know we can't capture infinity digitally, the recording process is to sample the original; that is, to take a reading of the original sound wave at regular intervals Δi. The question is, how do we design a sampling process that will produce an optimal copy? Many people will tell you that "optimal" is a completely subjective characterization—not so (not "completely").

While virtually any scientific debate can turn subjective when opinion and evidence clash, math is uniquely impervious to opinion. "a(b + c) = ab + ac. Politicize that, bi***es." (Randall Munroe)

Without a priori knowledge about the sound being recorded, it is impossible to know if it is being captured accurately. But there is a proxy calculation that we can examine objectively.

A sound wave is a function F(t) of pressure v. time. Once a sample F(ti) is taken at time ti, the recorded sound value remains constant for Δi seconds until the next sample can be taken. Any Calculus Hero will recognize that, as we are sampling a sound wave, we are simulatneously calculating the Riemann Integral (approximate area below the curve) for it. Dude.

The width Δi and height F(ti) of a rectangle in the Riemann Integral determine the accuracy of the approximation. Both dimensions are under your control. Let's concentrate here on getting the proper width via high frequency sampling. Next time we'll look at getting the proper height by taking the best possible samples.

The Riemann Integral aproaches 100% accuracy as Δi 0. Thus you get progressively better approximations the more samples you can take in a closed interval. That's not my opinion, that's not even consensus opinion. That's math.

Because sound sampling is a real-time process, the total number of samples is less important than the number of samples you can take per second. This is your sampling rate, expressed in samples/sec or Hertz (Hz). Riemann says, the higher your sampling rate, the more accurate your source recording.

So what is a good practical sampling rate? Common sampling rates are:
  • 44.1 KHz CD Audio (CDDA)
  • 48 KHz DVD Audio (DVD-A)
  • 88.2 KHz 2x CDDA Rate
  • 96 KHz 2x DVD-A Rate
96KHz make sense for several reasons. First and foremost, it's higher that the other candidate rates (more is better). Second, 96 KHz is a common sampling rate supported by a wide variety of computer sound interface devices, so it's likely you can find one at a price you're willing to pay. Finally, because sampling theory says you can capture any frequency by sampling at twice that frequency 2f, 96KHz sampling captures frequencies up to 48KHz, well into the range inaudible to humans and above the upper range limit of even audiophile-class speakers.

Therefore my first recommendation for creating numerically accurate digital copies of your LPs is to set the sampling rate to 96 KHz. What do you think? Leave a comment.

              Vinyl-to-Digital Restoration #10              

Title: Gallery
Artist: Gallery
Contributing Artists: David Samuels; Michael DiPasqua; Paul McCandless; David Darling; Ratzo Harris
Genre: Jazz
Year: 1982
Despite the personnel involved having a pretty damn good pedigree, this album is lost to history. ECM Records never released it on CD, and even today has no entry for it on the ECM discography. Long ago I bought Gallery on vinyl for its link between the Paul Winter Consort and Orgeon. One of the best reasons for shepherding your analog past into the digital future is that your memory can be jogged. The record labels' memory can't.

© 2012 Thomas G. Dennehy. All rights reserved.