Library / Signal processing and digital filters / DSP-27
Signal processing and digital filters
High-pass FIR by spectral inversion
Tap n of a high-pass filter made from a symmetric low-pass filter of unit DC gain and N taps (up to 7), by subtracting it from a unit impulse at the centre.
- Ref
- DSP-27
- Rev
- v1
- Field
- Signal processing and digital filters
- Result
- hHP[n]
A low-pass filter with unit DC gain has taps that sum to 1. Subtracting it from a unit impulse placed at the centre tap d = (N − 1)/2 leaves taps that sum to 0, so the DC gain is zero, while the delay is unchanged. The result h_HP[n] = δ[n − d] − h_LP[n] is a high-pass filter that passes everything the low-pass blocked.
Tap n of a high-pass filter made from a symmetric low-pass filter of unit DC gain and N taps (up to 7), by subtracting it from a unit impulse at the centre. This keeps the delay and gives zero DC gain. The page returns one high-pass tap; the whole set is in the derived rows.
Calculator
- Centre tap index, ⌊(N − 1)/2⌋1
- DC gain of the low-pass taps, Σh1
- DC gain of the high-pass filter, 1 − Σh0
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.
- High-pass tap 0 is −0.25, and the high-pass DC gain is 0, as required for blocking DC.
- The method needs a symmetric, odd-length low-pass filter: with an even length the impulse falls between taps and the high-pass has a null at Nyquist.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing () | Local step | Change in result |
|---|---|---|---|---|---|---|
| h0 Low-pass tap 0 | −1 to 1 | −1 | 1 | 2 | +0.04 | +16 % |
| n Tap index | 0 to 2 | −0.25 | 0.5 | 0.75 | +1 | −300 % |
| N Number of taps | 3 to 7 taps | −0.25 | −0.25 | 0 | +1 taps | 0 % |
| h1 Low-pass tap 1 | −1 to 1 | −0.25 | −0.25 | 0 | +0.04 | 0 % |
| h2 Low-pass tap 2 | −1 to 1 | −0.25 | −0.25 | 0 | +0.04 | 0 % |
| h3 Low-pass tap 3 | −1 to 1 | −0.25 | −0.25 | 0 | +0.04 | 0 % |
| h4 Low-pass tap 4 | −1 to 1 | −0.25 | −0.25 | 0 | +0.04 | 0 % |
| h5 Low-pass tap 5 | −1 to 1 | −0.25 | −0.25 | 0 | +0.04 | 0 % |
| h6 Low-pass tap 6 | −1 to 1 | −0.25 | −0.25 | 0 | +0.04 | 0 % |
Sweep of Tap index
| Tap index | High-pass tap |
|---|---|
| 0 | −0.25 |
| 0.25 | −0.25 |
| 0.5 | 0.5 |
| 0.75 | 0.5 |
| 1 | 0.5 |
| 1.25 | 0.5 |
| 1.5 | −0.25 |
| 1.75 | −0.25 |
| 2 | −0.25 |
Sweep one variable
Variables and how each one contributes
High-pass tap
What the equation gives you. Everything else feeds it.
Number of taps
The number of taps, up to 7 here (odd for a true centre tap). Sets which tap is the centre of the impulse. Raising it by 10 % (to 3.3) moves the result by +0 %, from −0.25 to −0.25.
Tap index
The tap index to return. Selects which high-pass tap is computed; the centre tap gets the 1. Raising it by 10 % (to 0) moves the result by +0 %, from −0.25 to −0.25.
Low-pass tap 0
The low-pass tap h[0] (ignored if 0 ≥ N). Is subtracted from the impulse at tap 0. Raising it by 10 % (to 0.275) moves the result by +10 %, from −0.25 to −0.275.
Low-pass tap 1
The low-pass tap h[1] (ignored if 1 ≥ N). Is subtracted from the impulse at tap 1. Raising it by 10 % (to 0.55) moves the result by +0 %, from −0.25 to −0.25.
Low-pass tap 2
The low-pass tap h[2] (ignored if 2 ≥ N). Is subtracted from the impulse at tap 2. Raising it by 10 % (to 0.275) moves the result by +0 %, from −0.25 to −0.25.
Low-pass tap 3
The low-pass tap h[3] (ignored if 3 ≥ N). Is subtracted from the impulse at tap 3. Raising it by 10 % (to 0) moves the result by +0 %, from −0.25 to −0.25.
Low-pass tap 4
The low-pass tap h[4] (ignored if 4 ≥ N). Is subtracted from the impulse at tap 4. Raising it by 10 % (to 0) moves the result by +0 %, from −0.25 to −0.25.
Low-pass tap 5
The low-pass tap h[5] (ignored if 5 ≥ N). Is subtracted from the impulse at tap 5. Raising it by 10 % (to 0) moves the result by +0 %, from −0.25 to −0.25.
Low-pass tap 6
The low-pass tap h[6] (ignored if 6 ≥ N). Is subtracted from the impulse at tap 6. Raising it by 10 % (to 0) moves the result by +0 %, from −0.25 to −0.25.
Worked example with the values above
- Centre tap: d = ⌊(3 − 1)/2⌋ = 1; the impulse is 0 at tap 0.
- Low-pass tap: h[0] = 0.25.
- h_HP[0] = 0 − 0.25 = −0.25.
Assumptions and limits
- A symmetric, odd-length linear-phase FIR design with cutoffs in cycles per sample, between 0 and 0.5.
- The window value w is for the same tap index n and the same length N.
Common mistakes
- Using a cutoff in hertz where cycles per sample are needed.
- Using an even length with a high-pass design, which places a null at Nyquist.
- Forgetting to normalise the sum of the taps to one when unit DC gain is needed.
Statistics and uncertainty
Window-method designs meet their targets only approximately: a Kaiser-based tap count is a good estimate but is typically 5 % to 10 % off, so always check the achieved response and adjust the length.
Where it is used
- Designing low-pass, high-pass and band-pass FIR filters by the window method.
- Estimating filter length and delay before committing to a design.
Maths you need
- Normalised sinc: sinc(x) = sin(πx)/(πx)
- Cutoff in cycles per sample: c = fc/fs
- Linear phase: a symmetric FIR has a constant delay of (N − 1)/2 samples