Learning Objectives
484 words
2 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Learning Objectives - Extract MFCC features for speech recognition - Analyze pitch, formants, and energy - Understand cepstral analysis - Week 2: Fourier analysis, filtering - Understanding of frequency domain ## 1. Short-Term Analysis Speech is analyzed in overlapping frames: - Frame size: 20-30ms (320-480 sample...

Learning Objectives
- Extract MFCC features for speech recognition
- Analyze pitch, formants, and energy
- Understand cepstral analysis
- Week 2: Fourier analysis, filtering
- Understanding of frequency domain
1. Short-Term Analysis
Speech is analyzed in overlapping frames:
- Frame size: 20-30ms (320-480 samples at 16kHz)
- Frame shift: 10ms (160 samples at 16kHz)
- Window function: Hamming window (reduces spectral leakage)
2. Mel-Frequency Cepstral Coefficients (MFCCs)
The most common feature for speech recognition.
Extraction Steps:
- Pre-emphasis (boost high frequencies)
- Frame blocking and windowing
- Compute power spectrum (FFT)
- Apply Mel filterbank (triangular filters spaced on Mel scale)
- Log compression of filterbank energies
- Discrete Cosine Transform (DCT) -> MFCCs Mel Scale: Perceptually motivated frequency scale.
Human hearing is more discriminative at low frequencies -> Mel scale has higher resolution at low frequencies.
3. Pitch (Fundamental Frequency F0)
Pitch period = time between vocal fold openings. F0 = 1/pitch period.
- Typical F0: Male ~100-150 Hz, Female ~180-250 Hz, Children ~250-400 Hz
- Pitch detection: Autocorrelation, cepstral method, YIN algorithm
4. Energy & Zero-Crossing Rate
Energy: Sum of squared samples. Higher for vowels, lower for consonants. Zero-Crossing Rate: Number of times signal crosses zero. Higher for unvoiced sounds (noise-like), lower for voiced (periodic).
Q1: What are MFCCs and why are they effective for speech recognition?MFCCs represent the spectral envelope in a compact, perceptually relevant form. They capture: vocal tract shape (formants), are robust to noise, decorrelated (DCT), and based on human hearing (Mel scale). Q2: What is the Mel scale and why is it used?Psychophysical scale of perceived pitch. Human hearing has better frequency resolution at low frequencies. Mel scale approximates this: linear below 1kHz, logarithmic above. Filterbank has more filters at low frequencies. Q3: How is pitch (F0) estimated from speech?Autocorrelation method: compute correlation of signal with itself at different lags. Peak at lag corresponding to pitch period. Cepstral method: peak in cepstrum at pitch period (quefrency). YIN algorithm: cumulative mean normalized difference function. Q4: What features distinguish voiced from unvoiced sounds?Voiced: high energy, low ZCR, clear pitch, periodic waveform, strong formants. Unvoiced: low energy, high ZCR, no pitch, noise-like, flat spectrum. Q5: What are delta and delta-delta features?First and second derivatives of MFCCs (velocity and acceleration). Capture temporal dynamics (how features change over time). Essential for good recognition accuracy. Deltas: difference between adjacent frames. Delta-deltas: difference of deltas. Q6: Write Python to extract MFCCs using librosa:pythonimport librosa # Load audio y, sr = librosa.load('speech.wav', sr=16000) # Extract 13 MFCCs mfccs = librosa.feature.mfcc(y=y, sr=sr, n_mfcc=13, n_fft=512, hop_length=160) # mfccs shape: (13, num_frames)