Saturday, March 2, 2013

LVL 0.1 [sampling]

So I've said that I would come back to the issue of analog to digital (A>D) conversion, and how this process can change the signal. This is the time for that! Speaking of which, time is another component of digitizing an analog signal-it needs to be sampled at a certain rate. This process is like taking a large number of "snapshots" of the audio, much like how there is a certain frame-rate for video. For CD quality this rate is 44 100 samples per second, or in other words the sample rate is 44.1 khz. Much like with video, it is also possible to use more frames per second to create a higher-resolution signal. Sample rates from 48khz, up to 192khz are also used to record audio, higher quality files being very helpful during the mixing and mastering process.

There is another aspect to a digital recording apart from the sample rate, called the bit depth. CD quality sound specifies a bit depth of 16 bits, giving the signal a potential of 65,536 possible dynamic levels. Once an analog signal has been converted to digital, the waveforms in that signal have been "frozen" in time at the sample rate, and in terms of dynamics at the bit depth that was selected while recording it. CD quality, although adequate during the advent of digital recording in the 1980's, is now no longer the defacto standard of digital audio. Ideally, one would want to record in 24 bit quality, as opposed to the 16 bits CD quality specifies. 24 bit audio gives a possible number of 16,777,216 dynamic levels, which is much better suited to reproducing the dynamics and subtleties of live instruments, especially drums and cymbals.

Along with increasing the bit depth to 24 bits, it is ideal to record at a 96khz sample rate instead of 44.1khz. Although many find this step unnecessary, pointing to the Nyquist–Shannon sampling theorem which states that as long as a sampling rate is above twice the highest frequency being sampled, you're good to go. This is only partially true. The simple reason why 44.1khz was chosen as a sample rate was that it humans can only hear from 20hz-20khz. The highest frequency CD quality audio can sample is the sample rate divided by two:

44.1 khz/2 = 22.05khz

22.05 khz being well above what we can hear, which is ideal as the top khz or two will be lost in the digital conversion and filtering process. This makes CD quality audio "good enough" for most purposes. But why do professionals record at rates up to 192khz, even though nobody can hear up to 96khz? The Nyquist frequency is only half the story, when one samples at a higher rate, one also divides up the signal into smaller and smaller portions. This means that the signal can be captured more accurately, which is essential in the digital recording process.

Even if one chooses to record at the CD sample rate, it is ideal to use 24 bit audio, though your files will end up being larger. Since I've already got into some math, I will show you the formula which lets you calculate the size of files recorded at certian samples rates and bit depths. (From the Wikipedia article)

"Bit rate = (sampling rate) × (bit depth) × (number of channels)"

"The eventual file size of an audio recording can also be calculated using a similar formula:

File Size (bits) = (sampling rate) × (bit depth) × (number of channels) × (seconds)"

To fill one of these in for an hour of stereo CD quality audio would go like this:

44100 x 16 x 2 x 3600 = 5080320000 bits

Divided by 8, since there are 8 bits in a byte,  gives us 635040000 bytes, which is 605.6 MB

To up the quality to 24 bits like has been suggested would give a filesize of 908.4 MB for an hour of stereo audio at the same sample rate of 44.1 khz. Increasing the sample rate to 96 khz would yield a filesize of 1977.5 MB or 1.93 GB. Compared to CD quality audio this is a 2.45 increase in filesize. It's up to you what you decide to fill your hard drive with, if the sound is really that much better to justify the increase in size of your projects. Again, this only applies to recordings you make yourself, anything that is already recorded at it's chosen sample rate and bit depth is "frozen" there, although it is certainly possible to convert between two rates, with some negligible loss in quality.

No comments:

Post a Comment