University of Glasgow · FACULTY OF ELECTRICAL ENGINEERING

ENG5027 Chap.9 FIR Design Using the DFT

- one subject, every graph, every model, every mark
7 Chapters2-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 9 of 13 · ENG5027

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.

In this chapter

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

Q [6 marks]. A filter for 1 kHz ECG data must remove 48 to 52 Hz using the DFT method with M = 500 taps. Give the bin spacing, the bins to zero and their mirrors, the delay of the causal filter, and the Kaiser beta for 45 dB attenuation. The mark allocation is a self-test device and not the university's own scheme.
Kaiser β rises with the attenuation asked for: zero below 21 dB, a curved middle branch, then a straight line above 50 dB.Kaiser β rises with the attenuation asked for: zero below 21 dB, a curved middle branch, then a straight line above 50 dB.0215060900369stopband attenuation A (dB)Kaiser βA = 60 dB, β = 5.65β = 0 below 21 dB
Kaiser β rises with the attenuation asked for: zero below 21 dB, a curved middle branch, then a straight line above 50 dB.
  • 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.
The bins are 2 Hz apart; bins 24 to 26 and 474 to 476 are zeroed; the causal filter delays by about 250 samples; and the Kaiser beta for 45 dB is about 3.98.
Sia tip — Write the mirror range as M − k2 to M − k1 immediately after the stop range, so the two edits cannot drift apart.
Glossary

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.
FAQ

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.

Study strategy

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.

A+Everything unlocked
Unlocks this Bible + all 26 of your subjects at University of Glasgow, plus 1,000+ more Bibles across the AskSia library.
Sia - your ENG5027 tutor, unlimited, worked the way the exam marks it
The full 2-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works