ENG5027 Chap.9 FIR Design Using the DFT
FIR Design Using the DFT
FIR Design Using the DFT replaces the analytical integral with the FFT itself. The designer fills an array of bins with the desired gain, sets stop regions and their mirror bins to zero, and takes the inverse FFT.
Because the desired spectrum is conjugate-symmetric, the result is real and symmetric, but it is stored with its negative-time half wrapped to the end of the array, so the halves are swapped to make it causal and a window is then applied. The lecture example removes 45 to 55 Hz at 500 Hz with 200 bins, converting the band edges to bin numbers with the bin spacing and zeroing the matching mirror range.
The number of taps follows from resolution: the bin spacing is the sampling rate divided by the number of taps, so removing only DC at 1 kHz needs about 1000 taps for 1 Hz resolution in theory, and more in practice because the response takes several bins to rise. Library design routines expect cut-offs normalised to the Nyquist frequency, a frequent source of factor-of-two errors.
For a specified attenuation and transition width, the Kaiser window provides both a length estimate and a shape parameter, beta, which is zero below 21 decibels and rises with the attenuation asked for. The FIR tutorial and the second lab build on the same method, the lab requiring a general design function from the sampling rate and a list of stop ranges.
What this chapter covers
- 01
Designing a response directly in FFT bins
- 02
Positive, negative and mirror bins
- 03
Swapping halves to make the response causal
- 04
Bin indices for a bandstop
- 05
Tap count from frequency resolution
- 06
Theory against practice in tap count
- 07
Kaiser length and beta
Worked example · free
Bins and length for a mains-removal design
- 1The bin spacing is 1000 / 500 = 2 Hz.
- 248 to 52 Hz are bins 24 to 26, and their mirrors are bins 474 to 476; all six are set to zero.
- 1After the inverse FFT and the half swap, the symmetric response has a delay of about M/2 = 250 samples, a quarter of a second.
- 2For 45 dB the middle Kaiser branch applies: β = 0.5842(24)^0.4 + 0.07886(24) = 3.98.
Key terms
- Frequency resolution
- The spacing between design bins, equal to the sampling rate divided by the number of taps.
- Kaiser window
- A tunable window whose shape parameter beta trades stopband attenuation against transition width.
FIR Design Using the DFT FAQ
Why must the mirror bins be zeroed too?
A real impulse response needs a conjugate-symmetric spectrum. If only the positive bins are changed, the inverse FFT has an imaginary part and the filter no longer corresponds to a real-valued set of coefficients.
Why does the inverse FFT need its halves swapped?
The FFT stores negative time at the end of the array, so the raw output has the peak at index zero and its left half at the far end. Swapping the halves places the peak in the middle and gives a causal response.
Why are more taps needed than the resolution formula suggests?
The formula gives the bin spacing, but the windowed response needs several bins to move from stop to pass. A stop edge one bin wide therefore also attenuates frequencies just inside the passband, so extra taps are needed for a clean edge.
Exam move
Treat this chapter as practical arithmetic. For several sampling rates and tap counts, convert stop bands to bin ranges and write the mirror ranges straight after, then check them by converting back to hertz. Rehearse the full design sequence in order: fill the array, zero the stop and mirror bins, inverse FFT, take the real part, swap halves, apply a window.
Work the tutorial question on removing everything below a fraction of a hertz, computing the theoretical tap count and explaining why practice needs more. Practise the Kaiser formulas for attenuations in each of the three branches, checking which branch applies before substituting.
Because the second lab asks for a general function that takes the sampling rate and a list of stop ranges, sketch its structure on paper, including how DC is handled, and test it mentally on two different specifications. Avoid library design routines in your lab code; write the bin arithmetic yourself.
Working through FIR Design Using the DFT in ENG5027? Sia is AskSia’s AI Electrical Engineering tutor — ask any ENG5027 FIR Design Using the DFT question and get a clear, step-by-step explanation grounded in how ENG5027 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.