Digital Signal Processing. The Scientist and Engineers Guide. Steven W. Smith
.pdf
358 |
The Scientist and Engineer's Guide to Digital Signal Processing |
corresponding to about ½ octave to the left, and two octaves to the right of the piano keyboard. Since octaves are based on doubling the frequency every fixed number of keys, they are a logarithmic representation of frequency. This is important because audio information is generally distributed in this same way. For example, as much audio information is carried in the octave between 50 hertz and 100 hertz, as in the octave between 10 kHz and 20 kHz. Even though the piano only covers about 20% of the frequencies that humans can hear (4 kHz out of 20 kHz), it can produce more than 70% of the audio information that humans can perceive (7 out of 10 octaves). Likewise, the highest frequency a human can detect drops from about 20 kHz to 10 kHz over the course of an adult's lifetime. However, this is only a loss of about 10% of the hearing ability (one octave out of ten). As shown next, this logarithmic distribution of information directly affects the required sampling rate of audio signals.
Sound Quality vs. Data Rate
When designing a digital audio system there are two questions that need to be asked: (1) how good does it need to sound? and (2) what data rate can be tolerated? The answer to these questions usually results in one of three categories. First, high fidelity music, where sound quality is of the greatest importance, and almost any data rate will be acceptable. Second, telephone communication, requiring natural sounding speech and a low data rate to reduce the system cost. Third, compressed speech, where reducing the data rate is very important and some unnaturalness in the sound quality can be tolerated. This includes military communication, cellular telephones, and digitally stored speech for voice mail and multimedia.
Table 22-2 shows the tradeoff between sound quality and data rate for these three categories. High fidelity music systems sample fast enough (44.1 kHz), and with enough precision (16 bits), that they can capture virtually all of the sounds that humans are capable of hearing. This magnificent sound quality comes at the price of a high data rate, 44.1 kHz × 16 bits = 706k bits/sec. This is pure brute force.
Whereas music requires a bandwidth of 20 kHz, natural sounding speech only requires about 3.2 kHz. Even though the frequency range has been reduced to only 16% (3.2 kHz out of 20 kHz), the signal still contains 80% of the original sound information (8 out of 10 octaves). Telecommunication systems typically operate with a sampling rate of about 8 kHz, allowing natural sounding speech, but greatly reduced music quality. You are probably already familiar with this difference in sound quality: FM radio stations broadcast with a bandwidth of almost 20 kHz, while AM radio stations are limited to about 3.2 kHz. Voices sound normal on the AM stations, but the music is weak and unsatisfying.
Voice-only systems also reduce the precision from 16 bits to 12 bits per sample, with little noticeable change in the sound quality. This can be reduced to only 8 bits per sample if the quantization step size is made unequal. This is a widespread procedure called companding, and will be
|
|
Chapter 22Audio Processing |
|
|
359 |
|||||
Sound Quality Required |
|
Bandwidth |
|
Sampling |
|
Number |
|
Data rate |
|
Comments |
|
|
|
|
|
||||||
|
|
rate |
|
of bits |
|
(bits/sec) |
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
High fidelity music |
|
5 Hz to |
|
44.1 kHz |
|
16 bit |
|
706k |
|
Satisfies even the most picky |
(compact disc) |
|
20 kHz |
|
|
|
|
|
|
|
audiophile. Better than |
|
|
|
|
|
|
|
|
|
|
human hearing. |
|
|
|
|
|
|
|
|
|
|
|
Telephone quality speech |
|
200 Hz to |
|
8 kHz |
|
12 bit |
|
96k |
|
Good speech quality, but |
|
|
3.2 kHz |
|
|
|
|
|
|
|
very poor for music. |
(with companding) |
|
200 Hz to |
|
8 kHz |
|
8 bit |
|
64k |
|
Nonlinear ADC reduces the |
|
|
3.2 kHz |
|
|
|
|
|
|
|
data rate by 50%. A very |
|
|
|
|
|
|
|
|
|
|
common technique. |
|
|
|
|
|
|
|
|
|
|
|
Speech encoded by Linear |
|
200 Hz to |
|
8 kHz |
|
12 bit |
|
4k |
|
DSP speech compression |
Predictive Coding |
|
3.2 kHz |
|
|
|
|
|
|
|
technique. Very low data |
|
|
|
|
|
|
|
|
|
|
rates, poor voice quality. |
|
|
|
|
|
|
|
|
|
|
|
TABLE 22-2
Audio data rate vs. sound quality. The sound quality of a digitized audio signal depends on its data rate, the product of its sampling rate and number of bits per sample. This can be broken into three categories, high fidelity music (706 kbits/sec), telephone quality speech (64 kbits/sec), and compressed speech (4 kbits/sec).
discussed later in this chapter. An 8 kHz sampling rate, with an ADC precision of 8 bits per sample, results in a data rate of 64k bits/sec. This is the brute force data rate for natural sounding speech. Notice that speech requires less than 10% of the data rate of high fidelity music.
The data rate of 64k bits/sec represents the straightforward application of sampling and quantization theory to audio signals. Techniques for lowering the data rate further are based on compressing the data stream by removing the inherent redundancies in speech signals. Data compression is the topic of Chapter 27. One of the most efficient ways of compressing an audio signal is Linear Predictive Coding (LPC), of which there are several variations and subgroups. Depending on the speech quality required, LPC can reduce the data rate to as little as 2-6k bits/sec. We will revisit LPC later in this chapter with speech synthesis.
High Fidelity Audio
Audiophiles demand the utmost sound quality, and all other factors are treated as secondary. If you had to describe the mindset in one word, it would be: overkill. Rather than just matching the abilities of the human ear, these systems are designed to exceed the limits of hearing. It's the only way to be sure that the reproduced music is pristine. Digital audio was brought to the world by the compact laser disc, or CD. This was a revolution in music; the sound quality of the CD system far exceeds older systems, such as records and tapes. DSP has been at the forefront of this technology.
|
|
|
|
|
|
|
|
|
Chapter 22Audio Processing |
|
|
|
|
|
361 |
|||||||||
|
|
|
|
|
|
Compact disc |
|
Sample |
|
|
|
|
|
|
|
Left channel |
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
14 bit |
|
Bessel |
|
Power |
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
rate |
|
|
|
Speaker |
|||||||||
|
|
|
|
|
|
|
|
|
|
converter |
|
|
DAC |
|
|
|
Filter |
|
Amplifier |
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
Reed- |
(×4) |
|
|
|
|
|
|
|
|
|
|
|
|
||
Optical |
EFM |
|
|
|
|
|
|
|
|
|
|
|||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||
Solomon |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pickup |
decoding |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||
decoding |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
Sample |
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
14 bit |
|
Bessel |
|
Power |
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
rate |
|
|
|
Speaker |
|||||||||
|
|
|
|
|
|
|
|
|
|
converter |
|
|
DAC |
|
|
Filter |
|
|
Amplifier |
|
||||
|
|
|
|
|
|
|
|
|
|
(×4) |
|
|
|
|
|
|
|
|
|
|
|
|
||
|
serial data |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Right channel |
||||||
|
(4.3 Mbits/sec) |
16 bit samples |
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
14 bit samples |
|
|
|
|
|
|
|
|||||||||||||||
|
|
|
|
|
|
|
|
|
at 44.1 kHz |
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
at 176.4 kHz |
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
(706 Kbits/sec) |
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
FIGURE 22-6
Compact disc playback block diagram. The digital information is retrieved from the disc with an optical sensor, corrected for EFM and Reed-Solomon encoding, and converted to stereo analog signals.
In addition to EFM, the data are encoded in a format called two-level ReedSolomon coding. This involves combining the left and right stereo channels along with data for error detection and correction. Digital errors detected during playback are either: corrected by using the redundant data in the encoding scheme, concealed by interpolating between adjacent samples, or muted by setting the sample value to zero. These encoding schemes result in the data rate being tripled, i.e., 1.4 Mbits/sec for the stereo audio signals versus 4.3 Mbits/sec stored on the disc.
After decoding and error correction, the audio signals are represented as 16 bit samples at a 44.1 kHz sampling rate. In the simplest system, these signals could be run through a 16 bit DAC, followed by a low-pass analog filter. However, this would require high performance analog electronics to pass frequencies below 20 kHz, while rejecting all frequencies above 22.05 kHz, ½ of the sampling rate. A more common method is to use a multirate technique, that is, convert the digital data to a higher sampling rate before the DAC. A factor of four is commonly used, converting from 44.1 kHz to 176.4 kHz. This is called interpolation, and can be explained as a two step process (although it may not actually be carried out this way). First, three samples with a value of zero are placed between the original samples, producing the higher sampling rate. In the frequency domain, this has the effect of duplicating the 0 to 22.05 kHz spectrum three times, at 22.05 to 44.1 kHz, 41 to 66.15 kHz, and 66.15 to 88.2 kHz. In the second step, an efficient digital filter is used to remove the newly added frequencies.
The sample rate increase makes the sampling interval smaller, resulting in a smoother signal being generated by the DAC. The signal still contains frequencies between 20 Hz and 20 kHz; however, the Nyquist frequency has been increased by a factor of four. This means that the analog filter only needs to pass frequencies below 20 kHz, while blocking frequencies above 88.2 kHz. This is usually done with a three pole Bessel filter. Why use a Bessel filter if the ear is insensitive to phase? Overkill, remember?
362 |
The Scientist and Engineer's Guide to Digital Signal Processing |
Since there are four times as many samples, the number of bits per sample can be reduced from 16 bits to 15 bits, without degrading the sound quality. The sin(x)/x correction needed to compensate for the zeroth order hold of the DAC can be part of either the analog or digital filter.
Audio systems with more than one channel are said to be in stereo (from the Greek word for solid, or three-dimensional). Multiple channels send sound to the listener from different directions, providing a more accurate reproduction of the original music. Music played through a monaural (one channel) system often sounds artificial and bland. In comparison, a good stereo reproduction makes the listener feel as if the musicians are only a few feet away. Since the 1960s, high fidelity music has used two channels (left and right), while motion pictures have used four channels (left, right, center, and surround). In early stereo recordings (say, the Beatles or the Mamas And The Papas), individual singers can often be heard in only one channel or the other. This rapidly progressed into a more sophisticated mix-down, where the sound from many microphones in the recording studio is combined into the two channels. Mix-down is an art, aimed at providing the listener with the perception of being there.
The four channel sound used in motion pictures is called Dolby Stereo, with the home version called Dolby Surround Pro Logic. ("Dolby" and "Pro Logic" are trademarks of Dolby Laboratories Licensing Corp.). The four channels are encoded into the standard left and right channels, allowing regular two-channel stereo systems to reproduce the music. A Dolby decoder is used during playback to recreate the four channels of sound. The left and right channels, from speakers placed on each side of the movie or television screen, is similar to that of a regular two-channel stereo system. The speaker for the center channel is usually placed directly above or below the screen. Its purpose is to reproduce speech and other visually connected sounds, keeping them firmly centered on the screen, regardless of the seating position of the viewer/listener. The surround speakers are placed to the left and right of the listener, and may involve as many as twenty speakers in a large auditorium. The surround channel only contains midrange frequencies (say, 100 Hz to 7 kHz), and is delayed by 15 to 30 milliseconds. This delay makes the listener perceive that speech is coming from the screen, and not the sides. That is, the listener hears the speech coming from the front, followed by a delayed version of the speech coming from the sides. The listener's mind interprets the delayed signal as a reflection from the walls, and ignores it.
Companding
The data rate is important in telecommunication because it is directly proportional to the cost of transmitting the signal. Saving bits is the same as saving money. Companding is a common technique for reducing the data rate of audio signals by making the quantization levels unequal. As previously mentioned, the loudest sound that can be tolerated (120 dB SPL) is about onemillion times the amplitude of the weakest sound that can be detected (0 dB
Chapter 22Audio Processing |
365 |
Noise |
|
Generator |
|
unvoiced |
|
Digital |
|
Filter |
synthetic |
|
|
voiced |
speech |
|
Pulse train |
|
vocal tract |
Generator |
|
response |
pitch
FIGURE 22-8
Human speech model. Over a short segment of time, about 2 to 40 milliseconds, speech can be modeled by three parameters: (1) the selection of either a periodic or a noise excitation, (2) the pitch of the periodic excitation, and (3) the coefficients of a recursive linear filter mimicking the vocal tract response.
the air flow, just behind the Adam's apple. In response to varying muscle tension, the vocal cords vibrate at frequencies between 50 and 1000 Hz, resulting in periodic puffs of air being injected into the throat. Vowels are an example of voiced sounds. In Fig. 22-8, voiced sounds are represented by the pulse train generator, with the pitch (i.e., the fundamental frequency of the waveform) being an adjustable parameter.
In comparison, fricative sounds originate as random noise, not from vibration of the vocal cords. This occurs when the air flow is nearly blocked by the tongue, lips, and/or teeth, resulting in air turbulence near the constriction. Fricative sounds include: s, f, sh, z, v, and th. In the model of Fig. 22-8, fricatives are represented by a noise generator.
Both these sound sources are modified by the acoustic cavities formed from the tongue, lips, mouth, throat, and nasal passages. Since sound propagation through these structures is a linear process, it can be represented as a linear filter with an appropriately chosen impulse response. In most cases, a recursive filter is used in the model, with the recursion coefficients specifying the filter's characteristics. Because the acoustic cavities have dimensions of several centimeters, the frequency response is primarily a series of resonances in the kilohertz range. In the jargon of audio processing, these resonance peaks are called the formant frequencies. By changing the relative position of the tongue and lips, the formant frequencies can be changed in both frequency and amplitude.
Figure 22-9 shows a common way to display speech signals, the voice spectrogram, or voiceprint. The audio signal is broken into short segments,
366 |
The Scientist and Engineer's Guide to Digital Signal Processing |
say 2 to 40 milliseconds, and the FFT used to find the frequency spectrum of each segment. These spectra are placed side-by-side, and converted into a grayscale image (low amplitude becomes light, and high amplitude becomes dark). This provides a graphical way of observing how the frequency content of speech changes with time. The segment length is chosen as a tradeoff between frequency resolution (favored by longer segments) and time resolution (favored by shorter segments).
As demonstrated by the a in rain, voiced sounds have a periodic time domain waveform, shown in (a), and a frequency spectrum that is a series of regularly spaced harmonics, shown in (b). In comparison, the s in storm, shows that fricatives have a noisy time domain signal, as in (c), and a noisy spectrum, displayed in (d). These spectra also show the shaping by the formant frequencies for both sounds. Also notice that the time-frequency display of the word rain looks similar both times it is spoken.
Over a short period, say 25 milliseconds, a speech signal can be approximated by specifying three parameters: (1) the selection of either a periodic or random noise excitation, (2) the frequency of the periodic wave (if used), and (3) the coefficients of the digital filter used to mimic the vocal tract response. Continuous speech can then be synthesized by continually updating these three parameters about 40 times a second. This approach was responsible for one the early commercial successes of DSP: the Speak & Spell, a widely marketed electronic learning aid for children. The sound quality of this type of speech synthesis is poor, sounding very mechanical and not quite human. However, it requires a very low data rate, typically only a few kbits/sec.
This is also the basis for the linear predictive coding (LPC) method of speech compression. Digitally recorded human speech is broken into short segments, and each is characterized according to the three parameters of the model. This typically requires about a dozen bytes per segment, or 2 to 6 kbytes/sec. The segment information is transmitted or stored as needed, and then reconstructed with the speech synthesizer.
Speech recognition algorithms take this a step further by trying to recognize patterns in the extracted parameters. This typically involves comparing the segment information with templates of previously stored sounds, in an attempt to identify the spoken words. The problem is, this method does not work very well. It is useful for some applications, but is far below the capabilities of human listeners. To understand why speech recognition is so difficult for computers, imagine someone unexpectedly speaking the following sentence:
Larger run medical buy dogs fortunate almost when.
Of course, you will not understand the meaning of this sentence, because it has none. More important, you will probably not even understand all of the individual words that were spoken. This is basic to the way that humans
