FIR filter design
도입됨이 수업의 내용
| English | 의미 |
|---|---|
| FIR/ˌef aɪ ˈɑː/ | 유한 펄스 응답 |
| tap/tæp/ | One weight h[k] of an FIR filter; the list of taps is the filter's impulse response. |
| phase/feɪz/ | 위상 |
| Hamming window/ˈhæmɪŋ ˈwɪndəʊ/ | 해밍 창 |
The filter you can prove things about
- The FIR 有限脉冲响应 filter is always stable, because it has no feedback.
- With symmetric taps its phase is exactly linear, so it delays passband frequencies equally. Amplitude filtering can still change the waveform's shape.
An FIR filter is stable whatever its tap values.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Its impulse response is a finite list, so the sum of |h[n]| is always finite.
What an FIR filter computes
- Each output is a weighted sum of the last $N$ inputs. Each weight $h[k]$ is a tap 抽头系数, and the sum is a convolution:
- Put in a single 1 (an impulse) and the taps come out one by one: the impulse response is the list of taps, so it ends after $N$ samples. That is the "finite" in FIR.
- The 3-tap moving average $h = [\tfrac13,\ \tfrac13,\ \tfrac13]$ meets a step: $x = 0, 0, 3, 3, 3, \dots$
- $y = 0,\ 0,\ 1,\ 2,\ 3,\ 3, \dots$: the output climbs over $N = 3$ samples, then holds. A longer filter smooths more and responds more slowly.
- Its frequency response: $H(f) = \tfrac13\left(1 + 2\cos\dfrac{2\pi f}{f_s}\right)$ (after removing the one-sample delay). DC passes with gain 1; $f_s/3$ is removed completely; Nyquist leaks through at $\tfrac13$.

- A moving average is a poor low-pass: its stopband comes back up. Choosing the taps on purpose, as below, fixes that.
An FIR filter has taps $h = [0.5,\ 0.3,\ 0.2]$. The input is $x = 2, 4, 6, \dots$ (starting at $n = 0$, zero before). Output $y[2]$?
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
$y[2] = 0.5x[2] + 0.3x[1] + 0.2x[0] = 0.5 \times 6 + 0.3 \times 4 + 0.2 \times 2 = 3 + 1.2 + 0.4 = 4.4$.
Window the ideal
- The ideal low-pass has an endless sinc as its impulse response. Cut it to $N$ taps by multiplying by a window $w[n]$.
- The window's own spectrum decides the result: its main lobe sets the transition width; its sidelobes set the stopband.
- The taps themselves, centred on $M = (N-1)/2$ with cutoff $f_c$:
- Worked, for the 67-tap design below ($f_c = 225$ Hz, $f_s = 1$ kHz, $M = 33$): the centre tap is $h[33] = 0.45$. Next to it, the sinc gives $\sin(0.9\pi)/\pi = 0.0984$, and the Hamming window $0.54 - 0.46\cos(2\pi \cdot 34/66) = 0.998$ barely trims it: $h[34] = 0.0982$. Far out at the ends the window falls to 0.08, which is what quiets the sidelobes.
Match each feature of the window's spectrum to what it sets in the filter.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
The window method is a lookup. Choose the window for depth, then N for width.
A windowed-sinc low-pass has $f_c = 100$ Hz and $f_s = 1$ kHz. Its centre tap $h[M]$ (the window is 1 there)?
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
지점 $n = M$ the sinc is 1, so $h[M] = 2f_c/f_s = 200/1000 = 0.2$. The centre tap is the fraction of the band that passes.
The window table
- Each window trades a wider transition for lower sidelobes. The Hamming window 海明窗 is the usual starting point:
| Window | Peak sidelobe | Transition width |
|---|---|---|
| rectangular | −13 dB | $0.9 f_s/N$ |
| Hann | −31 dB | $3.1 f_s/N$ |
| Hamming | −43 dB | $3.3 f_s/N$ |
| Blackman | −58 dB | $5.5 f_s/N$ |
- These are window sidelobes, not filter stopband guarantees. Choose a starting window and $N$, then verify the filter.
A filter needs at least 50 dB of stopband attenuation. Which window is the safe starting choice?
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Only Blackman's window sidelobes sit below −50 dB, so it meets the target by design; it needs more taps for the same transition. A Hamming filter can measure better than −43 dB (the check below finds −52.3 dB), but that is luck you verify, not a promise.
Linear phase
- Symmetric taps, $h[n] = h[N-1-n]$, give exactly linear phase 相位.
- Every frequency is delayed by the same $(N-1)/2$ samples, the group delay.

A symmetric FIR has 51 taps. What is its delay, in samples?
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
$(51 - 1)/2 = 25$ samples, the same for every frequency.
Worked example: size the filter
- At $f_{s} = 1$ kHz, passband edge 200 Hz and stopband edge 250 Hz give a 50 Hz transition: $N = 3.3 \times 1000/50 = 66$. Take 67, odd and symmetric.
- The delay is $(67 - 1)/2 = 33$ samples, 33 ms. With only 31 taps the transition widens to 106 Hz.
A Hamming FIR at f_s = 8 kHz needs a 400 Hz transition. Using N ≈ 3.3 f_s / Δf, how many taps is that before rounding to odd?
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
$3.3 \times 8000/400 = 66$, so take 67 taps for a Type I filter.
That 67-tap filter runs at 8 kHz. What is its delay, in ms? Give 3 decimal places.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
33 samples at 8 kHz is $33/8000 = 4.125$ ms.
Worked example: verify the promise
- Use a 225 Hz ideal cutoff and normalise the 67 windowed-sinc taps to unit DC gain. Compute their frequency response.
- A 0.025 Hz grid gives passband $-0.034$ to $+0.0045$ dB and stopband at most $-52.3$ dB: the design meets a $-43$ dB target with room to spare. Had the check shown, say, $-37$ dB, the filter would fail: lengthen it or move to a window with lower sidelobes, then check again.
A Hamming design measures a stopband of only −37 dB. What does that tell you?
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
A correct Hamming windowed-sinc design reaches about −43 dB or better (the 67-tap design measures −52 dB). A shallower stopband points to an error in the design or in the measured band, and only measurement reveals it.
Four common slips
- Designing without measuring. Every FIR should ship with its measured response.
- An even $N$ when an odd, symmetric (Type I) filter was intended.
- Forgetting the delay. 33 ms matters inside a control loop.
- Calling a moving average a low-pass filter. It smooths, but its stopband rises back to $\tfrac13$ at Nyquist.
Recap
- An FIR output is $\sum h[k]x[n-k]$: the taps are the impulse response, $N$ samples long.
- Window the ideal sinc: the window guides the stopband, $3.3 f_{s}/N$ the transition.
- Symmetric taps give linear phase with delay $(N-1)/2$.
- Measure the response against every specification.
어떤 문제가 있었나요? 사이트 팀만 이 내용을 볼 수 있습니다.