Integration filter based on FIR (Finite Impulse Response) filter compensation and implementation method thereof
Through the compensation technology based on FIR filter, the problem of the traditional integration method degradation in high-frequency signal processing is solved, and the integration accuracy and calculation efficiency are achieved, which is suitable for mechanical vibration and communication fields.
Patent Information
- Application Number
- CN202411169821.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-25
- Publication Date
- 2025-01-14
AI Technical Summary
The traditional numerical integration method reduces accuracy when processing signals containing high frequency harmonics, especially in the fields of mechanical vibration and communication modemation, resulting in high data sampling rate requirements and poor processing accuracy.
The compensation integration filter based on the FIR filter is adopted. By designing the differential frequency response between the initial integration module and the target integration model, the target frequency response error constraint of the compensator is adjusted, and the compensation is combined with the FIR filter to combine it into efficient integration filter. utensil.
Improve the integration accuracy, especially in application scenarios where signals contain complex harmonic components, higher computing efficiency and accuracy are achieved, and the hardware implementation process is simplified.
Smart Images

Figure CN119315964A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of digital signal processing, and in particular relates to an integral filter based on FIR filter compensation and a realization method thereof. Background Art
[0002] Numerical integration is an extremely important basic technology in the field of digital signal processing. Its main function is to obtain the definite integral value of the response from the time domain waveform or time series signal by numerical calculation. Traditional numerical integration methods usually adopt the idea of polynomial fitting, approximate the waveform to be integrated with a polynomial curve, and then integrate the fitted polynomial to obtain the numerical integration result. Common methods of this type include the rectangular method, trapezoidal method, Simpson method, etc.
[0003] In recent years, many digital integration methods have combined polynomial fitting with classical IIR filters to achieve efficient computing on digital signal processing chips or embedded processors. However, these methods have high requirements for the shape of the integrand function, especially when the integrand function has rich harmonic components, such as when the integration frequency is close to the Nyquist frequency, the accuracy will drop significantly. This drop in accuracy is particularly evident in the fields of mechanical vibration, communication modulation and demodulation, resulting in high requirements for data sampling rate in these fields, otherwise the processing accuracy of numerical integration will be poor.
[0004] To overcome the above limitations, the present invention proposes an integral filter based on FIR filter compensation. The FIR filter is designed with inherent linear phase characteristics and stable system characteristics, which enables it to perform well in processing complex signals containing high-frequency harmonics. In addition, the implementation of the FIR filter is relatively simple, especially on hardware platforms such as FPGA.
[0005] Therefore, the integral filter based on FIR filter compensation can effectively improve the integral accuracy while maintaining high computational efficiency, showing obvious advantages especially in application scenarios where the signal contains complex harmonic components. Summary of the invention
[0006] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide an integral filter based on FIR filter compensation and an implementation method thereof, providing compensation based on the FIR filter to solve the above-mentioned deficiencies and problems of the IIR filter.
[0007] To achieve the above object and other related objects, a first aspect of the present invention provides an integral filter implementation method, comprising the following steps:
[0008] S1. Design an initial integration module based on the IIR filter to output the initial integration result;
[0009] S2. Calculate the difference frequency response D(f) between the initial integration module and the target integration model as the target frequency response of the compensator; S3. Adjust the error constraint on the target frequency response of the compensator according to the frequency range of the integrated signal;
[0010] S4. According to the compensator target frequency response and its error constraint, a compensation filter based on FIR filter is designed to compensate the initial integration result;
[0011] S5. Combining the initial integration module and the compensation filter into an integration filter.
[0012] In certain embodiments of the first aspect, the method of designing an initial integration module based on the IIR filter includes a rectangular method, a trapezoidal method or a Simpson method.
[0013] In certain embodiments of the first aspect, calculating the difference frequency response between the initial integral module and the target integral model comprises the following steps:
[0014] S21. Calculate the frequency response F1(f) of the initial integration module;
[0015] S22. Calculate the frequency response F2(f) of the target integral model;
[0016] S23. Calculate the difference frequency response between F1(f) and F2(f): D(f) = F2(f) / F1(f).
[0017] In some embodiments of the first aspect, the method for designing a compensation filter based on an FIR filter further comprises:
[0018] S41. According to the frequency range of the integrated signal, adjust the error constraint on the target frequency response of the compensator; S42. According to the allowable range of the integrated frequency response error, adjust the compensation filter length;
[0019] S44. Compensation filter based on FIR filter.
[0020] In certain embodiments of the first aspect, adjusting the error constraint on the target frequency response of the compensator comprises the following steps:
[0021] According to the frequency range of the integrated signal, only the target frequency response within the frequency range is constrained, and the target frequency response outside the frequency range is ignored; or
[0022] Assign high weights to errors within the target frequency response and low weights to errors outside the target frequency response; or
[0023] Different weights are assigned to the target frequency response errors within the frequency range according to the frequencies. Different weight distributions include high weights for low frequencies and low weights for high frequencies. For example, the lower the frequency, the higher the weight, and the higher the frequency, the lower the weight. The error of the target frequency response outside the frequency range is assigned an even lower weight.
[0024] In certain embodiments of the first aspect, merging the initial integration module and the compensation filter into an integration filter includes: using the output of the initial integration module as the input of the compensation filter to achieve cascading of the initial integration module and the compensation filter.
[0025] The second aspect of the present invention provides an integration filter based on FIR filter compensation, comprising: an initial integration module and a compensation filter configured in a chip; wherein the compensation filter is used to provide compensation for the signal output of the initial integration module, and the initial integration module and the compensation filter are combined into an integration filter.
[0026] Beneficial effects of the present invention:
[0027] 1. The present invention innovatively combines an infinite impulse response (IIR) integral filter with a finite impulse response (FIR) compensation filter, thereby solving the following deficiencies of the IIR filter: the optimization design method of the IIR filter for arbitrary frequency response is immature (e.g., the Least Pth Norm method for designing an IIR filter is not as stable as the algorithm based on Remez exchange for designing an FIR filter, such as the Parks-McClellan algorithm); when directly designing an IIR filter, it is impossible to set an effective objective function; by combining with the FIR filter, the present invention can achieve higher accuracy and stability in the signal processing process, especially performs well in processing complex signals containing high-frequency signal components, while simplifying the implementation process on the hardware platform.
[0028] 2. The present invention adopts Parks-McClellan and other optimization algorithms to design FIR compensation filters, so that the compensation filters can efficiently and accurately compensate for the frequency response error of the IIR initial integration module.
[0029] 3. The present invention greatly improves the integration accuracy of the integral filter for sinusoidal signals with frequencies close to the Nyquist frequency by introducing a compensation filter. The frequency range and error tolerance of the waveform to be integrated are analyzed, and a weighted optimization design of the compensation filter is performed to achieve the best compensation effect. Combining the high efficiency of the infinite impulse response initial integration module and the high precision of the finite impulse response compensation module, a technical breakthrough in high-performance integral filters is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0031] Figure 1 A flowchart of a method for implementing the present invention;
[0032] Figure 2 This is the flowchart for step 4;
[0033] Figure 3 It is a module schematic diagram of the integral filter of the present invention;
[0034] Figure 4 Schematic diagram of frequency response of ideal integrator and traditional integration algorithm;
[0035] Figure 5 The frequency response error curve diagram that needs to be corrected for the compensation FIR design of Example 1;
[0036] Figure 6 This is a comparison diagram of the frequency responses of the conventional and modified integral filters in Example 1;
[0037] Figure 7 This is a comparison diagram of the error between the corrected integral filter of Example 1 and the traditional integral algorithm relative to the ideal frequency response;
[0038] Figure 8 The frequency response error curve diagram that needs to be corrected for the compensation FIR design of Example 2;
[0039] Fig. 9 This is a comparison diagram of the errors of the corrected integral filter of Example 2 and the traditional integral algorithm relative to the ideal frequency response. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0041] In the description of the present invention, it should be noted that the terms "upper", "lower", "left", "right", "center", "vertical", "horizontal", "inner", "outer", etc. indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", "third", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0042] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installation", "setting", "connection", "connection" and the like should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. Specific embodiment 1
[0044] like Figure 1 As shown, this embodiment provides a specific implementation method of an integral filter based on FIR filter compensation. The method includes the following steps:
[0045] S1. Design an initial integration module based on the IIR filter. The initial integration module uses the rectangular method, trapezoidal method or Simpson method to integrate the input signal and output the initial integration signal. The zero-pole parameters of the IIR filter can be adjusted through the optimization algorithm to make its frequency response characteristics as close to the ideal integrator as possible.
[0046] The rectangular method is a basic numerical integration method. It approximates the integral by using a step rectangle to calculate the integral. Specifically, the integral interval [a, b] is divided into n small intervals, and the width of each small interval is Δx = (ba) / n. In each small interval, the integrand is approximated by a step rectangle, and then the area of each small interval, that is, the integral value, is calculated. Finally, the integral values of each small interval are added to get the total integral value. The mathematical expression of the rectangular method is:
[0047]
[0048] in
[0049]
[0050] The trapezoidal method is a common numerical integration method that calculates the integral value by approximating the integrand with a straight line segment. Specifically, the integral interval [a, b] is divided into n small intervals, and the width of each small interval is Δx = (ba) / n. In each small interval, the integrand is approximated with a straight line segment, and then the integral value of each small interval is calculated, and finally the integral value of each small interval is added to get the total integral value. The mathematical expression of the trapezoidal method is:
[0051]
[0052] in
[0053]
[0054] Compared with the trapezoidal method, the Simpson method uses a quadratic polynomial to approximate the integrand, which can achieve higher integration accuracy. The mathematical expression of the Simpson method is:
[0055]
[0056] in
[0057]
[0058] Compared with the trapezoidal method, the Simpson method uses a quadratic polynomial for approximation in each small interval, thereby improving the integration accuracy, but at the same time increasing the computational complexity.
[0059] S2. Calculate the difference frequency response D(f) between the initial integration module and the target integration model. Specifically, it includes the following steps:
[0060] S21. Calculate the first frequency response information F1(f) of the initial integration module;
[0061] S22. Calculate the second frequency response information F2(f) of the target integral model;
[0062] S23. Calculate the difference frequency response D(f)=F2(f)-F1(f) between the first frequency response information F1(f) and the second frequency response information F2(f).
[0063] The target integral model may be the frequency response characteristic of an ideal integrator, that is, F2(f)=1 / jω. Other specific frequency response characteristics may also be set according to actual application requirements, such as bandpass characteristics, low-pass characteristics, etc.
[0064] By calculating the frequency response characteristics F1(f) of the initial integration module and the frequency response characteristics F2(f) of the target integration model, the difference frequency response D(f) between the two can be obtained. D(f) reflects the deviation between the initial integration module and the ideal integrator or the target integration model, which is the part that needs to be compensated by the subsequent compensation filter.
[0065] S3. Set the target response function according to the difference frequency response D(f). The target response function can be the frequency response characteristic obtained after processing and optimizing D(f). The processing methods can include the following two:
[0066] The difference frequency response within the frequency range is retained, and the difference frequency response outside the frequency range is ignored.
[0067] High weights are given to frequency responses that are within the frequency range, and low weights are given to frequency responses that are outside the frequency range.
[0068] The first method can ensure that the compensation filter can better suppress errors within the target frequency range. The second method can retain the difference information outside the target frequency range to a certain extent to enhance the robustness of the compensation filter. Which method to use needs to be weighed according to the actual application requirements.
[0069] S4. Design a compensation filter based on an FIR filter for the target response function to output a compensation signal. Specifically, the following steps are included:
[0070] S41. According to the frequency range of the integrated waveform required by the initial integration module design, adjusting the difference frequency response within the frequency range;
[0071] S42. Adjust the compensation filter length according to the allowable range of the integrated frequency response error;
[0072] S43. extracting one or more control points from the target response function according to the frequency response range and the allowable range of compensation error;
[0073] S44. Establish a compensation filter based on the FIR filter.
[0074] The coefficients of the FIR filter can be designed using the Parks-McClellan algorithm or other optimization algorithms so that the frequency response characteristics of the compensation filter are as close to the target response function as possible.
[0075] The Parkes-McClellan algorithm is a classic FIR filter design method that can calculate the coefficients of the FIR filter based on the specified filter amplitude-frequency characteristics and phase-frequency characteristics using the Chebyshev approximation theory. This algorithm can ensure that the designed FIR filter has the smallest maximum deviation within the specified frequency band, thereby achieving optimal frequency domain performance.
[0076] In addition to adjusting the frequency range, the length of the compensation filter needs to be determined based on the allowable range of the integrated frequency response error. In general, the longer the compensation filter is, the more precise the frequency response characteristics can be controlled, thereby better compensating for the error of the initial integration module. However, it will also increase the computational complexity and resource consumption. Therefore, a trade-off needs to be made between performance and complexity.
[0077] After determining the frequency range and filter length, one or more key control points can be extracted from the target response function. These control points will serve as constraints for the FIR filter design to ensure that the frequency response characteristics of the compensation filter can approach the target response to the greatest extent possible. The selection of control points requires a trade-off between the frequency response range and the allowable range of compensation error.
[0078] In summary, the frequency response characteristics of the FIR compensation filter designed through the above steps will be as close to the target response function as possible, thereby being able to effectively compensate for the error of the initial integration module.
[0079] S5. The initial integration module and the compensation filter are combined into an integration filter. The specific implementation method is to use the output of the initial integration module as the input of the compensation filter to achieve cascading of the two.
[0080] In summary, this embodiment, through the combination of the IIR initial integration module and the FIR compensation filter, gives full play to the respective advantages of the two filters, and greatly improves the integration accuracy of the integration filter for nonlinear, time-varying signals and sine wave signals with frequencies close to the Nyquist frequency. During the design process, the frequency range of the integrated waveform, the allowable error range, etc. are analyzed, and the key control points are extracted in combination with the optimization algorithm to achieve the optimal compensation effect.
[0081] The effectiveness of the implementation method of the integral filter provided in this embodiment is verified by a specific numerical simulation example.
[0082] First, we analyze the frequency response of the traditional algorithm and its error to the ideal integrator. Figure 4 As shown in the figure, it can be seen that the traditional integration algorithm is ideal at low frequencies, but deviates significantly from the frequency response of the ideal integrator at higher frequencies. It can be seen that above 0.1 times the sampling frequency, the errors of various traditional integration algorithms gradually appear.
[0083] We take the rectangular method as the model of the infinite impulse response (IIR) integral filter. According to public domain knowledge, the rectangular method filter system response function is:
[0084]
[0085] Take the error of 0-0.45 times the sampling rate, such as Figure 5 , as the target frequency response for correction. That is, we design a finite impulse response filter (FIR) whose frequency response is the negative value of this error curve as a compensator. We take two cases, unweighted and weighted, as examples. Figure 5 The FIR with length 13 constructed by the Parkes-McClellan algorithm is shown in the column "Correction 1" of Table 1. Figure 5The negative value is taken as the target and weighted according to 1 / f. The FIR with a length of 13 constructed by the Parks-McClellan algorithm is shown in the column "Correction 2" of Table 1.
[0086]
[0087]
[0088] Table 1
[0089] Both correction coefficients are 13, represented by b, then the system response function of the rectangular method cascade correction FIR is:
[0090]
[0091] Figure 6 The frequency responses of the conventional and modified integrators are shown, where Modification 1 is represented by solid triangles and Modification 2 is represented by hollow squares. Figure 7 The error of the traditional and corrected integrator frequency response relative to the ideal frequency response is shown, where Correction 1 is represented by a thin black dashed line and Correction 2 is represented by a thin black solid line. It can be seen that the weighted integral filter corrector achieves better results. It is significantly better than traditional numerical integration such as the Simpson method at frequencies above 0.1 sampling rate.
[0092] Through the above simulation analysis, the following conclusions can be drawn:
[0093] This embodiment uses the combination of the IIR initial integration module and the FIR compensation filter to give full play to the respective advantages of the two filters and greatly improve the integration accuracy, especially for complex signals containing multiple sinusoidal wave components.
[0094] During the design process, the frequency range of the integrated signal, the allowable range of integration error, etc. were deeply analyzed, and the key control points were extracted in combination with the optimization algorithm, so that the frequency response characteristics of the compensation filter can be close to the target response to the greatest extent, thereby achieving high-precision integration performance.
[0095] This method has shown excellent performance in processing nonlinear, time-varying signals, and sinusoidal signals with frequencies close to the Nyquist frequency, and can be widely used in mechanical vibration, communication, medical and other fields. Specific embodiment 2
[0097] like Figure 3 As shown, this embodiment provides a specific structure of an integral filter based on FIR filter compensation. The integral filter includes:
[0098] The integral filter module is integrated into a chip and is used to implement the integral filter implementation method provided by the present invention. Specifically, it includes:
[0099] Initial integration module: Based on IIR filter design, it is used to output the initial integration signal. This module is designed using the method described in Example 1, and its frequency response characteristics can be as close to the ideal integrator as possible.
[0100] Differential frequency response calculation module: Calculates the differential frequency response D(f) between the initial integration module and the target integration model. The target integration model can be the frequency response characteristics of an ideal integrator, or other specific frequency response characteristics can be set according to actual application requirements.
[0101] Compensation filter design module: Design a compensation filter based on an FIR filter for the target response function to output a compensation signal. This module is designed using the method described in Example 2, including steps such as frequency range analysis, control point extraction, and weighted optimization.
[0102] Control module, which is used to control the work of the integral filter module. The main functions include:
[0103] According to the difference frequency response D(f), the target response function is set. The design of the target response function can refer to the methods in Example 1 and Example 2, such as retaining the difference frequency response within the frequency range, assigning weights to the difference frequency response, etc.
[0104] The control compensation filter design module optimizes the design of the compensation filter based on the target response function and other constraints. This includes determining parameters such as frequency range, filter length, and control points.
[0105] Coordinate the work of the initial integration module and the compensation filter to ensure the effective cascading of the two and output the final integration result.
[0106] The structure of the integral filter fully reflects the innovative ideas of the present invention. Through the combination of the IIR initial integral module and the FIR compensation filter, the advantages of the two filters are brought into play, and the integral accuracy is greatly improved. At the same time, the control module dynamically adjusts the parameters according to the actual application requirements, so that the overall performance can meet a wider range of application scenarios.
[0107] The following is a specific application case to illustrate the design process of the integral filter:
[0108] In the design, we focus on the frequency range of 0-0.4 times the sampling rate and hope to control the integration error within 0.001dB.
[0109] We use a rectangular integral IIR filter as the basis and calculate its frequency response error of 0-0.4 times the sampling rate, as follows: Figure 8 .right Figure 8The curve seeks a negative value as the design target of the compensation FIR, and uses 1 / f as the weighting coefficient. The length 17 FIR constructed by the Parks-McClellan algorithm is shown in Table 2. It is cascaded with the integrator to form a new integrator:
[0110]
[0111] Where b is the coefficient in Table 2.
[0112] The corrected integrator frequency response error after simulation calculation is as follows: Fig. 9 The black solid line shows that the modified integrator is better than 0.001dB in the sampling rate range of 0-0.4 and significantly better than the traditional integrator in the high frequency band. This result verifies the effectiveness of the integration filter scheme.
[0113]
[0114]
[0115] Table 2
[0116] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, improvements, equivalent substitutions, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for implementing an integral filter, characterized in that: The steps include: S1. Design an initial integration module based on the IIR filter to output the initial integration result; S2. Calculate the difference frequency response D(f) between the initial integral module and the target integral model as the target frequency response of the compensator; S3. adjusting the error constraint on the target frequency response of the compensator according to the frequency range of the integrated signal; S4. Design a compensation filter based on FIR filter according to the compensator target frequency response and its error constraint to compensate the initial integration result; S5. Combining the initial integration module and the compensation filter into an integration filter.
2. The method for realizing an integral filter according to claim 1, characterized in that: The method of designing an initial integration module based on the IIR filter includes a rectangular method, a trapezoidal method or a Simpson method.
3. The method for realizing an integral filter according to claim 1, characterized in that: The step of calculating the difference frequency response between the initial integral module and the target integral model comprises the following steps: S21. Calculate the frequency response F1(f) of the initial integration module; S22. Calculate the frequency response F2(f) of the target integral model; S23. Calculate the difference frequency response between F1(f) and F2(f): D(f) = F1(f) / F2(f).
4. The method for realizing an integral filter according to claim 1, characterized in that: The method for designing a compensation filter based on an FIR filter also includes: S41. Adjust the error constraint of the target frequency response of the compensator according to the frequency range of the integrated signal; S42. Adjust the compensation filter length according to the allowable range of the integrated frequency response error; S44. Compensation filter based on FIR filter.
5. The method for realizing an integral filter according to claim 4, characterized in that: The step of adjusting the error constraint on the target frequency response of the compensator comprises the following steps: Based on the frequency range of the integrated signal, only constrain the target frequency response within the frequency range of interest and ignore the target frequency response outside the frequency range of interest; or Assign high weights to the errors of the target frequency response within the frequency range, and assign low weights to the errors of the target frequency response outside the frequency range; or Different weights are assigned to the target frequency response errors within the frequency range according to the frequencies. Different weight assignments include assigning high weights to low frequencies and low weights to high frequencies.
6. The method for realizing an integral filter according to claim 1, characterized in that: The combining the initial integration module and the compensation filter into an integration filter comprises: using the output of the initial integration module as the input of the compensation filter to realize cascading of the initial integration module and the compensation filter.
7. An integral filter based on FIR filter compensation, characterized in that: include: An initial integration module and a compensation filter are configured in a chip; wherein the compensation filter is used to provide compensation for the signal output of the initial integration module, and the initial integration module and the compensation filter are combined into an integration filter.