← Back to the chapter · Previous detail · Next detail →

Technical detail · Audio Feature Extraction for IoT

Pre-emphasis, finite frames, and the window response

The MFCC path begins with a first-order pre-emphasis filter:

y[n]=x[n]−αx[n−1],0≤α<1.y[n]=x[n]-\alpha x[n-1], \qquad 0\leq\alpha<1.

Its transfer function and frequency response are

H(z)=1−αz−1,∣H(ejω)∣=1+α2−2αcos⁡ω.H(z)=1-\alpha z^{-1}, \qquad \left|H(e^{j\omega})\right|= \sqrt{1+\alpha^2-2\alpha\cos\omega}.

At DC, the gain is ∣1−α∣|1-\alpha|; at the Nyquist frequency it is ∣1+α∣|1+\alpha|. With α=0.97\alpha=0.97, those gains are 0.03 and 1.97 respectively. The filter therefore suppresses slow/common components relative to rapid changes, partly flattening the downward spectral tilt common in voiced speech and improving numeric use of the later spectrum. It can also emphasize high-frequency sensor noise, so alpha and the decision to use pre-emphasis belong in the feature version rather than being assumed for every machine sound.

Speech and many mechanical sounds are not stationary over a whole recording. The short-time approximation forms frame ii with hop RR and length NN:

xi[n]=x[n+iR]w[n],0≤n<N.x_i[n]=x[n+iR]w[n],\qquad 0\leq n<N.

At 16 kHz, a 25 ms frame has N=400N=400 samples and a 10 ms hop has R=160R=160, so adjacent frames overlap by 240 samples, or 60%. The frame is short enough that its frequency mixture changes slowly within one analysis record, while the overlap gives an event near one frame edge another analysis window instead of treating each 25 ms block as isolated.

Truncating a waveform with a rectangular window multiplies it sharply in time, which convolves its spectrum with a high-sidelobe sinc-like response and spreads energy into unrelated FFT bins. A Hamming window tapers the endpoints:

w[n]=0.54−0.46cos⁡(2πnN−1).w[n]=0.54-0.46\cos\left(\frac{2\pi n}{N-1}\right).

That taper reduces sidelobes and therefore spectral leakage, at the cost of a wider main lobe and reduced ability to separate very close tones. Window choice is a measurement trade, not decoration: a speech-envelope model often accepts the wider lobe, whereas a narrow machine-fault tone may require a longer frame or a different window.

← Back to the chapter · Previous detail · Next detail →