FIR (Finite Impulse Response) filtering method with low calculation complexity
By adjusting the number of taps and re-proportion tap coefficient of the FIR filter, the problem of high computational complexity of the FIR filter is solved, and FIR filtering with low computational complexity is realized, which suppresses interfering signals and reduces resource consumption, achieving high-performance computing effect.
Patent Information
- Application Number
- CN202510224946.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-07-01
AI Technical Summary
The existing FIR filter has high computational complexity, resulting in low operating speed, high resource usage, critical path multiplier limits the operating frequency, and large calculation overhead.
Adjust the number of taps of the FIR filter according to engineering needs and re-proportion the tap coefficients, including low-pass, high-pass and band-pass filtering. Different filter types are realized by changing the tap coefficient symbol or alternate settings, reducing the calculation complexity.
Effectively suppress the influence of interference signals, the peak value of continuous filtering stopband is reduced to about -40dB, the calculation overhead is low, the resource consumption is small, and high-performance computing is realized.
Smart Images

Figure CN120238092A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of signal processing, and particularly relates to a FIR filtering method with low computational complexity. Background Art
[0002] As society has fully entered the information age, digital signal processing technology has now become an important means for information acquisition, analysis, processing, and utilization. Signal processing problems are involved in various engineering and technical fields. As one of the basic components of digital signal processing technology, the research work on digital filters has received great attention and development.
[0003] FIR (Finite Impulse Response) filter is a commonly used component in digital signal processing. Its function is to change the frequency characteristics of the input signal, filter out the signals that are not of interest, and leave the useful signals. Due to the advantages of strong stability, strict linear phase, and easy hardware implementation, FIR filters are widely used in the field of digital signal processing.
[0004] The filtering principle of the FIR filter is to attenuate the interference signals through operations such as multiplication and accumulation on the input digital signals. The basic units include multipliers, adders, and delay units. However, since the FIR filter contains a large number of multipliers and adders, the operating rate of the filter is low, the computational overhead during the filtering process is large, the multipliers with longer critical paths will also limit the working frequency of the FIR filter, and the multipliers also occupy more resources. Summary of the Invention
[0005] In order to solve the above problems existing in the prior art, the present invention provides a FIR filtering method with low computational complexity. The technical problems to be solved by the present invention are realized through the following technical solutions:
[0006] The present invention provides a FIR filtering method with low computational complexity, including:
[0007] Obtain an input sequence;
[0008] According to the engineering requirements, set the number of taps of the FIR filter and determine whether it is necessary to reallocate the tap coefficients in the original system function;
[0009] If necessary, reallocate the tap coefficients in the original system function, and perform filtering processing on the input sequence based on the reallocated system function to obtain an output sequence; otherwise, perform filtering processing on the input sequence based on the original system function to obtain an output sequence.
[0010] In an embodiment of the present invention, the engineering requirements include low-pass filtering, high-pass filtering, and band-pass filtering;
[0011] The step of determining whether to re - allocate each tap coefficient in the original system function includes:
[0012] If the engineering requirement is low - pass filtering, then there is no need to re - allocate each tap coefficient in the original system function;
[0013] If the engineering requirement is high - pass filtering or band - pass filtering, then it is necessary to re - allocate each tap coefficient in the original system function.
[0014] In an embodiment of the present invention, the original system function is expressed as:
[0015]
[0016] In the formula, N represents the number of taps, z is a complex variable, and X(z) and Y(z) respectively represent the input sequence and output sequence after z - transform.
[0017] In an embodiment of the present invention, if the engineering requirement is high - pass filtering, then each tap coefficient in the original system function is alternately set to 1 and - 1.
[0018] In an embodiment of the present invention, if the engineering requirement is high - pass filtering, the re - allocated system function is expressed as:
[0019]
[0020] In the formula, N represents the number of taps, z is a complex variable, X(z) and Y(z) respectively represent the input sequence and output sequence after z - transform, and m represents the number of measurement values in the input sequence.
[0021] In an embodiment of the present invention, if the engineering requirement is band - pass filtering, then each tap coefficient in the original system function is alternately set to b and 0, where b = [1, 0, - 1].
[0022] In an embodiment of the present invention, when the engineering requirement is band - pass filtering, the re - allocated system function is expressed as:
[0023]
[0024] In the formula, z is a complex variable, N ※ represents the number of non - zero tap coefficients, satisfying N = 2N ※ - 1, N represents the number of taps, and X(z) and Y(z) respectively represent the input sequence and output sequence after z - transform.
[0025] In an embodiment of the present invention, the number of taps is determined according to the minimum attenuation value of the stopband.
[0026] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0027] The present invention provides a FIR filtering method with low computational complexity, which can effectively suppress the influence of interference signals during data acquisition. The peak value in the continuous filtering stopband can be reduced to about -40 dB, and the computational overhead is very low. By reasonably selecting the number of taps N, a multiplier-free FIR filter can be realized, which consumes very little software and hardware resources in specific applications, can perform high-performance calculations with extremely low computational resources, and is convenient for designers to perform filtering.
[0028] The following will further elaborate on the present invention in conjunction with the accompanying drawings and embodiments. Description of the Drawings
[0029] Figure 1 is a flowchart of a FIR filtering method with low computational complexity provided by an embodiment of the present invention;
[0030] Figure 2a is a zero-pole distribution diagram when N = 5 for low-pass filtering provided by an embodiment of the present invention;
[0031] Figure 2b is a zero-pole distribution diagram when N = 9 for low-pass filtering provided by an embodiment of the present invention;
[0032] Figure 3a is a zero-pole distribution diagram when N = 5 for high-pass filtering provided by an embodiment of the present invention;
[0033] Figure 3b is a zero-pole distribution diagram when N = 9 for high-pass filtering provided by an embodiment of the present invention;
[0034] Figure 4a is a zero-pole distribution diagram when N = 7 for band-pass filtering provided by an embodiment of the present invention;
[0035] Figure 4b is a zero-pole distribution diagram when N = 15 for band-pass filtering provided by an embodiment of the present invention;
[0036] Figure 5 is an amplitude-frequency characteristic response curve diagram when N = 5, 9, 19 for low-pass filtering provided by an embodiment of the present invention;
[0037] Figure 6a is a curve diagram of the change of the 3 dB attenuation point with N for low-pass filtering provided by an embodiment of the present invention;
[0038] Figure 6b is a curve diagram of the change of the minimum attenuation value in the stopband with N for low-pass filtering provided by an embodiment of the present invention;
[0039] Figure 7It is the amplitude-frequency characteristic response curve of continuous multiple filtering provided by the embodiment of the present invention;
[0040] Figure 8 It is the circuit structure diagram of continuous multiple filtering provided by the embodiment of the present invention. Specific embodiments
[0041] The following further describes the present invention in detail with specific embodiments, but the implementation manners of the present invention are not limited thereto.
[0042] Figure 1 It is a flowchart of a low computational complexity FIR filtering method provided by the embodiment of the present invention.
[0043] Please refer to Figure 1 , the embodiment of the present invention provides a low computational complexity FIR filtering method, including:
[0044] S1. Obtain an input sequence;
[0045] S2. According to engineering requirements, set the number of taps of the FIR filter and determine whether it is necessary to reallocate the tap coefficients in the original system function;
[0046] S3. If it is necessary, reallocate the tap coefficients in the original system function, and perform filtering processing on the input sequence based on the reallocated system function to obtain an output sequence; otherwise, perform filtering processing on the input sequence based on the original system function to obtain an output sequence.
[0047] In this embodiment, the engineering requirements include low-pass filtering, high-pass filtering, and band-pass filtering.
[0048] Optionally, the step of determining whether it is necessary to reallocate the tap coefficients in the original system function in step S2 includes:
[0049] If the engineering requirement is low-pass filtering, there is no need to reallocate the tap coefficients in the original system function;
[0050] If the engineering requirement is high-pass filtering or band-pass filtering, it is necessary to reallocate the tap coefficients in the original system function.
[0051] It should be understood that the filtering process of the average filter can be expressed as:
[0052]
[0053] Wherein, x(n), x(n - 1), x(n - 2), …, x(n - N + 1) are the measurement values in the input sequence, where x(n) represents the current measurement value, and x(n - 1), x(n - 2), …, x(n - N + 1) respectively represent the measurement values of the previous 1, 2, …, N - 1 times, m = 0, 1, 2, …, N - 1, y(n) represents the output sequence, and N represents the number of taps.
[0054] The system function and difference equation for implementing high-pass filtering by the FIR filter are respectively:
[0055]
[0056] Wherein, h(n) represents the unit impulse response, x(n - m) represents the measurement values of the previous m times, m = 0, 1, 2, …, N - 1, and y(n) represents the output sequence.
[0057] When The average filtering and FIR filtering effects are the same, and h(n) represents the unit impulse response.
[0058] Performing Z-transform on the difference equation of the FIR filter gives:
[0059]
[0060] At this time, the system function H(z) is:
[0061]
[0062] Wherein, z is a complex variable, N represents the number of taps, and X(z), Y(z) respectively represent the input sequence and output sequence after Z-transform.
[0063] Let the numerator formula be equal to 0 to obtain the zeros of the system function: k = 0, 1, 2, 3, … N - 1, a total of N zeros; let the denominator formula be equal to 0 to obtain the poles of the system function: z p = 1 and z p = 0 (N - 1 multiple roots). Among them, z k=0 = 1 and z p = 1 zero-pole cancellation, so the number of zeros and poles is both N - 1. Figure 2a is the zero-pole distribution diagram when N = 5 for low-pass filtering provided by the embodiment of the present invention, Figure 2b is the zero-pole distribution diagram when N = 9 for low-pass filtering provided by the embodiment of the present invention. As Figures 2a - 2bAs shown, the zeros are evenly distributed at the positions of 2πk / N (k = 1, 2, 3, …, N - 1) radians on the unit circle, and the (N - 1)-fold poles are located at the center of the circle. The zeros control the peaks and valleys of the amplitude-frequency response. The closer the zeros are to the unit circle, the smaller the peak and valley values. When the zeros are on the unit circle, the amplitude-frequency characteristic value at the corresponding points is zero. When the frequency w of the amplitude-frequency characteristic curve is closer to the zero, the attenuation value is smaller; the poles control the peak value of the amplitude-frequency characteristic. The closer the poles are to the unit circle, the larger the peak value. When the poles are on the unit circle, the system is unstable. From the zero-pole distribution diagrams for N = 5 and N = 9, it can be seen that when using an FIR filter with all coefficients equal to 1 / N for the current measured value x(n) for filtering, the effect of low-pass filtering is achieved.
[0064] Therefore, when the engineering requirement is low-pass filtering, there is no need to re-allocate the tap coefficients in the original system function, where the original system function is expressed as:
[0065]
[0066] In the formula, N represents the number of taps, z is a complex variable, X(z) and Y(z) respectively represent the input sequence and output sequence after z-transform, and l represents the number of measured values in the input sequence.
[0067] Furthermore, based on the above analysis, in this embodiment, by changing the signs of the tap coefficients in the original system function, low-pass filtering can be changed to high-pass filtering. Specifically, since the frequency of the low-frequency part changes very slowly and the amplitude difference between adjacent frequency points is very small, the positive and negative changes can cancel each other out. However, the frequency of the high-frequency part changes very quickly and the amplitude difference between adjacent frequency points is large and cannot be canceled out, so the high-frequency part can be left. When the engineering requirement is high-pass filtering, in this embodiment, the tap coefficients all equal to 1 in the original system function are changed to tap coefficients that alternate between 1 and -1 in sequence, thereby realizing the transformation from low-pass filtering to high-pass filtering.
[0068] The following gives the mathematical proof of high-pass filtering:
[0069] The difference equation of the FIR filter with coefficients alternating between [1, -1, 1, -1, ……] / N is:
[0070]
[0071] Then
[0072] In the formula, x(n - m) represents the previous m measured values, m = 0, 1, 2, …, N - 1, y(n) represents the output sequence, N represents the number of taps, and h(n) represents the unit impulse response.
[0073] For Performing z-transform gives:
[0074]
[0075] In the formula, z is a complex variable, and X(z) and Y(z) respectively represent the input sequence and the output sequence after z-transform.
[0076] At this time, the system function is expressed as:
[0077]
[0078] In the formula, z is a complex variable, N represents the number of taps, and X(z) and Y(z) respectively represent the input sequence and the output sequence after z-transform.
[0079] Let the numerator formula be equal to 0 to obtain the zeros of the system function: k = 0, 1, 2, 3, … N-1, a total of N zeros; let the denominator formula be equal to 0 to obtain the poles of the system function: z p = -1 and z p = 0 (N-1 multiple roots). Among them, cancels out with the z p = -1 zero-pole pair, so the number of zeros and poles is both N-1. Figure 3a is the zero-pole distribution diagram when N = 5 for high-pass filtering provided by the embodiment of the present invention, Figure 3b is the zero-pole distribution diagram when N = 9 for high-pass filtering provided by the embodiment of the present invention. Please refer to Figures 3a - 3b , it can be seen that the zeros are evenly distributed on the unit circle, and the N-1 multiple poles are located at the center of the circle, and there are no zeros at the position of π radians on the unit circle. It is easy to obtain that in this embodiment, the current measured value x(n) is filtered by an FIR filter with N tap coefficients of [1, -1, 1, -1, ……] / N alternating, achieving the effect of high-pass filtering.
[0080] That is to say, when the engineering requirement is high-pass filtering, in this embodiment, by changing the signs of the tap coefficients in the original system function of the FIR filter, the low-pass filtering can be changed to high-pass filtering. The reconfigured system function is expressed as:
[0081]
[0082] In the formula, N represents the number of taps, X(z) and Y(z) respectively represent the input sequence and the output sequence after z-transform, and l represents the number of measured values in the input sequence.
[0083] Furthermore, when the engineering requirement is band-pass filtering, each tap coefficient in the original system function is alternately set to b and 0, where b = [1, 0, -1]. Specifically, the number of non-zero tap coefficients N ※ is 2, and the number of non-zero tap coefficients N in the coefficient group [b, 0, b…0, b]※ is twice that of b, and the relationship between N and N ※ is N = 2N ※ -1. At this time, the difference equation of the FIR filter is:
[0084]
[0085] Performing Z-transform on the above formula gives:
[0086]
[0087] In the formula, N ※ represents the number of non-zero tap coefficients, m = 0, 1, 2,..., N ※ -1, and X(z) and Y(z) respectively represent the input sequence and output sequence after z-transform.
[0088] Then, the system function of the FIR filter during band-pass filtering is:
[0089]
[0090] Let the numerator formula be equal to 0 to obtain the zeros of the system function of the FIR filter during band-pass filtering: k = 0, 1, 2,... 2N ※ -1, a total of 2N ※ zeros; let the denominator formula be equal to 0 to obtain the poles of the system function: and z p = 0 (2N ※ -2 multiple roots). After canceling the zero-pole pairs of z p1 , and the zero-pole pairs of z p2 are canceled, 2N ※ -2 zeros and 2N ※ -1 poles are obtained. Figure 4a is the zero-pole distribution diagram of N = 7 (i.e., N ※ = 4) during band-pass filtering provided by an embodiment of the present invention, Figure 4b is the zero-pole distribution diagram of N = 15 (i.e., N ※ = 8) during band-pass filtering provided by an embodiment of the present invention. It can be seen through Figures 4a - 4b that in this embodiment, filtering is performed using the tap coefficients arranged repeatedly as [b, 0, b, 0, b,...], achieving the effect of band-pass filtering. Therefore, if the engineering requirement is band-pass filtering, the reconfigured system function is expressed as:
[0091]
[0092] In the formula, X(z) and Y(z) respectively represent the input sequence and output sequence after z-transform, and N ※Satisfy N = 2N ※ -1.
[0093] In this embodiment, the number of taps can be determined according to the minimum attenuation value of the stopband.
[0094] Specifically, taking low-pass filtering as an example, the influence of the number of taps N on the filtering effect is analyzed.
[0095] Based on the system function Let The frequency response function can be obtained as follows:
[0096]
[0097] Figure 5 is the amplitude-frequency characteristic response curve diagram of N = 5, 9, and 19 during low-pass filtering provided by the embodiment of the present invention. As Figure 5 shown, by comparing the observed amplitude-frequency characteristics when the number of taps N = 5, 9, and 19, it can be seen that as the average filtering operation points N increase, the cut-off frequency of the filter becomes smaller, the passband range becomes narrower, the stopband ripple increases, and the absolute value of the minimum attenuation point value in the stopband increases, and the stopband characteristics can be improved to a certain extent. Therefore, Table 1 shown below can be referred to:
[0098] Table 1
[0099]
[0100] In actual applications, determine the passband-stopband characteristics according to the frequency band characteristics of the signal and noise, and reasonably select the number of taps N of the filter according to the required main lobe width and sidelobe attenuation points.
[0101] Figure 6a is the curve diagram of the 3dB attenuation point varying with N during low-pass filtering provided by the embodiment of the present invention. As Figure 6a shown, when the value of N is small, the 3dB passband range decreases significantly with the increase of N, but when N is greater than 50, the frequency position ω corresponding to the 3dB attenuation point at the passband edge tends to be stable. Figure 6b is the curve diagram of the minimum attenuation value in the stopband varying with N during low-pass filtering provided by the embodiment of the present invention. Similarly, as Figure 6b shown, when the value of N is small, the minimum attenuation value in the stopband decreases with the increase of N, and when N is greater than 10, the stopband attenuation value reaches stability, stabilizing at about -13dB.
[0102] The analysis processes of high-pass filtering and band-pass filtering are similar to that of low-pass filtering, so they will not be elaborated here. Table 2 and Table 3 respectively give the calculation tables of partial N value selections for high-pass filtering and band-pass filtering, and appropriate N values can be selected according to actual requirements. To further save resource consumption, the value of N can be a power of 2 to implement FIR filtering without a multiplier.
[0103] Table 2
[0104]
[0105] Table 3
[0106]
[0107] As can be seen from Table 1, Table 2, and Table 3, the high-pass filter system function and the band-pass filter system function generated by changing the tap coefficients in the original system function are equivalent to shifting the amplitude-frequency characteristic curve of the low-pass filter in position, that is, shifting the passband position, and will not change the shape of the amplitude-frequency characteristic curve. Under the same N value, the 3dB bandwidth and the minimum attenuation value of the stopband of the low-pass, high-pass, and band-pass filters are the same.
[0108] After determining the number of taps, further determine the number of filtering times according to the filtering effect, and perform continuous multiple filtering based on the convolution operation. The amplitude of the stopband is relatively high for 1-time filtering, and the first stopband peak is around -13dB. The filtering effect may not meet the expectations. In order to optimize the filtering effect, after one filtering, continuous multiple filtering can be repeated, which can effectively lower the stopband peak. Figure 7 It is the amplitude-frequency characteristic response curve of continuous multiple filtering provided by the embodiment of the present invention. As Figure 7 shown, after continuous two-time filtering (low-pass filtering, high-pass filtering, or band-pass filtering), the stopband peak can be reduced to around -28dB. After continuous three-time filtering, the stopband peak can be reduced to around -40dB, meeting the vast majority of engineering requirements. The circuit structure of continuous multiple filtering can be referred to Figure 8 .
[0109] As can be seen from the above embodiments, the beneficial effects of the present invention are as follows:
[0110] The present invention provides a FIR filtering method with low computational complexity, which can effectively suppress the influence of interference signals during data acquisition. The stopband peak of continuous filtering can be reduced to around -40dB, and the computational overhead is very low. Reasonably selecting the number of taps N can implement a multiplierless FIR filter, which consumes very little software and hardware resources in specific applications and can perform high-performance calculations with extremely low computational resources, facilitating designers to perform filtering.
[0111] In the description of the present invention, the description referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification.
[0112] Although the present application has been described in connection with various embodiments herein, however, in the process of implementing the claimed present application, those skilled in the art can understand and achieve other variations of the disclosed embodiments by viewing the accompanying drawings, the disclosure, and the appended claims.
[0113] The above content is a further detailed description of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is only limited to these descriptions. For those of ordinary skill in the technical field to which the present invention pertains, without departing from the concept of the present invention, several simple deductions or substitutions can still be made, and all should be regarded as belonging to the protection scope of the present invention.
Claims
1. A low computational complexity FIR filtering method, characterized in that: include: Get the input sequence; According to the project requirements, set the number of taps of the FIR filter and determine whether it is necessary to re-proportion the tap coefficients in the original system function; If necessary, the tap coefficients in the original system function are re-proportioned, and the input sequence is filtered based on the re-proportioned system function to obtain an output sequence; otherwise, the input sequence is filtered based on the original system function to obtain an output sequence.
2. The FIR filtering method with low computational complexity according to claim 1, characterized in that: The engineering requirements include low-pass filtering, high-pass filtering and band-pass filtering; The step of determining whether it is necessary to re-proportion each tap coefficient in the original system function comprises: If the engineering requirement is low-pass filtering, there is no need to re-proportion the tap coefficients in the original system function; If the engineering requirement is high-pass filtering or band-pass filtering, it is necessary to re-proportion the tap coefficients in the original system function.
3. The FIR filtering method with low computational complexity according to claim 2, characterized in that: The original system function is expressed as: Where N is the number of taps, z is a complex variable, and X(z) and Y(z) represent the input sequence and output sequence after z transformation, respectively.
4. The FIR filtering method with low computational complexity according to claim 3, characterized in that: If the engineering requirement is high-pass filtering, the tap coefficients in the original system function are set alternately to 1 and -1 in sequence.
5. The FIR filtering method with low computational complexity according to claim 4, characterized in that: If the engineering requirement is high-pass filtering, the re-proportioned system function is expressed as: Wherein, N represents the number of taps, z is a complex variable, X(z) and Y(z) represent the input sequence and output sequence after z transformation, respectively, and m represents the number of measured values in the input sequence.
6. The FIR filtering method with low computational complexity according to claim 3, characterized in that: If the engineering requirement is bandpass filtering, the tap coefficients in the original system function are alternately set to b and 0, where b = [1, 0, -1].
7. The FIR filtering method with low computational complexity according to claim 6, characterized in that: If the engineering requirement is bandpass filtering, the re-proportioned system function is expressed as: In the formula, z is a complex variable, N ※ Indicates the number of non-zero tap coefficients, satisfying N = 2N ※ -1, N represents the number of taps, X(z) and Y(z) represent the input sequence and output sequence after z transformation respectively.
8. The FIR filtering method with low computational complexity according to claim 1, characterized in that: The number of taps is determined according to the minimum attenuation value of the stop band.