Finite impulse response (FIR) digital filters have been widely used in the field of digital signal processing due to their flexible design, good filtering effect and easy control of transition bandwidth. The typical design methods of FIR digital filters mainly include the window function method and the frequency sampling method. Correctly understanding and mastering these two design methods is an important part of learning FIR digital filters. The current textbooks explain the related issues of FIR filter design using the window function method in detail, so I will not repeat them here. This article mainly discusses the related issues of designing FIR digital filters using the frequency sampling method, mainly including design principles, performance analysis, linear phase conditions and issues that should be paid attention to in design.
1 Design Principle and Filter Performance Analysis
The frequency sampling method starts from the frequency domain and samples the frequency response of a given ideal filter at N points at equal intervals, that is, then use this Hd(k) as the frequency characteristic sampling value H(k) of the actual FIR filter, that is, let:
According to the definition of DFT, the N frequency domain sampling values H(k) can be used to uniquely determine the unit impulse response h(n) of the FIR, that is:
The frequency response characteristics of the designed filter are analyzed below. From the interpolation formula in the frequency domain sampling theorem, we can know that the frequency response of the FIR filter can also be obtained using these N frequency domain sampling values H(k), which will approach the frequency response of the ideal filter. The interpolation formula is:
From formula (5), we can see that at each frequency sampling point, the actual frequency response of the designed filter is strictly equal to the frequency response value of the ideal filter, that is. However, the frequency response between the sampling points is formed by the superposition of the weighted interpolation functions of each sampling point, so there is a certain approximation error. The size of this error depends on the shape of the ideal frequency response. The smoother the change of the ideal frequency response characteristic, the closer the interpolation value is to the ideal value, and the smaller the approximation error; conversely, if the ideal frequency response characteristic between the sampling points changes more steeply, the error between the interpolation value and the ideal value will be greater, so on both sides of the discontinuity point of the ideal filter, peaks will be generated, and ripples will be generated in the passband and stopband. The frequency response of the actual filter designed by the frequency sampling method is shown in Figure 1. As shown in Figure 1, the stopband attenuation of the actual filter depends on the magnitude of the first sidelobe amplitude of the interpolation function, and its magnitude determines the stopband performance of the designed filter.
2 Linear phase condition
The biggest advantage of FIR filter is its strict linear phase characteristic. The following discusses what conditions Hd(k) sampled in the frequency domain should meet in order to achieve linear phase. The condition for FIR filter to have linear phase is that h(n) is a real sequence and satisfies h(n)=±h(N-1-n), that is, h(n) is symmetric about, where N is the length of the filter. Based on the first type of linear phase condition h(n)=h(N-1-n) (even symmetry), the conditions satisfied by frequency domain sampling Hd(k) are derived.
The frequency response of an ideal filter can be expressed as:
To achieve the first type of linear phase condition, the phase function θ(ω) and the amplitude function Hg(ω) should satisfy:
Formula (10) and Formula (11) are the conditions for the frequency sampling value Hd(k) to satisfy the first type of linear phase. The conditions for the second type of linear phase will not be derived here, and the specific formula can be found in relevant textbooks.
3 Design Example and Performance Analysis
Taking the low-pass filter as an example, the general steps of designing FIR linear filters using the frequency sampling method and the issues that should be paid attention to in the design are explained. The cut-off frequency ωc=0.2π rad/s and the number of sampling points is N=20. The design steps are as follows:
Step 1: Determine the frequency response of the ideal filter you want to approximate
Step 2: Perform N-point sampling at equal intervals in the frequency domain, and use the frequency sampling design formula to calculate the frequency sampling value Hd(k). The sampling interval △ω=2π/N=0.1π, so there are 3 sampling points in the passband, k=0, 1, 2. Using the frequency sampling design formula (10) and formula (11), we can get:
Step 3: Use the inverse discrete Fourier transform to obtain the unit impulse response h(n) of the actual filter to be designed:
Step 4: According to the definition of Fourier transform, the frequency response of the actual filter is obtained to verify whether it meets the requirements of the filter technical indicators, mainly to verify whether the stopband attenuation of the filter can meet the stopband requirements. With the help of Matlab software, the simulation results of the low-pass filter designed according to the above 4 steps are shown in Figure 2.
From the simulation result Figure 2(d), we can see that the attenuation is relatively small, about -17 dB. Under normal circumstances, this stopband attenuation cannot meet the requirements of the stopband technical indicators. The stopband attenuation can be increased by adding transition sampling points at the boundary frequency between the passband and the stopband.
To improve the stopband attenuation, a transition point is added at the boundary frequency; to ensure that the transition bandwidth remains unchanged, the number of sampling points is doubled to N = 40, and the sampling value of the transition point is optimized, taking H1 = 0.390 4, and the simulation results are shown in Figure 3. As can be seen from Figure 3 (d), the stopband attenuation reaches -43 dB at this time.
To further increase the stopband attenuation, one more transition sampling point can be added, and the number of sampling points can be increased to 60. The two transition sampling point values are optimized to be H1=0.5925 and H2=0.1099, respectively. The simulation results are shown in Figure 4. As shown in Figure 4(d), the stopband attenuation reaches -73 dB. The stopband attenuation can also be increased by further increasing the transition sampling points. Generally, adding up to 3 transition sampling points can meet the stopband attenuation requirements. Obviously, while ensuring that the transition bandwidth remains unchanged, the corresponding number of sampling points also increases exponentially, which will greatly increase the complexity of the filter, and the amount of calculation when implementing the filter will also increase accordingly.
4 Conclusion
The Matlab simulation results verify the basic theory of digital signal processing, which is to design FIR linear phase digital filters by frequency sampling method. It helps students to deeply understand and master this important FIR filter design method. It should be emphasized that the frequency sampling method directly designs filters from the frequency domain, while the window function method designs filters from the time domain. The two design methods have their own advantages and disadvantages. The design of FIR digital filters by the window function method is a typical application of Fourier transform, while the guiding ideology of the frequency sampling method design is the frequency domain sampling theorem and interpolation formula. The improvement of its stopband attenuation is achieved by increasing the transition sampling points. At the same time, in order to ensure that the transition bandwidth remains unchanged, the number of sampling points of the filter must also be increased accordingly, and the computational complexity will also increase exponentially. This requires that when designing FIR filters by frequency sampling method, the requirements of stopband attenuation and filter length should be comprehensively considered to achieve the optimization of the design.