Friday, January 7, 2011

The Nyquist Theorem and Analog to Digital Conversion

Telecommunications is magic measured in nanoseconds. The most magical part to me is how something analog like the human voice is made digital for transport and then made analog again to the listener. All thanks to a theory first published in 1924 by a Bell Labs scientist named Harry Nyquist.


We start with frequency. Sound is represented as waves. The amount of time these waves repeat is called frequency. We measure the frequency of these waves in seconds of time and it is represented as a Hertz (Hz). 1 Hz means the wave repeated once every second.


The human voice ranges between 300 Hz and 3400 Hz. For telecommunication sampling purposes we use a frequency of 4000 Hz to make sure we capture the full spectrum with some room to spare.


Enter Harry Nyquist. In a very down and dirty description, the Nyquist Theorem states that when you sample noise you must double the amount of its frequency in order to get a close to perfect representation of it. In voice telecommunications this means a 4000 Hz voice range must be sampled 8000 times per second.


Using this information your phone system uses an algorithm called a codec (coder/decoder). The codec uses this algorithm to convert the samples from analog to digital format for transport, then digital to analog format when received. This is accomplished through a method called pulse code modulation (PCM). I am not going to explain PCM in this blog but it is an important concept to keep in the back of your mind.


Now is the real fun part. Binary data is either a "0" or "1" and is called a bit (binary digit). In digital transmission we create "letters" out of a series of 8 bits, known as an "octet" or a "byte". If we have 8 bits of information representing a sample and 8000 samples (8 bits X 8000 samples), than we need 64,000 bits per second for bandwidth to truly represent the human voice. 64 kbps ... 64 kbps ... 64 kbps ... Sound familiar?




64kbps is the voice channel in T1, the DS0, the b-channel in ISDN. It goes by many names and is found in VoIP, wireless, fiber optics, microwave and all manners of telecommunications.


Of course the more we sample something the better we represent it. However we are limited in our telecom world by bandwidth. 64 kbps for voice seems to suit us very nicely. We can easily reduce it to 56 kbps but the quality is simply not as good. I have experimented with VoIP using 32 kbps, 24 kbps and 16 kbps. The voice quality is simply horrible once the sampling rates are reduced.


My conclusion is that 64 kbps for voice is here to stay for a long time. Thank you Mr. Nyquist, your theory still stands tall 87 years later.

No comments:

Post a Comment