7. FIR Filter DesignIntroduction and ContextFinite impulse response (FIR) filters are discrete-time systems whose impulse response becomes exactly zero after a finite number of samples. If the impulse response is h[n], an FIR filter of order N has H(z) = Σ(n=0 to N) h[n]z^(-n), and therefore contains N+1 coefficients, or taps. Unlike infinite impulse response (IIR) filters, FIR filters do not use feedback. This structural feature makes them inherently stable when implemented with finite-valued coefficients and gives the designer direct control over the impulse response. FIR filters are especially important when a prescribed phase response is required. A filter is linear phase when its phase varies linearly with frequency, apart from possible phase discontinuities caused by zeros. Linear phase preserves the relative timing among frequency components within the passband. This property is essential in data communications, audio, biomedical instrumentation, image processing, software-defined radio, and measurement systems. The central design problem is to determine a finite sequence h[n] such that the frequency response approximates a desired response while satisfying constraints on passband ripple, stopband attenuation, transition width, phase, computational cost, and coefficient precision. This chapter develops three major approaches: windowing, frequency sampling, and optimal equiripple design. It also examines minimum-phase conversion, implementation issues, and engineering trade-offs. Learning ObjectivesBy the end of this chapter, the reader should be able to: 1. Explain the structure and principal properties of FIR filters. 2. Derive the conditions for the four types of linear-phase FIR filters. 3. Design FIR filters using rectangular, Hann, Hamming, Blackman, and Kaiser windows. 4. Apply the frequency-sampling method and interpret its limitations. 5. Explain the Parks–McClellan or Remez equiripple design principle. 6. Distinguish linear-phase, minimum-phase, and maximum-phase FIR filters. 7. Select a design method from attenuation, transition-band, phase, and implementation requirements. 8. Evaluate coefficient quantization, computational complexity, delay, and numerical effects. FIR Structure and Frequency ResponseFor an FIR filter of order N, H(z) = h[0] + h[1]z^(-1) + ... + h[N]z^(-N). Its frequency response is obtained by evaluating the transfer function on the unit circle: H(e^jω) = Σ(n=0 to N) h[n]e^(-jωn). The impulse response is finite, so the output is the convolution y[n] = Σ(k=0 to N) h[k]x[n-k]. The absence of feedback prevents recursive instability. However, stability does not imply low computational cost. A direct implementation requires N+1 multiplications and N additions per output sample, although symmetry can substantially reduce the number of multipliers. The ideal low-pass response with cutoff ωc is H_d(e^jω) = 1, |ω| ≤ ωc; 0, ωc < |ω| ≤ π. Its inverse discrete-time Fourier transform is h_d[n] = sin(ωc(n-α)) / [π(n-α)], where α represents the desired center of symmetry. The ideal response is infinitely long. FIR design methods approximate or modify this response to obtain a finite sequence. Linear Phase and Symmetry ClassesA real FIR filter has exact linear phase when its coefficients satisfy one of the following symmetry conditions: h[n] = h[N-n] (symmetric), or h[n] = -h[N-n] (antisymmetric). For a symmetric impulse response, the delay is N/2 samples. Four standard types result. Type I: N is even and h[n] is symmetric. The length N+1 is odd. This is the most flexible class for ordinary low-pass, high-pass, and band-pass filters because the response need not be zero at either ω = 0 or ω = π. Type II: N is odd and h[n] is symmetric. The length is even. Because of symmetry, H(e^jπ) = 0; hence this class is unsuitable for a high-pass filter requiring a nonzero response at π. Type III: N is even and h[n] is antisymmetric. The response is zero at ω = 0 and ω = π. It is useful for differentiators and certain Hilbert transformers. Type IV: N is odd and h[n] is antisymmetric. The response is zero at ω = 0 but need not be zero at π. It is commonly used for Hilbert transformers and odd-symmetry differentiators. For symmetric filters, the frequency response may be written as H(e^jω) = e^(-jωN/2) A(ω), where A(ω) is real. The factor e^(-jωN/2) gives a constant group delay of N/2 samples. This delay must be included in system timing budgets, particularly in feedback control, motor drives, and communication receivers. Windowing DesignWindowing begins with the ideal impulse response and truncates it using a finite window w[n]: h[n] = h_d[n]w[n], 0 ≤ n ≤ N. Multiplication in time corresponds to convolution in frequency. Consequently, the abrupt truncation of the ideal response is replaced by a transition region and ripples determined by the window spectrum. Window selection is therefore a trade-off between main-lobe width, which influences transition width, and side-lobe level, which influences stopband attenuation. The rectangular window is w[n] = 1. It produces the narrowest main lobe for a given length but relatively high side lobes, with substantial Gibbs oscillation. It is appropriate only when modest attenuation is acceptable. The Hann window is w[n] = 0.5[1 - cos(2πn/N)]. It reduces side-lobe levels compared with the rectangular window but gives a wider transition band. The Hamming window is w[n] = 0.54 - 0.46 cos(2πn/N). It is widely used because it offers a useful compromise between transition width and stopband attenuation, although its side-lobe decay is not as strong as that of some other windows. The Blackman window is w[n] = 0.42 - 0.5 cos(2πn/N) + 0.08 cos(4πn/N). It provides substantially lower side lobes than the Hamming window, at the cost of a wider transition band. The Kaiser window is adjustable: w[n] = I0(β√[1 - (2n/N - 1)^2]) / I0(β), where I0 is the zeroth-order modified Bessel function. The parameter β controls stopband attenuation. A common approximation for order selection is N ≈ (A - 8) / (2.285 Δω), where A is the desired attenuation in decibels and Δω is the normalized transition width in radians per sample. For β, useful empirical relations are β = 0, A ≤ 21 dB; β ≈ 0.5842(A-21)^0.4 + 0.07886(A-21), 21 < A < 50 dB; β ≈ 0.1102(A-8.7), A ≥ 50 dB. These formulas provide an initial design, not a guarantee independent of the exact band edges and measurement convention. The resulting response must be evaluated and the order adjusted if necessary. A window method is attractive because it is simple, transparent, and easy to automate. Its principal weakness is that the ripple is not generally minimized with respect to a specified weighted error. The designer chooses a standard spectral shape rather than directly solving the approximation problem. Frequency-Sampling DesignThe frequency-sampling method specifies the desired frequency response at a finite set of equally spaced frequencies. For a length-L filter, choose samples H[k] = H_d(e^{j2πk/L}), 0 ≤ k ≤ L-1, and obtain the coefficients through an inverse discrete Fourier transform: h[n] = (1/L)Σ(k=0 to L-1)H[k]e^{j2πkn/L}. Conjugate symmetry must be imposed when real coefficients are required. If the frequency samples also possess the appropriate symmetry, the resulting impulse response can be made symmetric or antisymmetric, thereby producing linear phase. Frequency sampling gives direct control over selected frequencies. It is useful when a response contains prescribed values, narrow spectral features, or multiple bands. In practice, however, the response between sample points is not controlled directly. Large intersample deviations can occur, particularly near sharp transitions. Increasing the number of frequency samples reduces this problem but does not automatically produce an optimum minimax approximation. A practical refinement is to specify transition-band samples rather than forcing an abrupt jump between zero and one. Another is to use an iterative procedure: calculate the response, identify the largest errors, modify the samples, and repeat. Even so, the method generally requires more judgment than a well-formulated equiripple design. Optimal Equiripple DesignThe equiripple method formulates FIR design as a weighted approximation problem. Let D(ω) be the desired amplitude and A(ω) the actual amplitude function. The objective is to minimize the maximum weighted error: E = max over ω [W(ω)|D(ω)-A(ω)|]. The weighting function W(ω) expresses the relative importance of errors in different bands. For example, if passband ripple must be 0.01 and stopband ripple must be 0.001, the stopband error is weighted approximately ten times more heavily than the passband error. The Parks–McClellan algorithm, based on the Remez exchange principle, iteratively identifies extremal frequencies and constructs a linear-phase FIR filter whose weighted error oscillates between approximately equal positive and negative peaks. This is the equiripple or minimax property. At the optimum, the error alternates at a sufficient number of extremal frequencies, a result associated with the alternation theorem. For a low-pass design, the specification normally includes passband edge ωp, stopband edge ωs, passband ripple δp, stopband ripple δs, and sampling frequency Fs. The transition width is ωs - ωp. A typical workflow is: 1. Normalize all frequencies consistently, either in radians per sample or relative to the Nyquist frequency. 2. Define passband and stopband edges, desired amplitudes, and weights. 3. Estimate an order using a standard approximation or software routine. 4. Run the Remez exchange algorithm. 5. Evaluate dense-grid magnitude, phase, group delay, and coefficient sensitivity. 6. Increase the order or revise weights if the specification is not met. The equiripple method generally produces a lower order than a basic window design for comparable amplitude specifications. Its performance depends on correct band definitions and weighting. It is not automatically the best choice when arbitrary pointwise constraints, special phase requirements, or coefficient restrictions dominate. Linear-Phase, Minimum-Phase, and Maximum-Phase RealizationsLinear phase provides constant group delay but often places zeros in reciprocal pairs. A linear-phase filter may therefore have unnecessary delay and may not minimize the energy of its impulse response near the beginning of the sequence. A minimum-phase FIR filter has all its zeros inside the unit circle. Among filters with a given magnitude response, the minimum-phase form concentrates energy earlier in time and has the smallest possible group delay in an appropriate sense. It is useful in real-time audio, low-latency communication, and control applications where phase linearity is less important than prompt response. A minimum-phase filter can be obtained by factoring the zeros of a linear-phase FIR filter. For every zero outside the unit circle, replace it with its reciprocal conjugate inside the unit circle. Zeros on the unit circle require special care because they cannot be moved inward without changing the exact magnitude response or introducing numerical sensitivity. The resulting polynomial is normalized to preserve the desired gain. The conversion preserves the magnitude response approximately or exactly in exact arithmetic, but it changes phase and group delay. It also changes the temporal distribution of the impulse response. Minimum-phase conversion is therefore a deliberate system-level choice, not merely an optimization of coefficients. Design Example: A Low-Pass Filter by Kaiser WindowConsider a sampling frequency of 48 kHz. Suppose a low-pass filter must have a passband edge of 8 kHz, a stopband beginning at 10 kHz, and at least 60 dB stopband attenuation. The transition width is 2 kHz. In normalized radians per sample, Δω = 2π(2000/48000) ≈ 0.262 rad/sample. Using the Kaiser order estimate, N ≈ (60 - 8)/(2.285 × 0.262) ≈ 87. An order near 87 is therefore a sensible starting point. The corresponding β for 60 dB is approximately β ≈ 0.1102(60 - 8.7) ≈ 5.65. The ideal cutoff is often placed near the middle of the transition band, approximately 9 kHz. The ideal impulse response is evaluated about α = N/2, multiplied by the Kaiser window, and then tested on a dense frequency grid. If the measured stopband attenuation is below 60 dB because of finite-order effects or edge definitions, the order is increased. The filter has approximately 88 coefficients and a group delay of 43.5 samples, or about 0.906 ms at 48 kHz. This example illustrates a design reality: an attenuation requirement and a transition width determine much of the cost. A narrower transition or higher attenuation increases order, memory, multiplication count, and delay. Implementation and Computational CostA direct FIR implementation uses a delay line, coefficient memory, multipliers, and an adder structure. For a length-L filter, the unstructured cost is approximately L multiplications and L-1 additions per output sample. With symmetric coefficients, h[n] = h[N-n], paired samples can be added before multiplication. For an odd-length Type I filter, the number of multipliers can approach (N/2)+1 rather than N+1. This reduction is valuable in FPGA, ASIC, and embedded DSP implementations, although the adder and routing structure must also be considered. Polyphase decomposition is important when the filter is used for interpolation or decimation. The coefficient sequence is divided into phases, allowing only the operations needed for the retained or generated samples. Multirate structures can therefore reduce the effective computational rate significantly. Fixed-point implementation introduces coefficient quantization, accumulator overflow, roundoff noise, and possible failure to meet ripple specifications. Coefficients should be scaled to avoid overflow while preserving precision. A high-order filter may require wider accumulators than coefficient storage because many products are summed. Verification should include worst-case input amplitude, quantized frequency response, and sensitivity to coefficient perturbations. In software, vectorization, block processing, circular buffers, and multiply-accumulate instructions improve throughput. In hardware, distributed arithmetic may replace multipliers when coefficients are fixed. The choice depends on clock rate, power, silicon area, latency, and reconfigurability. Applied Case: FIR Equalization in a Digital Communication ReceiverBackground. Consider an illustrative receiver operating at a symbol rate of 1 Msymbol/s. The analog front end and channel together produce amplitude distortion near the band edges and introduce timing-related distortion. The receiver must equalize the signal while maintaining a controlled phase response. Situation. An unconstrained equalizer could compensate the channel with a short filter, but excessive phase distortion would affect symbol timing and increase intersymbol interference. The engineering team specifies a linear-phase FIR equalizer with a passband covering 0.1 to 0.45 times the symbol-rate Nyquist frequency, a transition band of 0.05, and a stopband attenuation of at least 55 dB. Analysis. A window design is first considered because it is easy to generate and verify. Preliminary calculations show that the required transition width and attenuation produce an order too large for the receiver's power budget. An equiripple design is then formulated with a weighted passband and stopband error. Because passband distortion is more damaging to the demodulator than a small increase in stopband error, the passband receives the larger weight. Approach. The design team obtains an equiripple Type I filter, verifies its response at more points than were used in the optimization, and exploits coefficient symmetry in the implementation. Coefficients are quantized to the available word length, after which the design is re-evaluated. The group delay is included in the timing recovery model rather than treated as an implementation afterthought. Outcome. The equiripple filter meets the amplitude specifications with fewer taps than the initial window design. Symmetric implementation reduces the multiplier count, while a longer accumulator prevents overflow during high-amplitude bursts. The receiver achieves the required equalization without exceeding its processing budget. Learning points. Filter selection must consider the complete system: amplitude response, phase, delay, coefficient precision, hardware cost, and verification effort. The mathematically smallest filter is not necessarily the best engineering solution if it is sensitive to quantization or difficult to certify. Design Risks and Common ErrorsA frequent mistake is confusing filter order N with filter length N+1. This causes incorrect delay and resource estimates. Another is specifying frequencies in hertz for one calculation and normalized frequency for another without conversion. The ideal cutoff should not automatically be placed at the passband edge. For many window designs it is better placed within the transition band. Similarly, passband ripple and stopband attenuation should be measured over the specified bands, not inferred from a plot with insufficient resolution. A linear-phase response does not mean zero phase or zero delay. It means a linear phase characteristic, generally corresponding to a delay of N/2 samples. Ignoring this delay can destabilize a control loop or misalign a communication signal. Designing with floating-point coefficients and deploying quantized coefficients without rechecking the response is unsafe. Coefficient quantization can increase ripple, reduce attenuation, and alter exact symmetry if paired coefficients are not quantized consistently. Finally, numerical routines should be tested for unusual specifications, narrow bands, very high attenuation, and bands that touch DC or the Nyquist frequency. Professional and Emerging ConsiderationsFIR design is increasingly integrated into model-based development environments that automatically generate coefficient files, HDL, software kernels, and verification reports. Automated workflows can sweep filter orders, coefficient word lengths, architectures, and operating conditions. Nevertheless, automation does not remove the need to define correct specifications and inspect phase, delay, scaling, and corner cases. Applications involving medical signals, industrial protection, and safety-related control require traceable requirements and documented verification. The design should identify whether delay, overshoot, loss of diagnostically relevant content, or false attenuation could create a safety consequence. In regulated environments, reproducible coefficient generation and version control are part of engineering governance. Recent designs also use convex optimization and constrained least-squares methods when the desired response includes spectral masks, derivative constraints, sparse coefficients, or robustness to quantization. Machine-learning tools may assist in selecting architectures or predicting good initial orders, but the final filter remains a deterministic signal-processing component that must be validated against explicit frequency- and time-domain specifications. Best-Practice Design WorkflowA reliable workflow begins by translating the system requirement into passband, stopband, transition, ripple, attenuation, phase, delay, sampling-rate, and implementation constraints. The designer then selects a method: windowing for simplicity, frequency sampling for specified spectral points, and equiripple or constrained optimization for efficient control of worst-case error. The resulting filter should be evaluated using a dense frequency grid and tested in the time domain with impulses, steps, sinusoids, multitone signals, and representative measured data. Coefficient quantization, overflow, startup behavior, and computational load must be included. Finally, the design should be documented with the exact coefficient set, scaling convention, frequency normalization, delay, and verification results. Chapter SummaryFIR filters use a finite coefficient sequence and are stable, flexible, and well suited to exact linear-phase design. Symmetric and antisymmetric coefficient patterns produce four linear-phase types, each with specific constraints at DC and the Nyquist frequency. Windowing creates a finite approximation to an ideal response and offers simplicity with a controlled transition-versus-attenuation trade-off. Frequency sampling specifies selected response values but requires attention to intersample behavior. Equiripple design minimizes the maximum weighted error and often achieves specifications with fewer taps, although it requires careful band and weight selection. Minimum-phase conversion reduces delay and concentrates impulse-response energy but sacrifices linear phase. Practical design must include symmetry exploitation, multirate structures, coefficient quantization, overflow, latency, verification, and application-specific risk. Key TermsFIR filter: A discrete-time filter with an impulse response of finite duration. Tap: One coefficient and its associated delayed input sample in an FIR structure. Filter order: The highest delay index N; a length-N+1 FIR has order N. Linear phase: A phase response that is linear with frequency over the relevant band. Group delay: The negative derivative of phase with respect to angular frequency. Symmetric impulse response: A coefficient sequence satisfying h[n] = h[N-n]. Antisymmetric impulse response: A coefficient sequence satisfying h[n] = -h[N-n]. Window method: A design method formed by multiplying an ideal impulse response by a finite window. Gibbs phenomenon: Oscillatory behavior near discontinuities caused by finite approximation or truncation. Transition band: The frequency interval between passband and stopband. Passband ripple: The maximum permitted amplitude deviation within the passband. Stopband attenuation: The suppression of signal magnitude in the stopband, expressed in decibels. Frequency sampling: FIR design based on specifying response values at discrete frequency points. Equiripple design: A minimax design whose weighted approximation error has approximately equal alternating extrema. Remez exchange algorithm: An iterative algorithm used to obtain optimal equiripple approximations. Kaiser window: An adjustable window controlled by the parameter β. Minimum-phase filter: A filter whose zeros lie inside the unit circle, giving the lowest-delay realization for a magnitude response. Polyphase decomposition: Division of a filter into phase components for efficient multirate processing. Coefficient quantization: Representation of ideal filter coefficients with finite-precision numbers. Review QuestionsShort Answer Questions1. Why are FIR filters inherently stable in their ordinary nonrecursive form? 2. State the symmetry condition for a Type I linear-phase FIR filter. 3. What is the principal trade-off controlled by a window function? 4. Why does frequency sampling require attention to frequencies between specified samples? 5. Define an equiripple approximation. Long Answer Questions1. Explain the four types of linear-phase FIR filters and the restrictions each imposes at DC and the Nyquist frequency. 2. Describe the window method and compare rectangular, Hamming, Blackman, and Kaiser windows. 3. Explain the formulation and operation of the Parks–McClellan equiripple method. 4. Discuss the conversion of a linear-phase FIR filter into a minimum-phase filter and its system implications. 5. Describe the complete process of implementing a high-order FIR filter in fixed-point hardware. Analytical / Application Questions1. A specification requires 70 dB attenuation and a very narrow transition band. Which design method would you initially select, and what trade-offs would you investigate? 2. A Type II filter is proposed for a high-pass response that must have nonzero gain at the Nyquist frequency. Analyze whether the proposal is suitable and justify your answer. 3. An FIR filter meets its floating-point specification but fails after coefficient quantization. Identify likely causes and propose a verification and redesign strategy. 22. Multiple Choice Questions with AnswersQuestion 1For a Type II linear-phase FIR filter, which response property is enforced by its symmetry? A. The response is always zero at DC B. The response is always zero at the Nyquist frequency C. The response is always antisymmetric D. The group delay is zero Correct Answer: B. The response is always zero at the Nyquist frequency Question 2In the window method, narrowing the transition band while retaining the same window generally requires: A. A shorter filter B. A lower sampling frequency only C. A higher filter order D. Removal of coefficient symmetry Correct Answer: C. A higher filter order Question 3What is the main objective of an optimal equiripple FIR design? A. Minimize the average coefficient value B. Minimize the maximum weighted approximation error C. Maximize the filter delay D. Force all zeros to lie at the origin Correct Answer: B. Minimize the maximum weighted approximation error Question 4Which FIR class is especially appropriate for a differentiator because its response is zero at DC? A. Type I only B. Type II only C. Type III or Type IV D. All symmetric filters only Correct Answer: C. Type III or Type IV Question 5A Kaiser window parameter β is increased primarily to obtain: A. Lower side lobes and greater attenuation B. Zero group delay C. Fewer coefficients for the same transition width D. An antisymmetric impulse response Correct Answer: A. Lower side lobes and greater attenuation Question 6Why can frequency-sampling designs exhibit unacceptable ripple between specified frequency points? A. The inverse DFT cannot produce real coefficients B. The response is directly controlled only at the selected samples C. FIR filters cannot represent band-pass responses D. Frequency samples eliminate the transition band Correct Answer: B. The response is directly controlled only at the selected samples Question 7A linear-phase FIR filter of order N has, ideally, what group delay? A. N samples B. 1/N samples C. N/2 samples D. N+1 samples Correct Answer: C. N/2 samples Question 8Which characteristic distinguishes a minimum-phase FIR filter from a linear-phase FIR filter with the same magnitude response? A. It necessarily has a wider transition band B. Its zeros are inside the unit circle and its delay is generally lower C. It must have antisymmetric coefficients D. It is recursive and potentially unstable Correct Answer: B. Its zeros are inside the unit circle and its delay is generally lower Question 9If a symmetric FIR filter is implemented by pairing equal coefficients, the principal benefit is: A. Reduced number of multipliers B. Elimination of all additions C. Removal of group delay D. Automatic increase in stopband attenuation Correct Answer: A. Reduced number of multipliers Question 10A filter satisfies its floating-point stopband specification but fails after fixed-point conversion. The most appropriate first response is to: A. Ignore the result because phase is unchanged B. Re-evaluate quantized frequency response and increase coefficient precision if needed C. Convert it to an IIR filter without analysis D. Remove the transition band from the specification Correct Answer: B. Re-evaluate quantized frequency response and increase coefficient precision if needed
|