Library / Signal processing and digital filters / DSP-41
Signal processing and digital filters
Complex response from filter coefficients
Frequency response of a digital filter at one angular frequency ω (rad/sample), from up to four numerator and four denominator coefficients in order of increasing delay (set unused ones to zero).
- Ref
- DSP-41
- Rev
- v1
- Field
- Signal processing and digital filters
- Result
- |H|
The frequency response of a filter with numerator b and denominator a is H(ω) = Σ bₖe^(−iωk)/Σ aₖe^(−iωk), evaluated at the angular frequency ω (rad/sample). The magnitude is the gain and the angle is the phase at that frequency. A stable filter settles to this response for a steady sinusoid.
Frequency response of a digital filter at one angular frequency ω (rad/sample), from up to four numerator and four denominator coefficients in order of increasing delay (set unused ones to zero). The page returns the gain |H|; the real part, imaginary part and phase are in the derived rows.
Calculator
- Real part of H0.6923
- Imaginary part of H−0.6662
- Phase of H−43.9 °
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- At 1.047 rad/sample the filter has a gain of 0.9608 (−0.348 dB) and a phase of −43.9°.
- This is the steady-state gain and phase for a sinusoid at that frequency, assuming the filter is stable.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing () | Local step | Change in result |
|---|---|---|---|---|---|---|
| a3 Denominator coefficient a3 | −2 to 2 | 0.3004 | 3.862 | 3.562 | +0.08 | +9.4 % |
| a0 Denominator coefficient a0 | 0.1 to 2 | 0.4588 | 3.974 | 3.515 | +10% | −9.75 % |
| b3 Numerator coefficient b3 | −2 to 2 | 0.4836 | 3.088 | 2.605 | +0.08 | −7.88 % |
| b0 Numerator coefficient b0 | −2 to 2 | 0.4807 | 2.542 | 2.061 | +0.08 | +8.1 % |
| b1 Numerator coefficient b1 | −2 to 2 | 0.4807 | 2.542 | 2.061 | +0.08 | +8.1 % |
| b2 Numerator coefficient b2 | −2 to 2 | 0.9608 | 2.418 | 1.457 | +0.08 | +0.426 % |
| ω Angular frequency | 0 to 3.142 rad/sample | 1.436e-9 | 1.333 | 1.333 | +10% | −5.82 % |
| a2 Denominator coefficient a2 | −2 to 2 | 0.3203 | 1.331 | 1.01 | +0.08 | +6.31 % |
| a1 Denominator coefficient a1 | −2 to 2 | 0.3273 | 0.9993 | 0.6719 | +0.08 | −2.74 % |
Sweep of Angular frequency
| Angular frequency (rad/sample) | Gain |
|---|---|
| 0 | 1.333 |
| 0.3927 | 1.266 |
| 0.7854 | 1.097 |
| 1.178 | 0.8908 |
| 1.571 | 0.686 |
| 1.963 | 0.4962 |
| 2.356 | 0.3216 |
| 2.749 | 0.158 |
| 3.142 | 1.436e-9 |
Sweep one variable
Variables and how each one contributes
Gain
What the equation gives you. Everything else feeds it.
Numerator coefficient b0
The numerator coefficient b0, for a delay of 0 sample(s). Adds a term b0e^(−iω0) to the numerator. Raising it by 10 % (to 0.55) moves the result by +5.04 %, from 0.9608 to 1.009.
Numerator coefficient b1
The numerator coefficient b1, for a delay of 1 sample(s). Adds a term b1e^(−iω1) to the numerator. Raising it by 10 % (to 0.55) moves the result by +5.04 %, from 0.9608 to 1.009.
Numerator coefficient b2
The numerator coefficient b2, for a delay of 2 sample(s). Adds a term b2e^(−iω2) to the numerator. Raising it by 10 % (to 0) moves the result by +0 %, from 0.9608 to 0.9608.
Numerator coefficient b3
The numerator coefficient b3, for a delay of 3 sample(s). Adds a term b3e^(−iω3) to the numerator. Raising it by 10 % (to 0) moves the result by +0 %, from 0.9608 to 0.9608.
Denominator coefficient a0
The leading denominator coefficient, normally 1. Scales the whole response by 1/a₀ at all frequencies. Raising it by 10 % (to 1.1) moves the result by −9.75 %, from 0.9608 to 0.8671.
Denominator coefficient a1
The denominator coefficient a1, for a delay of 1 sample(s). Adds a feedback term a1e^(−iω1) and moves the poles. Raising it by 10 % (to −0.275) moves the result by +0.739 %, from 0.9608 to 0.9679.
Denominator coefficient a2
The denominator coefficient a2, for a delay of 2 sample(s). Adds a feedback term a2e^(−iω2) and moves the poles. Raising it by 10 % (to 0) moves the result by +0 %, from 0.9608 to 0.9608.
Denominator coefficient a3
The denominator coefficient a3, for a delay of 3 sample(s). Adds a feedback term a3e^(−iω3) and moves the poles. Raising it by 10 % (to 0) moves the result by +0 %, from 0.9608 to 0.9608.
Angular frequency
The angular frequency, in rad/sample (0 to π). Moves along the response; π is the Nyquist frequency. Raising it by 10 % (to 1.152) moves the result by −5.82 %, from 0.9608 to 0.9048.
Worked example with the values above
- Evaluate at ω = 1.0472 rad/sample with e^(−iωk) = cos ωk − i sin ωk for each coefficient.
- H = numerator / denominator = 0.69231 − 0.66617i.
- |H| = 0.96077, and the phase is −43.898°.
Assumptions and limits
- A stable, linear, time-invariant filter at a steady sinusoidal frequency in rad/sample.
- Phase that is consistently unwrapped, with magnitude not equal to zero at the frequency used.
Common mistakes
- Using wrapped phase, which jumps by 2π and ruins the delay.
- Mixing hertz and rad/sample in the delay formulas.
- Applying the forward–backward result to a single pass or to a record with large end transients.
Statistics and uncertainty
Phase and group delay come from phase differences, so they amplify noise where the magnitude is small and fail at zeros of the response. A secant estimate also carries an error of order Δω² times the third derivative of phase.
Where it is used
- Evaluating gain, phase and delay of a digital filter at a chosen frequency.
- Combining sections and predicting zero-phase filtering.
Maths you need
- Frequency response: H(ω) evaluated on the unit circle
- Group delay: the negative slope of phase against frequency
- Phase delay: the negative phase divided by frequency