pre emphasis filter calculator
Pre-Emphasis Filter Calculator guide
Pre-emphasis in speech analysis often uses a two-tap difference filter. Enter a present input sample, its immediately preceding input sample and the coefficient. The result shows the sample that would be sent to the next analysis stage. All values can be checked without loading a file or choosing an arbitrary FFT length.
Play the instrument ↑- Default result
- 0.112 output sample
Calculation and units
The first-order FIR is y[n] = x[n] − a x[n−1]. Its coefficient pair is [1, −a]. A constant signal produces a steady gain of 1−a, while a sequence alternating in sign produces 1+a at Nyquist. These are linear amplitude gains. No sample rate is required to calculate one output sample from two adjacent values.
Worked examples
Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.
Rising waveform
Pre-emphasis coefficient = 0.97 · Current sample = 0.5 · Previous input sample = 0.4.
0.112 output sample. FIR coefficients [1, -0.97]. DC gain 0.03; Nyquist gain 1.97. The previous sample is an input to the filter.
Adjacent samples on a rising edge leave a positive residual, even when the coefficient is close to one.
Flat segment
Pre-emphasis coefficient = 0.97 · Current sample = 0.5 · Previous input sample = 0.5.
0.015 output sample. FIR coefficients [1, -0.97]. DC gain 0.03; Nyquist gain 1.97. The previous sample is an input to the filter.
Equal input samples leave three percent of the constant value. This shows the finite DC gain.
Falling edge
Pre-emphasis coefficient = 0.97 · Current sample = 0.2 · Previous input sample = 0.8.
-0.576 output sample. FIR coefficients [1, -0.97]. DC gain 0.03; Nyquist gain 1.97. The previous sample is an input to the filter.
A positive input sample can produce a negative output as the previous sample is subtracted.
No emphasis
Pre-emphasis coefficient = 0 · Current sample = 0.5 · Previous input sample = 0.4.
0.5 output sample. FIR coefficients [1, 0]. DC gain 1; Nyquist gain 1. The previous sample is an input to the filter.
A zero coefficient sends the input through unchanged regardless of the previous sample.
First difference
Pre-emphasis coefficient = 1 · Current sample = 0.5 · Previous input sample = 0.5.
0 output sample. FIR coefficients [1, -1]. DC gain 0; Nyquist gain 2. The previous sample is an input to the filter.
With a coefficient of one a constant sequence cancels completely after the first sample.
Alternating peaks
Pre-emphasis coefficient = 0.97 · Current sample = 1 · Previous input sample = -1.
1.97 output sample. FIR coefficients [1, -0.97]. DC gain 0.03; Nyquist gain 1.97. The previous sample is an input to the filter.
A full-scale alternating sequence can produce output above one. Floating-point processing can preserve that headroom.
Interpreting the result
Make a deliberate choice for the predecessor at the beginning of a recording. When processing successive blocks, pass the last input sample of one block to the next to avoid boundary clicks or feature discontinuities. Use floating-point headroom when comparing strongly alternating samples; the output can exceed the normalized input range.
In a speech feature pipeline, apply the operation to the continuous sample stream before framing if continuity is important. Applying it independently to each frame changes the first sample of each frame and can affect frame-level spectra. Document the framing order and start condition when comparing features extracted by different tools or versions.
Measurement and model limits
The output depends on the previous sample even at a file boundary. A reproducible comparison should state the start condition and whether data arrive as a continuous stream or independent clips.
Music theory tools → · One-Pole Filter Coefficient Calculator → · librosa digital pre-emphasis documentation →
Answers before you play
Common questions
Do I feed back the last output?
No. This FIR stage uses the previous input. Feedback would produce a different filter with memory beyond one predecessor.
Why does a constant signal remain at 0.97?
The attenuation at DC is large but finite. With equal adjacent samples the output equals three percent of the input.
Is this analog FM broadcast pre-emphasis?
This page computes the discrete speech-processing difference equation. Broadcast pre-emphasis uses a separately specified response and time constant.
Does the sample have to be between minus one and one?
Normalized audio commonly uses that range. The equation is linear and the calculator also permits other consistent sample scales.