Your Equation

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

Solve for
taps
37
02
−11
−11
−11
−11
−11
−11
−11
  • 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 () current value −0.25
h0Low-pass tap 0Key driver
−11
nTap index
0.5
NNumber of taps
h1Low-pass tap 1
h2Low-pass tap 2
h3Low-pass tap 3
h4Low-pass tap 4
h5Low-pass tap 5
h6Low-pass tap 6
  • 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

VariableTypical rangeLowest resultHighest resultSwing ()Local stepChange in result
h0 Low-pass tap 0−1 to 1 −112+0.04 +16 %
n Tap index0 to 2 −0.250.50.75+1 −300 %
N Number of taps3 to 7 taps−0.25−0.250+1 taps0 %
h1 Low-pass tap 1−1 to 1 −0.25−0.250+0.04 0 %
h2 Low-pass tap 2−1 to 1 −0.25−0.250+0.04 0 %
h3 Low-pass tap 3−1 to 1 −0.25−0.250+0.04 0 %
h4 Low-pass tap 4−1 to 1 −0.25−0.250+0.04 0 %
h5 Low-pass tap 5−1 to 1 −0.25−0.250+0.04 0 %
h6 Low-pass tap 6−1 to 1 −0.25−0.250+0.04 0 %

Sweep of Tap index

Tap indexHigh-pass tap
0−0.25
0.25−0.25
0.50.5
0.750.5
10.5
1.250.5
1.5−0.25
1.75−0.25
2−0.25

Sweep one variable

High-pass tap ()Hover, touch, or use the arrow keys on the chart
−0.200.20.4 00.511.52 Tap index now −0.25

Variables and how each one contributes

hHP[n]

High-pass tap

Result ·

What the equation gives you. Everything else feeds it.

N

Number of taps

taps · typical 3 to 7

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.

n

Tap index

· typical 0 to 2

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.

h0

Low-pass tap 0

· typical −1 to 1

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.

h1

Low-pass tap 1

· typical −1 to 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.

h2

Low-pass tap 2

· typical −1 to 1

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.

h3

Low-pass tap 3

· typical −1 to 1

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.

h4

Low-pass tap 4

· typical −1 to 1

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.

h5

Low-pass tap 5

· typical −1 to 1

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.

h6

Low-pass tap 6

· typical −1 to 1

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

  1. Centre tap: d = ⌊(3 − 1)/2⌋ = 1; the impulse is 0 at tap 0.
  2. Low-pass tap: h[0] = 0.25.
  3. 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

Related formulas

Practise this formula