Basic Concepts of Speech Processing

Speech processing occupies a pivotal position at the intersection of digital signal processing and artificial intelligence, empowering machines to acquire, analyze, interpret, modify, and generate human speech. Although often grouped under the broader umbrella of audio processing, speech processing distinguishes itself through a focused concern for linguistic content, speaker identity, prosodic patterns, and the emotional nuances embedded in vocalization.
To enable computational processing, continuous human speech—physically a time-varying sound pressure wave—must be converted into discrete digital form. This digitization typically follows three fundamental stages:

  1. Sampling – The analog wave is measured at uniform intervals. The Nyquist-Shannon sampling theorem dictates that the sampling rate must exceed twice the highest frequency present in the signal. In telephony, 8 kHz is standard; wideband speech commonly uses 16 kHz; music and high-fidelity applications frequently adopt 44.1 kHz or 48 kHz.
  2. Quantization – Each sampled amplitude is mapped to a discrete level. A typical audio compact disc uses 16-bit depth, yielding 65,536 possible amplitude values.
  3. Encoding – Quantized values are stored according to a specific format. Pulse-Code Modulation (PCM) is the most straightforward, often packaged in WAV or AIFF containers; more efficient formats like FLAC provide lossless compression.

As a concrete example, a 16 kHz, 16-bit, mono PCM utterance consumes approximately:

16000 samples/s × 16 bit/sample = 256,000 bit/s ≈ 32 KB/s

Time-Domain and Frequency-Domain Analysis

The most immediate representation of a speech signal is its waveform in the time domain. Waveforms reveal amplitude modulation, silent intervals, transient noises, and the boundaries of spoken segments. Common time-domain features include short-time energy, zero-crossing rate, and autocorrelation, which quantify signal power and periodicity.

Because speech spectral content evolves rapidly, analysis is almost always performed in short time frames. The standard workflow is:

  • Pre-emphasis – Boosts high-frequency components to counteract the natural spectral roll-off of speech, typically implemented as (y[n] = x[n] - 0.97x[n-1]).
  • Framing – The continuous signal is segmented into short blocks, usually 20–40 ms in duration.
  • Windowing – Each frame is multiplied by a window function (e.g., Hamming or Hann) to mitigate spectral leakage at frame boundaries.
  • Fourier Transform – The discrete Fourier transform (DFT) converts each windowed frame from the time domain to the frequency domain, producing a short-time spectrum.

The short-time Fourier transform (STFT) is expressed as:
[
X(m,k) = \sum_{n=0}^{N-1} x[n+mH],w[n],e^{-j2\pi kn/N}
]
where (m) indexes the frame, (k) the frequency bin, (H) the hop size (frame shift), and (w[n]) the analysis window.

Acoustic Features that Capture Speech Content

Raw waveforms possess high dimensionality and redundancy, prompting the extraction of compact, perceptually relevant features.

  • Mel-frequency spectrogram – Linear frequency bins are warped onto the Mel scale, a nonlinear mapping that better reflects human auditory perception. This representation is widely used as input to deep learning models.
  • MFCC (Mel-frequency cepstral coefficients) – The industry classic for speech recognition. The computation pipeline comprises pre-emphasis, framing, windowing, FFT, Mel-filterbank application, logarithmic compression, and discrete cosine transform (DCT). Typically the first 12–13 coefficients are retained, often augmented with first- and second-order dynamic features (deltas).
  • Fundamental frequency (F0) – Reflects vocal fold vibration rate and determines perceived pitch. Adult male speakers typically range 60–200 Hz, while females and children exhibit higher ranges.
  • Formants (F1, F2, F3) – Resonant peaks of the vocal tract shaped by articulatory configuration; they are crucial for vowel discrimination.
  • Zero-crossing rate and short-time energy – Lightweight metrics frequently employed in voice activity detection (VAD) and endpointing.

Typical Speech Processing Pipeline

Using automatic speech recognition (ASR) as a reference, a complete system generally unfolds through these stages:

  1. Acquisition and preprocessing – Includes resampling, DC removal, pre-emphasis, and noise reduction.
  2. Speech activity detection (VAD) – Segregates voiced speech from silence or background noise, reducing unnecessary computation.
  3. Feature extraction – Computation of Mel spectrograms, MFCCs, or other domain-specific representations.
  4. Acoustic model – Maps extracted features to probabilities of phonemes, characters, or sub-word units. Modern models frequently leverage CNNs, RNNs, or Transformers.
  5. Language model – Evaluates the likelihood and fluency of candidate word sequences.
  6. Decoding – Jointly optimizes acoustic and language model scores to output the most probable transcription.

Speech synthesis (text-to-speech, TTS) reverses this flow: text analysis → prosody prediction → acoustic model generating spectral features → waveform synthesis via a vocoder.

Hands-On Example: Extracting MFCCs with Python

The librosa library provides a concise interface for feature extraction. The following snippet loads a mono utterance at 16 kHz and computes 13 MFCCs:

import librosa

# Load audio, resample to 16 kHz, force mono
y, sr = librosa.load("speech.wav", sr=16000, mono=True)

# Extract 13 MFCCs; n_fft=400 ≈ 25 ms at 16 kHz; hop_length=160 ≈ 10 ms
mfcc = librosa.feature.mfcc(
    y=y,
    sr=sr,
    n_mfcc=13,
    n_fft=400,
    hop_length=160
)

print(mfcc.shape)  # (13, number of frames)

# Append first and second deltas for dynamic features
delta  = librosa.feature.delta(mfcc)
delta2 = librosa.feature.delta(mfcc, order=2)
features = librosa.util.stack([mfcc, delta, delta2])

Practical Recommendations

  • Sample rate matching – Use 8 kHz for telephony-centric tasks; 16 kHz is a safe default for general-purpose ASR; 44.1/48 kHz for music or high-fidelity applications.
  • Frame parameters – A 25 ms frame length with 10 ms shift is a widely adopted starting point, balancing time resolution and spectral stability.
  • Feature selection – Traditional GMM-based systems often favor MFCCs with deltas; end-to-end deep learning pipelines frequently consume raw Mel spectrograms or log-Mel energies.
  • Preprocessing is non-negotiable – Noise suppression, normalization, and reliable VAD can dramatically improve downstream performance.
  • Toolkit choices – Popular libraries include librosa, torchaudio, Kaldi, ESPnet, and OpenAI Whisper, each offering optimized pipelines for research and production.

Mastering sampling, framing, spectral transformation, Mel-scale features, and the end-to-end processing flow forms the essential foundation for advancing into speech recognition, synthesis, and enhancement research or development.