Techniqueintro
Pre-emphasis
Also called pre-emphasis filter, preemphasis.
Filter speech by y[n] = x[n] - a x[n-1] with a near 0.97, which boosts high frequencies before spectral analysis.
Pre-emphasis passes speech through the one-zero filter with near 0.97 before the frames are analyzed, which raises the high frequencies by up to 36 dB relative to the low ones. It works along the samples of the waveform, once, before framing or inside each frame; RASTA filtering and delta features are filters along the frames of a feature sequence, and the equal loudness curve of perceptual linear prediction does a similar job on the spectrum and replaces it there. It is the usual first step of MFCC and of linear predictive coding.
In plain words
In voiced speech the low frequencies are much stronger than the high ones, because the vocal folds produce smooth pulses. The high frequencies still carry useful detail, such as the upper formants and the hiss of consonants, but an analysis that looks at the whole spectrum is dominated by the strong low part. Pre-emphasis evens this out. From each sample it subtracts almost all of the previous sample. Slow changes, which are the low frequencies, nearly cancel, and fast changes, which are the high frequencies, stay. The result sounds thin and bright, but the spectrum is flatter, and the later steps see all frequencies more equally.
When it applies
- The signal is voiced speech or a similar source, whose spectrum falls by about 6 dB per octave above a few hundred Hz, as the source-filter model explains (measurement).
- The next step fits or compares whole spectra: linear predictive coding, where a steep slope makes the autocorrelation matrix close to singular and the high formants poorly fitted, and MFCC, where the high bands would otherwise have very small energies.
- The features must match a model trained with the same filter. HTK and Kaldi recipes usually apply it with 0.97; many neural front ends on log mel energies leave it out, because the network can learn the weighting.
The template
- Choose , usually 0.95 to 0.97; this page and the area use .
- Compute for . For the first sample, take , or treat so that .
- Either filter the whole signal once and then cut frames, or cut frames first and filter each frame on its own; Kaldi does the second, after it removes the mean of the frame.
- Apply the window, the FFT and the rest of the front end to .
Frequency response (theorem). The filter is , an FIR filter with one zero at . On the unit circle, , which grows from at to at . At kHz and :
| (Hz) | 0 | 76 | 100 | 250 | 500 | 1000 | 2000 | 4000 | 8000 |
|---|---|---|---|---|---|---|---|---|---|
| 0.030 | 0.042 | 0.049 | 0.101 | 0.195 | 0.386 | 0.754 | 1.393 | 1.970 | |
| dB |
The gain is 3 dB above its DC value near Hz, rises by close to 6 dB per octave from a few hundred Hz to a few kHz, crosses 1 at Hz, and ends at dB at 8 kHz. The total range from 0 Hz to 8 kHz is 36.35 dB.
Inverse (theorem). The de-emphasis filter , that is , undoes it exactly when the same initial value is used. It is stable because .
Classic examples
A short signal. For and , the output is . De-emphasis gives back , , and .
A DC offset. A constant gives after the first sample, so pre-emphasis also removes 97 percent of a DC offset.
Two tones. At 16 kHz, a tone at 100 Hz comes out with 0.049 times its amplitude and a tone at 4000 Hz with 1.393 times, so their power ratio changes by dB.
Before linear prediction. On a voiced frame at 16 kHz, the normalized autocorrelation of the raw signal is close to 1, because neighbouring samples are nearly equal, and the Toeplitz matrix is then nearly singular. After pre-emphasis the ratio is smaller, and the all-pole fit spends its poles on the formants and not on the overall slope.
Variations
- Other coefficients. Values from 0.9 to 1.0 are in use. With the filter is the first difference, which removes DC completely.
- Adaptive pre-emphasis. Take for each frame, the first order predictor of the frame, so that the slope is removed as far as one zero can remove it.
- In the spectrum. Multiply the power spectrum by after the FFT. This is the same as the time domain filter on each frame up to the edge effects of the window.
- Equal loudness weighting. Perceptual linear prediction weights the critical band spectrum by an equal loudness curve, which boosts the middle frequencies, and does not use pre-emphasis.
- De-emphasis in synthesis. LPC coders and vocoders analyze pre-emphasized speech and apply the inverse filter to the synthesized output.
Pitfalls
- Mismatched front ends. Features computed with and without pre-emphasis, or with different , differ in every cepstral coefficient. Train and test with the same setting.
- Applied twice. A pipeline that pre-emphasizes the waveform and then calls a toolkit that does it again gets a second order high-pass with a range of over 70 dB.
- Signal or frame. Filtering the whole signal and filtering each frame differ at the first sample of every frame. The difference is small, but bit-exact comparisons fail.
- Noise at high frequencies. The filter raises the noise above about 2.7 kHz along with the speech. For noisy or band-limited audio, such as telephone speech, a smaller or none may be better.
- Sample rate. The filter is defined per sample, so its corner frequency scales with : at 8 kHz the same gives a crossing of 1 at 1355 Hz.
Exercises
- Derive and find the frequency where the gain is 1.
- Show that a sinusoid comes out as and find the phase as a function of and .
- For a signal with autocorrelation , , find the energy of the pre-emphasized signal, and the that minimizes it.
- Write the de-emphasis recursion and prove that it inverts pre-emphasis when both use .
- Find the total gain range from 0 Hz to in dB for , 0.95 and 0.97.
References
- The HTK Book, version 3.4, Chapter Speech Input/Output, the pre-emphasis of each frame with the coefficient PREEMCOEF
- Kaldi speech recognition toolkit, src/feat/feature-window.cc, the function Preemphasize, and its place in ProcessWindow after the removal of the DC offset and before the window
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag KX275F Edit this page History Report an error Markdown