Interview questions

Digital Filter Design Interview Questions

Digital filter design is a core DSP topic asked in technical interview rounds at semiconductor companies like Texas Instruments, Qualcomm, and Samsung, as well as in embedded roles at Bosch and L&T. IT companies like TCS and Infosys occasionally test it for DSP-focused profiles. Expect these questions in the first or second technical round.

ECE, EI

Interview questions & answers

Q1. What is the fundamental difference between FIR and IIR filters, and when would you choose one over the other?

FIR filters have no feedback path, making them inherently stable with a linear phase response, while IIR filters use recursive feedback and can achieve a sharper roll-off with fewer coefficients. A 64-tap FIR low-pass filter at 8 kHz cutoff in a MATLAB design needs far more coefficients than a 4th-order Butterworth IIR doing the same job. In audio and biomedical applications where phase linearity matters, FIR is preferred despite its higher computational cost.

Follow-up: How does linear phase in FIR filters affect the signal in the time domain?

Q2. Explain the windowing method for FIR filter design. Which window would you pick for a stopband attenuation of 60 dB?

The windowing method truncates the ideal infinite impulse response using a finite-length window to control spectral leakage and stopband attenuation. For 60 dB attenuation, a Hamming window is appropriate as it provides approximately 41–43 dB, so a Blackman window at about 74 dB is the safer choice. The trade-off is that wider windows increase the transition band width, so you must balance attenuation against filter order.

Follow-up: What is the Gibbs phenomenon and how does windowing help reduce it?

Q3. What are the bilinear transformation and impulse invariance methods for IIR filter design?

Both methods convert an analog prototype filter into a digital IIR filter, but bilinear transformation maps the entire s-plane to the z-plane using s = (2/T)(z-1)/(z+1), avoiding aliasing at the cost of frequency warping. Impulse invariance preserves the time-domain impulse response exactly but suffers from aliasing if the analog filter is not band-limited. For a Chebyshev Type I low-pass filter, bilinear transformation is preferred because it avoids aliasing entirely.

Follow-up: How do you pre-warp the cutoff frequency when using bilinear transformation?

Q4. What is frequency warping in bilinear transformation, and how do you compensate for it?

Frequency warping is the nonlinear compression of the analog frequency axis when mapped to the digital domain via bilinear transformation, causing the digital cutoff to not match the analog specification. You pre-warp the analog cutoff frequency using ω_a = (2/T) tan(ω_d T/2) before designing the analog prototype. For example, if the desired digital cutoff is 0.4π rad/sample at 8 kHz sampling, you compute the pre-warped analog frequency and design the Butterworth filter at that value.

Follow-up: Does pre-warping affect the passband ripple of the resulting digital filter?

Q5. How do you determine the filter order for a Butterworth low-pass filter given passband and stopband specifications?

You calculate the minimum order n using n ≥ log((10^(As/10) - 1)/(10^(Ap/10) - 1)) / (2 log(Ωs/Ωp)), where As and Ap are stopband and passband attenuations in dB. For a spec of 3 dB at 1 kHz and 40 dB at 2 kHz, this yields n ≈ 6.6, so you round up to n = 7. Always round up the order because Butterworth filters roll off monotonically and rounding down will violate the stopband spec.

Follow-up: What changes in the formula if you use a Chebyshev Type I filter instead?

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

Chebyshev Type I has equiripple behavior in the passband and a monotonically decreasing stopband, while Type II is monotonic in the passband and equiripple in the stopband. A Type I filter of order 4 will achieve a sharper passband edge than a Butterworth of the same order, but it introduces phase distortion from the ripple. Type II is used when a flat passband is critical and some stopband ripple is acceptable, such as in anti-aliasing filters before ADCs.

Follow-up: Which filter type — Chebyshev or Butterworth — has a faster roll-off for the same order?

Q7. What is the Parks-McClellan algorithm and why is it considered optimal for FIR design?

Parks-McClellan uses the Remez exchange algorithm to design FIR filters with equiripple error in both passband and stopband, minimizing the maximum deviation from the ideal frequency response. A 50-tap equiripple low-pass filter designed with Parks-McClellan achieves a sharper transition band than a Kaiser-windowed filter of the same length. It is called optimal because no other linear-phase FIR filter of the same order can achieve smaller peak error under the same constraints.

Follow-up: What inputs does the Parks-McClellan algorithm require from the designer?

Q8. How does the Kaiser window allow flexible control of filter specifications?

The Kaiser window uses a shape parameter β that controls the trade-off between mainlobe width and sidelobe attenuation, with approximate formulas linking β and filter order to the desired stopband attenuation. For 50 dB stopband attenuation, β ≈ 3.395, and the filter order can be estimated as n ≈ (As - 7.95) / (2.285 × ΔΩ). This makes Kaiser window design nearly as flexible as equiripple design while being computationally simpler to implement in DSP libraries like scipy.signal.

Follow-up: How does increasing β affect the transition band width of the Kaiser window filter?

Q9. What is a lattice filter structure and what advantage does it offer over direct form?

A lattice filter uses a cascade of two-port sections with reflection coefficients, and any FIR or IIR filter can be converted to this form for implementation. A 4th-order IIR lattice filter is less sensitive to coefficient quantization errors compared to its direct form II equivalent because perturbations to reflection coefficients have bounded effects. This property is critical in fixed-point DSP processors like the TMS320 series, where coefficient word length is limited.

Follow-up: How are the reflection coefficients of a lattice filter related to the partial correlation coefficients in speech processing?

Q10. What are the effects of finite word length on digital filter performance?

Finite word length causes three problems: coefficient quantization (poles and zeros shift from ideal locations), round-off noise from arithmetic operations, and limit cycles due to nonlinear quantization in recursive sections. In a direct form II IIR filter implemented on a 16-bit fixed-point DSP, coefficient quantization can move poles outside the unit circle, making a stable filter unstable. Using higher-order sections split into second-order sections (SOS) reduces sensitivity by keeping pole-zero pairs close together.

Follow-up: What is a limit cycle oscillation and how do you prevent it in IIR filters?

Q11. Explain the concept of pole-zero placement in filter design.

Poles control resonant peaks and stopband roll-off, while zeros create nulls at specific frequencies; by placing them strategically in the z-plane you directly shape the frequency response. A 60 Hz notch filter for power line rejection places a zero pair at z = e^(±j2π×60/Fs) and poles just inside the unit circle at the same angle to create a sharp notch with minimal passband distortion. This method is faster for designing narrow-band filters than prototype-based methods.

Follow-up: What happens to filter stability if a pole lands exactly on or outside the unit circle?

Q12. What is the difference between direct form I, direct form II, and transposed direct form II implementations of IIR filters?

Direct form I uses 2N delay elements for an Nth-order filter, Direct form II uses only N delay elements by sharing the delay line (canonic form), and transposed direct form II reverses the signal flow for improved numerical behavior with floating-point arithmetic. In a biquad section (2nd-order IIR) used in audio equalizers, transposed direct form II is preferred because it reduces round-off noise accumulation compared to direct form II in single-precision float. All three forms are mathematically equivalent but differ in hardware cost and numerical precision.

Follow-up: Why are second-order sections preferred over a single high-order direct form IIR implementation?

Q13. What is a notch filter and how do you design one at 50 Hz for removing power line interference?

A notch filter is a band-reject filter with a very narrow stopband placed at a specific frequency, and for 50 Hz removal at a 1 kHz sample rate, you place zeros at z = e^(±j2π×50/1000) = e^(±j0.314) on the unit circle. Poles are placed at 0.95 × e^(±j0.314) to create a sharp notch without excessive passband distortion, giving a -3 dB bandwidth of roughly 3 Hz. The pole radius controls the notch sharpness — moving poles too close to the unit circle makes the filter sensitive to frequency drift.

Follow-up: How would you modify this design if the power line frequency drifts between 49 and 51 Hz?

Q14. How do you verify that a digital filter meets its specifications after design?

You compute and plot the magnitude response using the frequency response function H(e^jω), check that passband ripple and stopband attenuation meet the spec, and verify linear phase if required. In MATLAB, freqz(b, a, 1024) gives you the 1024-point frequency response of the filter defined by coefficients b and a. Beyond frequency response, you should also check pole-zero locations for stability and, for fixed-point implementations, verify that coefficient quantization does not shift poles outside the unit circle.

Follow-up: What additional tests would you run before deploying the filter in a real-time embedded system?

Q15. What is an all-pass filter and what is it used for in DSP systems?

An all-pass filter has unity magnitude response at all frequencies but introduces frequency-dependent phase shifts, making it useful for phase equalization without affecting the magnitude spectrum. A first-order all-pass section with transfer function H(z) = (z^-1 - a*)/(1 - a × z^-1) is used in QMF banks and as a phase compensator in audio processing systems. In multirate filter banks, all-pass sections are used to construct power-complementary filter pairs efficiently.

Follow-up: How is an all-pass filter used to construct a half-sample delay for sub-band coding?

Common misconceptions

Misconception: IIR filters are always better than FIR because they need fewer coefficients.

Correct: IIR filters use fewer coefficients for the same roll-off but are susceptible to instability and nonlinear phase, while FIR filters are always stable and can have exact linear phase.

Misconception: The bilinear transformation preserves the analog frequency exactly.

Correct: Bilinear transformation compresses the entire analog frequency axis nonlinearly into 0 to π, requiring pre-warping to align critical frequencies correctly.

Misconception: A higher filter order always gives better performance.

Correct: Higher order increases computational cost, coefficient quantization sensitivity, and group delay, so the minimum order satisfying the spec is always preferred.

Misconception: Windowing only affects the stopband of the designed FIR filter.

Correct: Windowing affects both the transition bandwidth and the stopband attenuation simultaneously, with wider windows trading a wider transition band for better sidelobe suppression.

Quick one-liners

What makes a digital filter BIBO stable?All poles of the transfer function must lie strictly inside the unit circle in the z-plane.
What is the group delay of a linear phase FIR filter?It is constant and equal to (N-1)/2 samples, where N is the filter length.
Name one advantage of Elliptic filters over Butterworth.Elliptic filters achieve the sharpest roll-off for a given filter order by allowing equiripple in both passband and stopband.
What does the term 'equiripple' mean in filter design?The approximation error oscillates between equal positive and negative peak values across the passband or stopband.
What is the role of the prototype analog filter in IIR design?It defines the filter shape (Butterworth, Chebyshev, Elliptic) and is transformed to the digital domain via bilinear transformation or impulse invariance.
What is a biquad filter?A second-order IIR filter section that is the fundamental building block for higher-order IIR implementations.
Why are SOS (second-order sections) preferred for IIR filter implementation?SOS reduces coefficient quantization sensitivity by keeping pole-zero pairs grouped, avoiding numerical instability of high-order direct form.
What is the minimum sampling rate needed to design a digital filter for a 4 kHz audio signal?At least 8 kHz, per the Nyquist theorem, to avoid aliasing.
What is a Hilbert transformer in FIR design?An FIR filter that approximates a 90-degree phase shift across all frequencies, used for SSB modulation and analytic signal generation.
How does increasing the stopband attenuation requirement affect FIR filter order?It increases the required filter order, since more coefficients are needed to achieve the steeper roll-off and deeper null.

More Digital Signal Processing questions