The Foundations: Speech Science and Digital Signal Processing
Speech is humanity's most fundamental and intimate form of communication, a biological marvel we often take for granted. From the moment we are born, we instinctively produce and interpret sounds to express needs, share ideas, and forge social bonds. Yet behind this effortless ability lies a complex cascade of physical events—air from the lungs setting vocal folds into vibration, the intricate shaping of the vocal tract, and the precise encoding of these acoustic waves by our auditory system. Understanding this process is not merely an academic pursuit; it is the essential first step toward replicating it with machines. The journey from analog sound waves to digital representations that machines can manipulate forms the bedrock of modern speech technology. This chapter lays that foundation, bridging the gap between the physics of human speech and the mathematical tools used to analyze it. We will begin by exploring how speech is generated and perceived, then transition into the core principles of digital signal processing (DSP) that allow us to capture, represent, and dissect these sounds. The concepts of sampling, convolution, and the Fourier transform will emerge not as abstract mathematics, but as practical instruments for peering into the frequency domain—a perspective crucial for understanding speech. We will then focus on speech-specific feature extraction, culminating in the Mel-Frequency Cepstral Coefficients (MFCCs), a representation that has powered speech recognition systems for decades. The chapter concludes with a hands-on laboratory session using Python's `librosa` library, where you will load an audio file, visualize its waveform and spectrogram, compute its MFCCs, and critically evaluate the strengths and limitations of each representation. By the end, you will have moved from the biological origins of speech to a concrete, computational handle on its digital essence, equipped with the fundamental tools that subsequent chapters will build upon.
1.1 The Physics of Speech Production: The Source-Filter Model
At its core, spoken language is a product of aerodynamics and acoustics. The most influential framework for understanding this process is the source-filter model, first proposed by Gunnar Fant in the 1960s. This model elegantly separates speech production into two independent components: a sound source and an acoustic filter. The source generates a raw acoustic signal, while the filter—shaped by the vocal tract—modifies that signal's spectral characteristics. This separation is powerful because it allows us to analyze and synthesize speech by manipulating these two components independently.
1.1.1 The Sound Source: Phonation and Aperiodic Sounds
The primary sound source for voiced speech (such as vowels and voiced consonants like /b/, /d/, /g/) is the larynx, or voice box, located at the top of the trachea. Within the larynx reside the vocal folds (often called vocal cords), two muscular folds of tissue that can be adducted (brought together) and set into vibration by the airflow from the lungs.
When the lungs exhale, they create an air pressure differential across the glottis (the opening between the vocal folds). If the vocal folds are adducted, this pressure builds until it forces them apart, releasing a burst of air. The Bernoulli effect and tissue elasticity then cause the folds to snap back together, repeating the cycle. This self-sustained oscillation produces a quasi-periodic waveform rich in harmonics. The fundamental frequency of this vibration, perceived as pitch, is determined by the length, tension, and mass of the vocal folds. Typical values range from about 80 Hz for a low male voice to over 300 Hz for a high female or child's voice.
For unvoiced sounds (such as /s/, /f/, /t/), the vocal folds are abducted (held apart), and the sound source becomes aperiodic turbulence. Air is forced through a narrow constriction (e.g., between the tongue and alveolar ridge for /s/), creating a noisy, hissing sound. This turbulent noise is the source for fricatives and affricates. Plosive sounds like /p/, /t/, /k/ involve a complete closure followed by a sudden release, generating a transient burst of noise.
Thus, the source can be characterized as either periodic (voiced) or aperiodic (unvoiced), and this distinction is a primary attribute in speech analysis.
1.1.2 The Acoustic Filter: The Vocal Tract as a Variable Tube
Above the larynx lies the vocal tract, a resonant cavity extending from the glottis to the lips (and including the nasal cavity when the velum is lowered). Its shape can be dramatically altered by the movement of the tongue, jaw, lips, and soft palate. In the source-filter model, the vocal tract acts as an acoustic filter that shapes the spectrum of the sound source.
Acoustically, the vocal tract behaves like a tube with varying cross-sectional area, closed at one end (the glottis) and open at the other (the lips). Such a tube has natural resonant frequencies called formants. Formants are peaks in the spectral envelope of the speech signal and are critical for distinguishing different speech sounds, especially vowels. For example, the vowel /i/ as in "heed" has a low first formant (F1) and a high second formant (F2), while /ɑ/ as in "hod" has a high F1 and a lower F2. These formant frequencies are directly determined by the length and shape of the vocal tract: a longer, more constricted tract lowers formant frequencies, while a shorter, more open tract raises them.
The source-filter model can be expressed mathematically as a linear system: the output speech signal $s(t)$ is the convolution of the source signal $e(t)$ (glottal flow) with the impulse response of the vocal tract filter $h(t)$: $$s(t) = e(t) * h(t)$$ In the frequency domain, this becomes multiplication: $$S(\omega) = E(\omega) \cdot H(\omega)$$ where $H(\omega)$ represents the spectral shaping, i.e., the formant structure. This model assumes the vocal tract is a linear, time-invariant system during the short duration of a speech sound (typically 20-100 ms), a reasonable approximation for stationary segments.
1.1.3 The Acoustic Consequences: Formants and Harmonics
For a voiced sound, the source spectrum $E(\omega)$ consists of a series of harmonics at integer multiples of the fundamental frequency $F_0$, with amplitudes that generally decrease with frequency (approximately a $-12$ dB/octave roll-off for a glottal pulse). The filter $H(\omega)$ amplifies frequencies near its formants and attenuates others. The resulting speech spectrum $S(\omega)$ therefore exhibits a harmonic structure where the harmonics closest to the formant frequencies are boosted, creating the characteristic peaks.
This interplay explains why different vowels, produced with different vocal tract shapes, have distinct spectral signatures even when spoken at the same pitch. It also explains why the same vowel can sound different when spoken by a child (higher $F_0$, shorter tract) versus an adult. The source-filter model provides a parsimonious explanation for this variability.
1.1.4 Nasality and Other Modifications
The model can be extended to include nasal sounds like /m/, /n/, /ŋ/. When the velum is lowered, the nasal cavity is coupled to the vocal tract, introducing additional resonances (nasal formants) and anti-resonances (zeros) that characterize nasal quality. Other modifications, such as lip rounding (which lengthens the effective vocal tract and lowers formants) or constriction (which creates additional poles and zeros), can also be incorporated as alterations to the filter.
The source-filter model is not merely a theoretical construct; it is the basis for many speech synthesis systems (e.g., formant synthesizers) and provides a crucial framework for understanding what information is essential for representing speech—namely, the characteristics of the source (voicing, pitch) and the filter (for