Interview questions & answers
Q1. What is an FIR filter and what are its main advantages over IIR?
An FIR (Finite Impulse Response) filter produces output as a weighted sum of the current and past N-1 input samples only, with no feedback path, giving it an impulse response of finite duration. Its main advantages are guaranteed BIBO stability regardless of coefficient values, the ability to achieve exact linear phase (constant group delay), and the absence of limit cycle oscillations in fixed-point implementations on hardware like the TMS320C5545. Linear phase is critical in audio processing, QAM demodulation, and ECG signal analysis where waveform shape preservation matters — an IIR filter cannot achieve exact linear phase.
Follow-up: What is the computational cost of an FIR filter compared to an IIR filter for the same stopband attenuation?
Q2. What does linear phase mean in an FIR filter and why is it important?
Linear phase means the filter's phase response is a linear function of frequency (φ(ω) = -αω), which corresponds to a constant group delay α — all frequency components are delayed by the same number of samples. A Type I linear-phase FIR filter with 64 taps introduces a constant delay of 32 samples at all frequencies, preserving waveform shape exactly, which is essential in cardiac monitor QRS detection where phase distortion changes the apparent shape of the P-wave. IIR filters have nonlinear phase (frequency-dependent group delay) and therefore distort waveforms even if their magnitude response is perfect.
Follow-up: What are the four types of linear-phase FIR filters and what symmetry condition gives linear phase?
Q3. What is the window method for FIR filter design?
The window method starts from the ideal infinite-length impulse response of the desired filter (e.g., sinc function for a lowpass), truncates it to N taps, and multiplies by a window function to taper the edges and control side lobe levels in the frequency response. A 64-tap lowpass FIR with cutoff at 4 kHz (normalized 0.5 for 8 kHz sample rate) designed with a Hamming window achieves about -40 dB stopband attenuation and about 8% transition bandwidth. The main trade-off is that higher attenuation windows (Blackman: -74 dB) require more taps for the same transition bandwidth, increasing computation.
Follow-up: What determines the transition band width in the window design method?
Q4. What is the Parks-McClellan (equiripple) design method and when is it preferred over windowing?
The Parks-McClellan algorithm uses the Remez exchange algorithm to distribute the approximation error equally (equiripple) across the passband and stopband, minimizing the maximum error for a given filter order — it is the optimal minimax design. A 64-tap equiripple lowpass with -60 dB stopband achieves a narrower transition band than a 64-tap Hamming window design with the same -60 dB specification, meaning fewer taps are needed for the same performance. Parks-McClellan is preferred whenever filter order (and thus computational cost) must be minimized — it is the default algorithm in MATLAB's firpm() and most professional DSP design tools.
Follow-up: What is Gibbs phenomenon and does Parks-McClellan eliminate it?
Q5. How do you implement an FIR filter efficiently in C on a DSP or MCU?
Use a circular buffer for the delay line and a dot product (multiply-accumulate) loop: maintain a ring buffer of N input samples, and for each new sample compute the sum y=Σh[k]x[n-k] using a single MAC loop. On ARM Cortex-M4 with CMSIS-DSP, arm_fir_f32() implements the filter using 4-sample-parallel SIMD MAC instructions (VMLA.F32), achieving 4 multiplications per clock cycle. The most common mistake is using a shifting array instead of a circular buffer — shifting an N-element array per sample is O(N) memory operations versus O(1) for a circular buffer update.
Follow-up: What is the CMSIS-DSP function for a 32-bit integer FIR filter on Cortex-M4?
Q6. What is a symmetric FIR filter and how does symmetry reduce computation?
A symmetric FIR has coefficients satisfying h[k] = h[N-1-k], which is the condition for exact linear phase; this symmetry means only (N+1)/2 unique coefficient values exist, and computation can be halved by pre-adding symmetric input pairs before multiplying. For a 65-tap symmetric FIR, instead of 65 multiplications per output sample, you compute 32 additions of x[n-k]+x[n-(64-k)] and 32 multiplications plus one center multiplication — reducing from 65 to 33 multiplications. CMSIS-DSP's arm_fir_f32() does not exploit this symmetry, so hand-optimized symmetric FIR code for a TMS320 can run nearly twice as fast for the same filter.
Follow-up: Can an antisymmetric FIR also achieve linear phase?
Q7. What is a polyphase FIR filter and why is it used for sample rate conversion?
A polyphase filter decomposes an FIR filter into M subfilters (polyphase components) that operate at the lower sample rate, allowing interpolation or decimation without computing outputs for samples that will be discarded. For 4x interpolation with a 64-tap lowpass FIR, a direct implementation computes 64 MACs per output sample at 4x the input rate; the polyphase implementation uses 4 subfilters of 16 taps each, computing 16 MACs per output sample — a 4x reduction in computation. Polyphase decomposition is the key technique behind efficient sample rate converters in audio DACs, software-defined radios, and digital communications receivers.
Follow-up: What is the Noble identity and how does it justify polyphase decomposition?
Q8. What is multirate filtering — what are decimation and interpolation FIR filters?
Decimation reduces the sample rate by factor M by applying a lowpass FIR anti-aliasing filter followed by keeping every Mth sample; interpolation increases the sample rate by factor L by inserting L-1 zeros between samples and applying a lowpass FIR anti-imaging filter. The cutoff frequency of the decimation lowpass must be at most π/M to prevent aliasing — for 4x decimation from 192 kHz to 48 kHz, the FIR must cut off at 24 kHz. In a software radio receiver (RTL-SDR, USRP), cascaded CIC and FIR decimation filters convert 2.4 MSPS RF samples to 48 kSPS audio at manageable computation rates.
Follow-up: What is a CIC filter and why is it preferred for the first decimation stage?
Q9. How do you choose FIR filter length for a given set of specifications?
Use the Harris rule of thumb: N ≈ (fs/Δf) × (Atten_dB / 22), where Δf is transition bandwidth and Atten_dB is stopband attenuation in dB. For a lowpass at 4 kHz with 1 kHz transition band, -60 dB attenuation, and 44.1 kHz sample rate: N ≈ (44100/1000) × (60/22) ≈ 120 taps for a window design. The Parks-McClellan estimate uses N ≈ (2/3)×log10(1/(10×δp×δs)) / Δf_normalized, which usually gives 20–30% fewer taps than the Harris estimate, justifying its use for computationally constrained implementations.
Follow-up: What happens to the filter frequency response if you reduce the filter order below the design specification?
Q10. What is a half-band FIR filter and why is it computationally efficient?
A half-band FIR filter has its cutoff at exactly fs/4 and its coefficients satisfy h[n]=0 for all even n except n=0, meaning approximately half the coefficients are zero and can be skipped in the MAC loop. A 63-tap half-band FIR effectively requires only 32 non-zero multiplications per output sample instead of 63, making it nearly twice as fast as a general FIR of the same length. Half-band filters are the preferred building block for 2x decimation stages in audio and SDR applications — cascading log₂(D) half-band stages achieves D-fold decimation with each stage running at progressively lower rates.
Follow-up: What is the transition band width of a half-band FIR filter relative to fs?
Q11. What is an FIR interpolation filter and what does imaging mean?
An FIR interpolation filter removes the spectral images that appear when upsampling — inserting L-1 zeros between samples creates unwanted copies of the baseband spectrum at multiples of the original sample rate. After inserting zeros for 4x interpolation of a 12 kHz audio signal, the spectrum contains images at 48 kHz, 96 kHz, and 144 kHz; the FIR lowpass at 24 kHz (= new_rate/2 / 2) suppresses these images below the noise floor. In a delta-sigma DAC for audio, the digital interpolation FIR runs at 256× oversampling rate (e.g., 11.2896 MHz for CD audio) and must have enough stopband attenuation to prevent images from folding into the audio band.
Follow-up: What is the gain of an interpolation filter and why must it compensate for inserted zeros?
Q12. What is convolution and how does FIR filtering implement it?
Convolution in discrete time computes the output y[n] = Σ h[k]x[n-k], which is a sum of scaled and shifted copies of the filter's impulse response h[k] in response to each input sample. FIR filtering directly implements this convolution: a 32-tap FIR computes 32 multiply-accumulate operations per output sample, which is equivalent to sliding the impulse response window across the input signal. Circular convolution versus linear convolution is a critical distinction in block-based processing — DFT-based filtering computes circular convolution, and overlap-add/save methods are used to obtain linear convolution from it.
Follow-up: What is the difference between linear convolution and circular convolution in signal processing?
Q13. What is the frequency response of an FIR filter and how do you compute it?
The frequency response H(e^jω) is the DTFT of the impulse response h[n], evaluated on the unit circle; for a 64-tap FIR, it can be computed efficiently by zero-padding h[n] to 1024 points and taking a 1024-point FFT. In practice, MATLAB's freqz(h, 1, 1024) does exactly this — it evaluates the FIR transfer function H(z) = Σh[k]z^(-k) at 1024 uniformly spaced points on the unit circle and plots magnitude and phase. The DFT of the coefficients gives you the sampled frequency response at N points; a denser evaluation (more zero-padding) gives a smoother plot but does not change the actual filter performance.
Follow-up: What does a pole-zero plot of an FIR filter always show, and where are the poles?
Q14. What is a matched filter in FIR context and where is it used?
A matched filter has an impulse response equal to the time-reversed and conjugated version of the signal it is trying to detect, maximizing the SNR of detection in additive white Gaussian noise. In a GPS receiver, the correlator for each satellite's C/A code is implemented as a 1023-chip FIR matched filter (or equivalently as a circular correlation using FFT), maximizing the detection SNR for that satellite's spreading sequence. The matched filter output peaks when the received signal aligns with the template, and the peak location gives the propagation delay used in GPS ranging.
Follow-up: What is the SNR gain of a matched filter for a rectangular pulse of duration T?
Q15. How does fixed-point versus floating-point arithmetic affect FIR filter design?
Fixed-point FIR implementation requires careful scaling of coefficients to Q15 or Q31 format to prevent overflow and maintain sufficient precision, while floating-point allows using the filter's designed coefficients directly without scaling concerns. A 64-tap FIR with Q15 (16-bit) coefficients accumulates products in a 32-bit or 40-bit accumulator to avoid overflow — the TMS320C5500 has a 40-bit accumulator specifically for this purpose. Coefficient quantization in Q15 fixed-point perturbs the designed frequency response, particularly at deep nulls and steep transitions; checking the quantized response with freqz(round(h*32768)/32768) before hardware deployment is essential.
Follow-up: What is coefficient sensitivity and which filter type (FIR or IIR) suffers more from it?
Common misconceptions
Misconception: An FIR filter with more taps always has better performance than one with fewer taps.
Correct: Performance depends on the design method and specifications; a well-designed equiripple FIR with 60 taps may outperform a windowed FIR with 80 taps for the same specifications because Parks-McClellan optimally distributes the error.
Misconception: FIR filters are always stable because they have no feedback.
Correct: FIR filters are always stable for bounded-coefficient filters because with no feedback poles are all at the origin, but in a poorly implemented recursive-form FIR or lattice FIR with coefficient errors, numerical overflow can occur causing incorrect but bounded outputs.
Misconception: Linear phase FIR filters introduce no delay.
Correct: Linear phase FIR filters introduce a constant group delay of (N-1)/2 samples — they delay all frequencies equally, preserving waveform shape, but they do add latency proportional to the filter order.
Misconception: The window method and Parks-McClellan always give the same filter for the same specifications.
Correct: Parks-McClellan produces an optimal equiripple filter requiring fewer taps than a window-designed filter for the same attenuation and transition bandwidth specifications.