Interview questions

IIR Filter Interview Questions

IIR filter questions appear in DSP and control system interviews at Texas Instruments, Qualcomm, ABB, and Samsung Semiconductors. They are less common in IT company interviews but may appear in TCS embedded or digital signal roles. Expect IIR filter topics in the second technical round alongside FIR filter and z-transform questions, often with a request to sketch a direct form II structure or explain stability.

ECE, EI

Interview questions & answers

Q1. What is an IIR filter and how does it differ structurally from an FIR filter?

An IIR (Infinite Impulse Response) filter uses both current and past input samples AND past output samples (feedback), producing an impulse response that theoretically continues forever. A second-order IIR (biquad) computes y[n] = b0×x[n] + b1×x[n-1] + b2×x[n-2] - a1×y[n-1] - a2×y[n-2], requiring only 5 coefficients versus 100+ for an FIR with equivalent selectivity. The feedback makes IIR filters potentially unstable — poles must lie strictly inside the unit circle in the z-plane for BIBO stability.

Follow-up: Can an IIR filter achieve exact linear phase?

Q2. What is a Butterworth filter and what are its characteristics?

A Butterworth filter has a maximally flat magnitude response in the passband — no ripple — with a monotonically decreasing response into the stopband. An 8th-order Butterworth lowpass with -3 dB at 1 kHz achieves about -48 dB attenuation at 2 kHz (one octave into the stopband), following the 20N dB/decade rolloff rule where N is the filter order. Butterworth is chosen when passband flatness is critical and moderate transition band width is acceptable — it is the standard choice for anti-aliasing in measurement systems like oscilloscope front-ends and vibration analyzers.

Follow-up: How does the Butterworth filter compare to Chebyshev Type I in terms of transition band steepness for the same order?

Q3. What is the difference between Chebyshev Type I and Type II filters?

Chebyshev Type I has equiripple in the passband and a monotonic stopband, while Type II (inverse Chebyshev) has a monotonic passband and equiripple in the stopband. A 6th-order Chebyshev Type I with 1 dB passband ripple achieves a steeper transition than a 6th-order Butterworth, at the cost of 1 dB passband variation. Chebyshev Type II is preferred when the passband must be flat (like in a control system sensor filter) but the stopband can tolerate ripple — the opposite of Type I's trade-off.

Follow-up: What is an elliptic (Cauer) filter and how does it compare to Chebyshev in terms of filter order?

Q4. What is the bilinear transform and why is it used to design digital IIR filters?

The bilinear transform maps the analog s-domain to the digital z-domain using the substitution s = (2/T)(z-1)/(z+1), converting a continuous-time prototype filter into a discrete-time IIR filter with no aliasing. Unlike impulse invariance, which aliases frequencies above fs/2, the bilinear transform maps the entire imaginary axis of the s-plane onto the unit circle of the z-plane with a nonlinear (warped) frequency relationship. The frequency warping requires pre-warping the analog prototype's critical frequencies before applying the transform — for a 1 kHz cutoff at 8 kHz sample rate: ωa = (2/T)×tan(π×1000/8000) = 2×tan(π/8)×8000 ≈ 6629 rad/s.

Follow-up: What is frequency warping in the bilinear transform and how do you correct for it?

Q5. What is a biquad (second-order section) and why are higher-order IIR filters implemented as cascaded biquads?

A biquad is a second-order IIR section with transfer function H(z) = (b0 + b1z⁻¹ + b2z⁻²)/(1 + a1z⁻¹ + a2z⁻²), implementing one pair of complex conjugate poles and one pair of zeros. Higher-order filters are implemented as cascaded biquads because a single high-order direct form implementation is extremely sensitive to coefficient quantization errors — an 8th-order direct form IIR in Q15 arithmetic may be completely unstable, while four cascaded biquads with carefully ordered and paired poles and zeros maintain stability. The CMSIS-DSP arm_biquad_cascade_df2T_f32() function implements exactly this cascade structure.

Follow-up: What is the difference between Direct Form I and Direct Form II biquad structures?

Q6. What is the z-transform and how does it relate to IIR filter stability?

The z-transform converts a discrete-time signal or difference equation into a rational function of z, where the denominator polynomial roots are the poles and numerator roots are the zeros of the filter. An IIR filter is BIBO stable if and only if all poles lie strictly inside the unit circle |z|=1 in the z-plane — a pole at z=0.9 contributes a decaying exponential while a pole at z=1.1 contributes a growing exponential that eventually overflows. For a second-order section, the stability condition reduces to |a1| < 2 and a2 < 1 and a2 > -1 — checking these bounds is the first debug step when an IIR filter produces NaN outputs.

Follow-up: What is the region of convergence (ROC) of the z-transform?

Q7. What are limit cycles in fixed-point IIR filters and how do you prevent them?

Limit cycles are self-sustaining low-level oscillations in a fixed-point IIR filter that persist at the output even when the input is zero, caused by rounding in the feedback path interacting with poles near the unit circle. A second-order IIR on a TMS320C55x with Q15 coefficients and a pole pair at radius 0.99 can sustain a limit cycle of ±1 LSB that never decays, falsely appearing as residual signal in a quiet audio channel. Prevention methods include using sufficient word length (32-bit accumulation for Q15 coefficients), magnitude truncation instead of rounding, and the coupled-form (Gold-Rader) filter structure which is limit-cycle free for second-order sections.

Follow-up: What is deadband in the context of IIR limit cycles?

Q8. What is the impulse invariance method and why is it not suitable for highpass filter design?

Impulse invariance designs a digital IIR by sampling the impulse response of an analog prototype filter at rate T, which preserves the time-domain behavior but aliases the frequency response for components above fs/2. Because highpass and bandstop analog filters have energy at all frequencies including above fs/2, aliasing causes the digital filter's stopband to fold back into the passband, destroying the filter's frequency selectivity. Impulse invariance works well only for lowpass and bandpass filters with most energy below fs/4; bilinear transform is the standard method for highpass, bandstop, and any filter requiring accurate frequency response.

Follow-up: What is the aliasing issue in impulse invariance and at what frequency does it become problematic?

Q9. What is the Direct Form II transposed structure and why is it preferred for floating-point implementation?

Direct Form II Transposed (DF2T) reorganizes the biquad computation to share delay elements between numerator and denominator paths, using the minimum number of delay registers (2 for a biquad) and structuring the computation for sequential accumulation. In floating-point arithmetic on Cortex-M4F, DF2T is preferred because it has better numerical properties — accumulating in sequence reduces rounding error accumulation compared to Direct Form I's two separate delay lines. CMSIS-DSP's arm_biquad_cascade_df2T_f32() uses DF2T specifically for its numerical efficiency in single-precision float computations.

Follow-up: Why is Direct Form II Transposed preferred for floating-point but Direct Form I preferred for fixed-point?

Q10. What is filter order selection for IIR filters — how do you determine minimum order for given specs?

Minimum Butterworth order is N = log(10^(-As/10)-1)/(10^(-Ap/10)-1)) / (2×log(Ωs/Ωp)), where As is stopband attenuation and Ap is passband ripple in dB and Ωs/Ωp is the selectivity ratio. For -40 dB stopband, -1 dB passband, and stopband edge at twice the passband edge (selectivity ratio 2): N_butter ≈ 6.6 → round up to 7; an elliptic filter with the same specs might need only N=4. MATLAB's buttord(), cheb1ord(), and ellipord() functions compute minimum order and are the standard tools used in TI DSP library design workflows.

Follow-up: For a given filter order, which IIR approximation (Butterworth, Chebyshev, elliptic) gives the steepest transition?

Q11. How does coefficient quantization affect IIR filter performance in fixed-point?

Coefficient quantization moves the designed poles and zeros from their ideal positions to the nearest representable fixed-point values, which perturbs the frequency response — especially at deep notches and steep transition edges. A 4th-order IIR Butterworth at 1 Hz normalized cutoff implemented with Q15 coefficients has poles very close to z=1 (high-Q poles), where small quantization errors shift the pole outside the unit circle, making the filter unstable — this is why high-Q IIR filters must always be implemented as cascaded biquads. The sensitivity of pole position to coefficient errors increases as poles approach the unit circle, which is why low-cutoff audio IIR filters (0.1–10 Hz in a 1 kHz system) are notoriously prone to fixed-point quantization problems.

Follow-up: What alternative filter structures reduce coefficient sensitivity near the unit circle?

Q12. What is a notch filter in IIR design and how do you implement a 50 Hz power line rejection filter?

A notch filter places a pair of zeros exactly on the unit circle at the notch frequency and a pair of poles just inside at the same angle to narrow the notch width while restoring the passband. For 50 Hz rejection at 1 kHz sample rate: ω0 = 2π×50/1000 = 0.1π; zeros at z=e^(±jω0), poles at z=0.95×e^(±jω0); this gives a biquad with b0=1, b1=-2cos(ω0), b2=1, a1=-2×0.95×cos(ω0), a2=0.95². In ECG signal processing, this IIR notch is applied in real time on a STM32 at each 1 kHz sample to remove powerline interference from bioelectric signals without the long delay of an equivalent FIR notch.

Follow-up: What happens to the notch width if the pole radius is increased from 0.95 to 0.99?

Q13. What is the pole-zero cancellation technique and when is it used in IIR design?

Pole-zero cancellation places a zero at the same location as an undesired pole to remove it from the transfer function, effectively reducing the filter order — but in practice near-cancellation in fixed-point leaves a residual pole that decays only slowly. In audio DSP, if an IIR filter has a weakly resonant pole near a desired passband notch, a zero placed nearby reduces the resonance without adding a full filter section. However, exact cancellation is impossible in fixed-point arithmetic — the residual from a Q15 near-cancellation at z=0.99 decays over thousands of samples, creating a long tail that appears as reverb in audio.

Follow-up: What is the risk of pole-zero cancellation on a system with real (non-cancelling) poles close to the unit circle?

Q14. How do you verify an IIR filter implementation is correct on target hardware?

Feed a single impulse (value 1 followed by zeros) to the filter and capture 200 output samples; plot them against the expected impulse response computed in MATLAB with impz() — they must match within quantization error bounds. For a fixed-point implementation on TMS320C5545, also apply a full-scale sinusoid at the passband edge and measure the output level (should match the designed passband gain within 0.5 dB), then apply a sinusoid at the stopband and confirm attenuation meets spec. Check for overflow by applying the maximum possible input value and verifying the output remains within representable range — a missing saturation mode often causes wrap-around distortion only at high amplitudes.

Follow-up: What is the difference between the analog prototype's -3dB frequency and the digital filter's -3dB frequency after bilinear transform?

Q15. What is an all-pass filter and how is it used for phase equalization?

An all-pass filter has unity magnitude response at all frequencies but a frequency-dependent phase response, used to correct the nonlinear phase of IIR filters without affecting their magnitude response. If a Butterworth lowpass introduces 60° extra phase at 3 kHz relative to 100 Hz (group delay variation), a second-order all-pass section tuned to 3 kHz can compensate this nonlinear phase, making the combined response nearly linear phase. In telecommunication equalizers and audio crossover networks, all-pass sections are standard tools to flatten group delay across the passband, and the TI TLV320 codec DSP includes programmable all-pass biquads for this purpose.

Follow-up: What is the pole-zero relationship in an all-pass filter section?

Common misconceptions

Misconception: IIR filters are always more efficient than FIR filters for the same frequency response.

Correct: IIR filters need fewer coefficients for a given stopband attenuation, but their feedback makes them harder to implement stably in fixed-point and they cannot achieve linear phase, so FIR is often preferred for audio and communications despite higher tap count.

Misconception: The bilinear transform preserves exact frequency relationships between analog and digital filters.

Correct: The bilinear transform introduces frequency warping — the mapping between analog and digital frequencies is nonlinear, requiring pre-warping of critical frequencies before applying the transform.

Misconception: A stable analog prototype always produces a stable digital IIR filter after transformation.

Correct: While the bilinear transform theoretically maps stable analog poles into the unit circle, coefficient quantization in fixed-point implementation can push poles outside the unit circle, causing instability.

Misconception: Higher filter order always gives better performance in a digital IIR filter.

Correct: Higher-order direct form IIR filters in fixed-point suffer severe coefficient sensitivity and may become unstable; cascaded second-order sections must always be used for orders above 4.

Quick one-liners

What does IIR stand for?Infinite Impulse Response — the filter has feedback, so its impulse response theoretically extends to infinity.
What is the stability condition for a digital IIR filter?All poles must lie strictly inside the unit circle |z| < 1 in the z-plane.
What is a biquad filter?A second-order IIR section with two poles and two zeros, the fundamental building block of higher-order IIR filters.
What analog filter has maximally flat passband?The Butterworth filter — it has no passband ripple, with a monotonically decreasing response.
What is the bilinear transform substitution?s = (2/T)(z-1)/(z+1) — it maps the entire s-plane imaginary axis to the z-plane unit circle without aliasing.
What is an elliptic filter?A filter with equiripple in both passband and stopband, achieving the steepest transition for a given order among all classical IIR designs.
What causes limit cycles in fixed-point IIR filters?Rounding in the feedback path with poles near the unit circle creates self-sustaining low-level oscillations even with zero input.
What is Direct Form II in IIR implementation?An implementation that shares delay elements between the recursive and non-recursive parts, using only N delay registers for an Nth-order filter instead of 2N.
Why are higher-order IIR filters broken into second-order sections?To reduce coefficient sensitivity to quantization errors — high-order direct form IIR in fixed-point is numerically unstable near the unit circle.
What CMSIS-DSP function implements a cascaded biquad IIR on Cortex-M4?arm_biquad_cascade_df2T_f32() for floating-point or arm_biquad_cascade_df1_q15() for Q15 fixed-point.

More Digital Signal Processing questions