Linear phase IIR filter implementation method and device, equipment and storage medium
By preset length division and timing inversion of the input signal of the IIR filter, the problem of large resource consumption and calculation amount of the IIR filter is solved, and the phase linearity and resource saving of the filter are realized, which is suitable for resource limitations. Application.
Patent Information
- Application Number
- CN202411118086.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-19
AI Technical Summary
While ensuring phase linearity, the existing IIR filters consume too much resource and calculate the amount, and cannot adapt to application fields where resource constraints and phase strict linearity is required.
By dividing the input signal into multiple sub-signals according to the preset length, and performing timing inversion, inputting it into an infinite long impulse response filter for processing, two timing inversion operations are used to realize the linear phase of the IIR filter. compensate.
The phase strict linearity of the IIR filter is realized, which significantly reduces resource consumption and calculation amount, and is suitable for application scenarios where resource limitations and requires strict linearity of phase.
Smart Images

Figure CN118984148A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of signal processing, and in particular, to a method for realizing a linear phase IIR filter, a device for realizing a linear phase IIR filter, a computer device, and a computer storage medium. Background Art
[0002] In the field of digital signal processing, it is usually necessary to perform preprocessing such as digital filtering on the collected signals. According to the time domain characteristics of the impulse response, digital filters can be divided into finite impulse response filters (Finite Impulse Response Filters, referred to as FIR) and infinite impulse response filters (Infinite Impulse Response filters, referred to as IIR). Among them, the phase of the FIR filter is strictly linear, but the required order under the same parameters is much higher than that of the IIR filter, resulting in higher delays and resource consumption than the IIR filter, and the phase of the IIR filter is nonlinear, which leads to signal phase distortion. However, the above two filters cannot be applied to application fields where resources are limited and the phase requires linearity. Therefore, it is necessary to implement a linear phase compensation technology for the IIR filter to achieve the linear phase of the IIR filter.
[0003] In the related technical solutions, the specification of Chinese invention CN117200746A discloses an analog filter with a pre-designed linear phase, and then uses a bilinear transformation method to approximate the digital filter, but this method cannot achieve strict linearity of the phase. The specification of Chinese invention CN102082559A discloses truncating and reversing the continuous signal, and bidirectional filtering ensures strict linearity of the phase, but requires a large amount of cache space for timing reversal, and the amount of calculation is large. The specification of Chinese invention CN111431506A discloses the use of bidirectional filtering to achieve linear phase, but this method requires a large amount of memory bandwidth, resulting in increased resource consumption.
[0004] Therefore, there is an urgent need for an implementation method that can ensure the phase linearity of the IIR filter and significantly reduce resource consumption and computational complexity, so as to have good application prospects and practical significance. Summary of the invention
[0005] In the embodiments of the present application, a linear phase IIR filter implementation method, a linear phase IIR filter implementation method device, a computer device and a computer storage medium are provided, thereby overcoming at least to a certain extent the technical problem of being unable to control the low resource consumption and low calculation amount in the implementation process while ensuring the linearity of the IIR filter phase due to the limitations and defects of the relevant technology.
[0006] In a first aspect of an embodiment of the present application, a method for implementing a linear phase IIR filter is provided, the method comprising: dividing an input signal into multiple groups of first input sub-signals according to a preset length, and respectively time-inverting the multiple groups of first input sub-signals to obtain multiple groups of second input sub-signals; inputting the multiple groups of second input sub-signals into an infinite impulse response filter IIR to obtain a first output signal; dividing the first output signal into multiple groups of third input sub-signals according to a preset length, and respectively time-inverting the multiple groups of third input sub-signals to obtain multiple groups of fourth input sub-signals; and inputting the multiple groups of fourth input sub-signals into the IIR filter to obtain a second output signal.
[0007] In an optional embodiment of the present application, dividing the input signal into multiple groups of first input sub-signals according to a preset length includes: dividing the input signal into two groups of first input sub-signals of equal length according to a preset length of 2.
[0008] In an optional embodiment of the present application, multiple groups of first input sub-signals are time-inverted respectively to obtain multiple groups of second input sub-signals, including: storing the multiple groups of first input sub-signals in different cache areas, and time-inverting the first input sub-signals in different cache areas to obtain multiple groups of second input sub-signals.
[0009] In an optional embodiment of the present application, multiple groups of second input sub-signals are input into an infinite impulse response filter IIR to obtain a first output signal, including: inputting multiple groups of second input sub-signals into different IIR filters instantiated by a field programmable gate array FPGA module to obtain a first output signal.
[0010] In an optional embodiment of the present application, the IIR filter instantiated by the FPGA module is any one of Butterworth, Chebyshev, and Elliptic.
[0011] In an optional embodiment of the present application, multiple groups of second input sub-signals are input into an infinite impulse response filter IIR to obtain a first output signal, including: inputting the multiple groups of second input sub-signals into the IIR filter respectively to obtain filter output responses corresponding to the multiple groups of second input sub-signals respectively; delaying and superimposing the filter output responses corresponding to the multiple groups of second input sub-signals respectively to obtain the first output signal.
[0012] In an optional embodiment of the present application, inputting the multiple groups of fourth input sub-signals into an IIR filter to obtain a second output signal includes: inputting the multiple groups of fourth input sub-signals into the same IIR filter to obtain the second output signal.
[0013] According to a second aspect of an embodiment of the present application, a linear phase IIR filter implementation device is provided, the device comprising: a first division module, used to divide an input signal into multiple groups of first input sub-signals according to a preset length, and respectively time-invert the multiple groups of first input sub-signals to obtain multiple groups of second input sub-signals; a first input module, used to input the multiple groups of second input sub-signals into an infinite impulse response filter IIR to obtain a first output signal; a second division module, used to divide the first output signal into multiple groups of third input sub-signals according to a preset length, and respectively time-invert the multiple groups of third input sub-signals to obtain multiple groups of fourth input sub-signals; a second input module, used to input the multiple groups of fourth input sub-signals into the IIR filter to obtain a second output signal.
[0014] In an optional embodiment of the present application, the first division module is used to divide the input signal into two groups of first input sub-signals of equal length according to a preset length of 2.
[0015] In an optional embodiment of the present application, the first division module is used to store multiple groups of first input sub-signals in different cache areas, and perform time inversion on the first input sub-signals in different cache areas to obtain multiple groups of second input sub-signals.
[0016] In an optional embodiment of the present application, the first input module is used to input multiple groups of second input sub-signals into the IIR filter instantiated by the field programmable gate array FPGA module to obtain a first output signal.
[0017] In an optional embodiment of the present application, the IIR filter instantiated by the FPGA module is any one of Butterworth, Chebyshev, and Elliptic.
[0018] In an optional embodiment of the present application, the first input module is used to input multiple groups of second input sub-signals into the IIR filter respectively to obtain filter output responses corresponding to the multiple groups of second input sub-signals; and delay and superimpose the filter output responses corresponding to the multiple groups of second input sub-signals to obtain the first output signal.
[0019] In an optional embodiment of the present application, the second input module is used to input multiple groups of fourth input sub-signals into the same IIR filter to obtain a second output signal.
[0020] According to a third aspect of an embodiment of the present application, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any of the above linear phase IIR filter implementation methods are implemented.
[0021] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the linear phase IIR filter implementation method as described in any one of the above items are implemented.
[0022] According to a fifth aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which is executed by a processor to implement the steps of any one of the above linear phase IIR filter implementation methods.
[0023] The technical solution of this application has the following beneficial effects:
[0024] In the above-mentioned linear phase IIR filter implementation method, the input signal is divided into multiple groups of first input sub-signals according to a preset length, and the multiple groups of first input sub-signals are respectively time-inverted to obtain multiple groups of second input sub-signals; the multiple groups of second input sub-signals are input into an infinite impulse response filter IIR to obtain a first output signal; the first output signal is divided into multiple groups of third input sub-signals according to a preset length, and the multiple groups of third input sub-signals are respectively time-inverted to obtain multiple groups of fourth input sub-signals; the multiple groups of fourth input sub-signals are input into the IIR filter to obtain a second output signal.
[0025] The method groups the input signal according to a preset length, and then performs a timing inversion operation on each of the grouped sub-signals. Compared with the related technical solution that directly performs subsequent operations on the input signal, this process can significantly reduce resource consumption and calculation. In addition, the method realizes the linear phase compensation of the IIR filter through the timing inversion operation of the signal twice, thereby ensuring the strict linearity of the filter phase, which is well adapted to the application scenarios with limited resources and strict phase linearity requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0027] Figure 1 A flowchart of a method for implementing a linear phase IIR filter provided by one embodiment of the present application;
[0028] Figure 2 A schematic diagram of a complete linear phase IIR filter implementation process provided by an embodiment of the present application;
[0029] FIG3(A) is a schematic diagram of amplitude-frequency variation of a third-order Elliptic IIR filter provided by an embodiment of the present application;
[0030] FIG3(B) is a schematic diagram of phase-frequency variation of a third-order Elliptic IIR filter provided by an embodiment of the present application;
[0031] FIG4(A) is a signal waveform diagram before filtering provided by an embodiment of the present application;
[0032] FIG4(B) is a waveform diagram of a filtered signal provided by an embodiment of the present application;
[0033] Figure 5 A schematic diagram of phase change of an IIR filter after phase compensation provided by an embodiment of the present application;
[0034] Figure 6 A schematic diagram of the structure of a linear phase IIR filter implementation device provided in one embodiment of the present application;
[0035] Figure 7 A schematic diagram of the computer device structure provided for one embodiment of the present application. DETAILED DESCRIPTION
[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0037] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0038] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation.
[0039] In the relevant technical background, the field of digital signal processing often requires preprocessing of the collected signals, including digital filtering. Digital filtering is used to filter out the error points, redundant points introduced in the digitization process, and the measurement noise caused by the scanning environment. According to the time domain characteristics of the impulse response, the digital filter can be divided into a finite impulse response filter FIR and an infinite impulse response filter IIR. Among them, the phase of the FIR filter is strictly linear, but the required order under the same parameters is much higher than that of the IIR filter, resulting in higher delays and resource consumption than the IIR filter, and the phase of the IIR filter is nonlinear, resulting in signal phase distortion. However, the above two filters cannot be applied to application fields where resources are limited and the phase requires linearity, so it is necessary to implement a linear phase compensation technology for the IIR filter to achieve the linear phase of the IIR filter.
[0040] In the related technical solutions, the specification of Chinese invention CN117200746A—“A method for designing a linear phase IIR digital filter” discloses: using an analog filter design method to design a linear phase analog filter in advance, and then using a bilinear transformation method to approximate the digital filter to achieve the phase approximation linearity of the IIR filter, but the implementation process of this method is complicated and cannot guarantee the strict linearity of the phase. The specification of Chinese invention CN102082559A—“A method for implementing a linear phase IIR filter” discloses: truncating a continuous signal and reversing the timing, inputting the obtained reversed signal into a reverse filter and then reversing the timing, and then outputting the result through a forward filter, and bidirectional filtering can ensure strict linearity of the phase, but this method requires a large amount of cache space for timing reversal, and the amount of calculation is large. The specification of Chinese invention CN111431506A—“A method for performing IIR filtering on collected data based on an FPGA chip” discloses: using bidirectional filtering to achieve linear phase, but this method requires a large amount of memory bandwidth, resulting in increased resource consumption and a large amount of calculation.
[0041] In general, the above-mentioned related technical solutions cannot significantly reduce the resource consumption and calculation amount in the implementation process while ensuring the strict linearity of the IIR filter phase.
[0042] Taking the above problems into consideration, the exemplary embodiment of the present disclosure proposes a method for realizing a linear phase IIR filter, which divides the input signal into multiple groups of first input sub-signals according to a preset length, and respectively performs time inversion on the multiple groups of first input sub-signals to obtain multiple groups of second input sub-signals; inputs the multiple groups of second input sub-signals into an infinite impulse response filter IIR to obtain a first output signal; divides the first output signal into multiple groups of third input sub-signals according to a preset length, and respectively performs time inversion on the multiple groups of third input sub-signals to obtain multiple groups of fourth input sub-signals; and inputs the multiple groups of fourth input sub-signals into an IIR filter to obtain a second output signal. The above method divides the input signal into two groups according to a preset length, which can greatly reduce resource consumption and calculation amount compared with the related art of directly filtering the input signal. Moreover, linear phase compensation can be achieved by performing time inversion on the input signal twice and then inputting it into the IIR filter, thereby achieving strict linearity of the phase of the IIR filter, and thus can adapt to application requirements with limited resources and requiring linear phase.
[0043] The following will be combined Figure 1 The linear phase IIR filter implementation method provided in the embodiment of the present application is rationally explained. Figure 1 A flowchart schematically shows a method for implementing a linear phase IIR filter in this exemplary embodiment, see Figure 1 The linear phase IIR filter implementation method provided by the embodiment of the present disclosure includes the following steps 101 to 104:
[0044] Step 101 : Divide an input signal into a plurality of groups of first input sub-signals according to a preset length, and perform time inversion on the plurality of groups of first input sub-signals respectively to obtain a plurality of groups of second input sub-signals.
[0045] Step 102: Input multiple groups of second input sub-signals into an infinite impulse response filter IIR to obtain a first output signal.
[0046] Step 103 : Divide the first output signal into a plurality of groups of third input sub-signals according to a preset length, and perform time inversion on the plurality of groups of third input sub-signals respectively to obtain a plurality of groups of fourth input sub-signals.
[0047] Step 104: Input multiple groups of fourth input sub-signals into the IIR filter to obtain a second output signal.
[0048] In the technical solutions provided by some embodiments of the present disclosure, the input signal is divided into multiple groups of first input sub-signals according to a preset length, and the multiple groups of first input sub-signals are respectively time-inverted to obtain multiple groups of second input sub-signals; the multiple groups of second input sub-signals are input into an infinite impulse response filter IIR to obtain a first output signal; the first output signal is divided into multiple groups of third input sub-signals according to a preset length, and the multiple groups of third input sub-signals are respectively time-inverted to obtain multiple groups of fourth input sub-signals; the multiple groups of fourth input sub-signals are input into an IIR filter to obtain a second output signal. The method groups the input signal according to a preset length, and then performs a time-inversion operation on the grouped sub-signals. Compared with the related technical solutions that directly perform subsequent operations on the input signal, the process can greatly reduce resource consumption and calculation amount. In addition, the method realizes the linear phase compensation of the IIR filter through the time-inversion operation of the signal twice, thereby ensuring the strict linearity of the filter phase, which is well adapted to the application scenarios with limited resources and strict linearity of the phase.
[0049] The following will be combined with specific embodiments to Figure 1 The specific implementation methods of each step in the embodiment shown are described in detail:
[0050] In step 101, an input signal is divided into a plurality of groups of first input sub-signals according to a preset length, and the plurality of groups of first input sub-signals are respectively time-inverted to obtain a plurality of groups of second input sub-signals.
[0051] The collected input signal may be a continuous signal, such as x(n) = {x(0), x(1), x(2), ...}, and the preset length may be any length, such as 2, 3 or any other length, and this application does not impose any restrictions on this.
[0052] In one embodiment of the present application, the input signal is divided into two groups of first input sub-signals of equal length according to a preset length of 2.
[0053] Exemplarily, the input signal may be divided into two groups of equal-length segments of a preset length of 2 in time sequence, thereby obtaining two groups of first input sub-signals, and then the two groups of first input sub-signals are respectively time-reversed to obtain two groups of second input sub-signals. That is, when executing step 101, the preset length may be configured as 2, thereby dividing the input signal into two groups of equal-length segments of the first input sub-signals in time sequence based on the preset length of 2.
[0054] In this embodiment, the input signal is divided into two groups of first input sub-signals of equal length according to a preset length of 2. The input signal can be divided into preset lengths for filtering in groups, thereby significantly reducing resource consumption and calculation complexity.
[0055] After the input signal is divided into a plurality of groups of first input sub-signals according to the preset length in the above embodiment, the plurality of groups of first input sub-signals can be time-inverted respectively to obtain a plurality of groups of second input sub-signals.
[0056] Among them, timing inversion refers to reading the timing in reverse. For example, taking the preset length 2 as an example, for the continuous signal (i.e., input signal) x(n) = {x(0), x(1), x(2), ...}, it can be divided into two groups of equal-length segments according to the length 2, that is, the first input sub-signals are a(n) = {x(4*n), x(4*n+1)} and b(n) = {x(4*n+2), x(4*n+3)}. The continuous signal x(n) is composed of n in a(n) and b(n) taking the values of 0, 1, 2... respectively, and x(4*n), x(4*n+1) contained in a(n), x(4*n+2), x(4*n+3) in b(n), which represent the corresponding preset length of 2. A(n) and b(n) are stored in two cache areas instantiated in FPGA respectively, and then a(n) is time-reversed to obtain c(n)={x(4*n+1),x(4*n)} and b(n) is time-reversed / reverse read to obtain d(n)={x(4*n+3),x(4*n+2)}.
[0057] In one embodiment of the present application, after obtaining two groups of first input sub-signals of equal length, the two groups of first input sub-signals are stored in different cache areas, and the first input sub-signals are time-reversed in different cache areas to obtain two groups of second input sub-signals.
[0058] Exemplarily, after obtaining multiple groups of first input sub-signals of equal length, they can be stored in sequence in two different cache areas instantiated by the FPGA module so as to store the first input sub-signals in different regions, and then the stored first input sub-signals can be time-reversed in the two different cache areas respectively, so as to obtain multiple groups of second input sub-signals respectively.
[0059] In this embodiment, multiple groups of second input sub-signals are stored in different cache areas respectively, and timing inversion operations can be implemented in different cache areas respectively, which can greatly reduce resource consumption and calculation amount, making it suitable for resource-constrained application scenarios.
[0060] In step 102, a plurality of groups of second input sub-signals are input into an infinite impulse response filter IIR to obtain a first output signal.
[0061] Exemplarily, after obtaining a plurality of groups of second input sub-signals respectively corresponding to a plurality of groups of first input sub-signals, they may be input into an IIR filter to obtain a first filtered output signal.
[0062] The following will exemplarily illustrate the steps of step 102 in conjunction with a specific embodiment:
[0063] In one embodiment of the present application, multiple groups of second input sub-signals are input into different IIR filters instantiated by a field programmable gate array FPGA module to obtain a first output signal.
[0064] Among them, module instantiation can be understood as module calling. For a Field Programmable Gate Array (FPGA) project, it is usually composed of a top-level module and multiple functional sub-modules. In order to realize the connection between the top-level module and the sub-modules, it is necessary to instantiate (or call) the modules. In an FPGA project, the names of its input and output ports are usually determined in the early stage of design, but there will be some intermediate variables. A project may be completed by different engineers in different time periods. Different people will have different names for these variables, so instantiation is very necessary.
[0065] Exemplarily, multiple groups of second input sub-signals can be respectively input into different IIR filters instantiated by the FPGA module, so as to subsequently obtain filter output responses corresponding to the multiple groups of second input sub-signals; and the filter output responses corresponding to the multiple groups of second input sub-signals are delayed and superimposed to obtain the first output signal. Figure 2 Part B of the implementation.
[0066] Based on the above embodiments, the IIR filter instantiated by the FPGA module provided in the present application may be any one of a Butterworth filter, a Chebyshev filter, and an elliptic filter.
[0067] In one embodiment of the present application, multiple groups of second input sub-signals are respectively input into the IIR filter to obtain filter output responses corresponding to the multiple groups of second input sub-signals; the filter output responses corresponding to the multiple groups of second input sub-signals are delayed and superimposed to obtain a first output signal.
[0068] Exemplarily, based on inputting multiple groups of second input sub-signals into the IIR filter respectively, output responses corresponding to the multiple groups of second input sub-signals can be obtained, and then the multiple groups of filtered output responses are superimposed to obtain a group of first output signals.
[0069] For example, c(n) and d(n) (i.e., two sets of second input sub-signals) obtained in step 101 are respectively sent to the IIR filter instantiated in the FPGA to obtain two sets of filter output responses y c (n) = {y c L (n),y c L-1 (n),…y c 0 (n)} and y d (n) = {y d L (n),y d L-1 (n),…y d 0 (n)}, and y c (n) and y d (n) Delay superposition obtains a first-order filtering output response e(n) = {y1(0), y1(1),…}.
[0070] In this embodiment, multiple groups of filter output responses are combined into one group of first output signals through delayed superposition, so as to facilitate the subsequent second group filtering, thereby facilitating the realization of strict linearity of phase through two subsequent filtering.
[0071] In step 103, the first output signal is divided into a plurality of groups of third input sub-signals according to a preset length, and the plurality of groups of third input sub-signals are respectively time-inverted to obtain a plurality of groups of fourth input sub-signals.
[0072] Exemplarily, after the input signal is grouped for the first time and read in a time-reversed manner in the above steps 101-102 to obtain the first output signal, the first output signal can be used as the input signal for a second grouping and time-reversed reading, thereby obtaining multiple groups of fourth input sub-signals, so as to subsequently obtain the second output signal.
[0073] In this embodiment, the preset length of 2 may be divided into multiple groups of segments of equal length to obtain multiple groups of third input sub-signals.
[0074] In an optional embodiment, after obtaining multiple groups of equal-length segments of the third input sub-signal, they can be stored in sequence in two cache areas instantiated by the FPGA module to store data and subsequently read data from the two cache areas for timing inversion operations.
[0075] In step 104, a plurality of groups of fourth input sub-signals are input into an IIR filter to obtain a second output signal.
[0076] In an optional embodiment, the first output signal is divided into multiple groups of third input sub-signals according to a preset length, and the multiple groups of third input sub-signals are respectively time-inverted to obtain multiple groups of fourth input sub-signals. The multiple groups of fourth input sub-signals can then be sent to an IIR filter instantiated in the FPGA, and the multiple groups of filtered output responses can be merged into the second output signal through delayed superposition.
[0077] It can be seen that the embodiment of storing the first filtered packets into different cache areas and implementing the timing inversion process in different cache areas can be the same as the embodiment of storing the second filtered packets and the timing inversion process, which will not be repeated here.
[0078] In an optional embodiment, when executing step 104, multiple groups of fourth input sub-signals are input into the same IIR filter to obtain the second output signal.
[0079] Exemplarily, different from the first filtering process, when performing the second filtering, multiple groups of fourth input sub-signals can be input into the same IIR filter to directly obtain the second output signal. This process can make the grouped signals finally merged to output the final second output signal, so that the final output signal completes the filtering.
[0080] The following will be combined with specific embodiments and Figure 2 The present application provides a complete linear phase IIR filter implementation method for exemplary description.
[0081] like Figure 2 As shown, assuming that the input signal is x(n), the output response (i.e., the output signal) is y(n), and both are divided into two groups of equal-length segments of length 2 according to the time sequence, for example, Figure 2 Part A shown in the figure: the input signal x(n) can be divided into two groups of first input sub-signals a(n) and b(n), and the two groups of first input sub-signals a(n) and b(n) are stored in the cache area instantiated by the FPGA module respectively. Then, based on Figure 2 Part B shown: The two groups of first input sub-signals a(n) and b(n) obtained in Part A are respectively input into the IIR filter to finally obtain the first output signal. Figure 2 Parts A and B shown here complete the first filtering of the input signal x(n).
[0082] Then, in Figure 2 Part C shown: The first output signal obtained by the first filtering is used as the input signal of the second filtering, and the grouping and time sequence are reversed to obtain two groups of fourth input sub-signals c(n) and d(n), which are stored in the cache area instantiated by the FPGA module. Then, based on Figure 2Part D shown: Input the two groups of fourth input sub-signals c(n) and d(n) obtained in Part C to the IIR filter, and finally obtain the second output signal y(n). Figure 2 Parts C and D shown here complete the second filtering.
[0083] In conjunction with the specific embodiment, it is assumed that the transfer function of the IIR filter is H(e jw ), the Fourier transform of the input signal is X(e jw ), then the Fourier transform of the signal read after time inversion is U(e jw )=X(e -jw ), the first output signal V(e jw )=X(e -jw )H(e jw ), the signal read after the timing inversion of the first output signal is W(e jw )=X(e jw )H(e -jw ), the second output signal obtained after secondary filtering is Y(e jw )=X(e jw )|H(e jw )| 2 , thus achieving strict phase linearity.
[0084] For the sake of convenience, the following will take a high-pass filter (i.e., IIR filter) that removes a 10 Hz interference signal as an example to provide the technical effect of the linear phase IIR filter implementation method of the present application, and combine FIG. 3 (A), FIG. 3 (B), FIG. 4 (A), FIG. 4 (B), Figure 5 The effect diagram shown is used for explanation:
[0085] Assume that the IIR filter is a third-order Elliptic IIR filter, and the cutoff frequency of the Elliptic IIR filter is 10Hz. As shown in FIG3(A), the amplitude-frequency (magnitude) variation curve of the third-order Elliptic IIR filter involved, the horizontal axis of the amplitude-frequency variation curve is the frequency, and the vertical axis is the amplitude; as shown in FIG3(B), the phase-frequency (phase angle phaseAngle) variation curve of the third-order Elliptic IIR filter involved, the horizontal axis of the phase-frequency variation curve is the frequency, and the vertical axis is the phase.
[0086] It can be seen from Figure 3(A) and Figure 3(B) that although the amplitude-frequency response shown in Figure 3(A) meets the design requirements, the phase nonlinearity shown in Figure 3(B) makes it difficult to apply the third-order Elliptic IIR filter to application scenarios that require phase linearity.
[0087] On the basis of the above embodiment, the collected continuous signal shown in FIG4(A) is used as the input signal, and the input signal is a signal source with 5HZ interference, while FIG4(B) is the second output signal obtained after filtering by the linear phase IIR filter implementation method provided by the present application. From the above, it can be seen that the linear phase IIR filter implementation method provided by the present application can effectively filter out the interference signal in the input signal. At this time, compared with the nonlinear phase characteristic diagram shown in FIG3(B), the phase characteristic diagram of the IIR filter obtained after two timing inversion readings of the present application is as shown in FIG4(B). Figure 5 As shown, the filtering phase changes linearly at this time.
[0088] It can be seen from the above that the linear phase IIR filter implementation method provided by the present application can greatly reduce resource consumption and calculation amount while ensuring the strict linearity of the IIR filter phase, thereby being better suitable for application scenarios with limited resources and strict linear phase requirements.
[0089] It should be understood that, although the various steps in the flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0090] To implement the above linear phase IIR filter implementation method, see Figure 6 An embodiment of the present application provides a linear phase IIR filter implementation device, and the linear phase IIR filter implementation device 600 may include: a first division module 601, a first input module 602, a second division module 603, and a second input module 604.
[0091] Among them, the first division module 601 is used to divide the input signal into multiple groups of first input sub-signals according to a preset length, and respectively time-invert the multiple groups of first input sub-signals to obtain multiple groups of second input sub-signals; the first input module 602 is used to input the multiple groups of second input sub-signals into the infinite impulse response filter IIR to obtain a first output signal; the second division module 603 is used to divide the first output signal into multiple groups of third input sub-signals according to a preset length, and respectively time-invert the multiple groups of second input sub-signals to obtain multiple groups of fourth input sub-signals; the second input module 604 is used to input the multiple groups of fourth input sub-signals into the IIR filter to obtain a second output signal.
[0092] In an optional embodiment of the present application, the first division module 601 is used to divide the input signal into two groups of first input sub-signals of equal length according to a preset length of 2.
[0093] In an optional embodiment of the present application, the first division module 601 is used to store multiple groups of first input sub-signals in different cache areas, and perform time inversion on the first input sub-signals in different cache areas to obtain multiple groups of second input sub-signals.
[0094] In an optional embodiment of the present application, the first input module 602 is used to input multiple groups of second input sub-signals into the IIR filter instantiated by the field programmable gate array FPGA module to obtain a first output signal.
[0095] In an optional embodiment of the present application, the IIR filter instantiated by the FPGA module is any one of Butterworth, Chebyshev, and Elliptic.
[0096] In an optional embodiment of the present application, the first input module 602 is used to input multiple groups of second input sub-signals into the IIR filter respectively to obtain filter output responses corresponding to the multiple groups of second input sub-signals; and delay and superimpose the filter output responses corresponding to the multiple groups of second input sub-signals to obtain the first output signal.
[0097] In an optional embodiment of the present application, the second input module is used to input multiple groups of fourth input sub-signals into the same IIR filter to obtain a second output signal.
[0098] For the specific definition of the above-mentioned linear phase IIR filter implementation device, please refer to the definition of the linear phase IIR filter implementation method above, which will not be repeated here. Each module in the above-mentioned linear phase IIR filter implementation device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0099] In one embodiment, a computer device is provided, the internal structure diagram of which can be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a linear phase IIR filter implementation method as described above is implemented. It includes: a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, any step in the linear phase IIR filter implementation method as described above is implemented.
[0100] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any step in the above linear phase IIR filter implementation method can be implemented.
[0101] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0102] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0103] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0105] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0106] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A linear phase IIR filter implementation method, It is characterized in that include: Dividing the input signal into a plurality of groups of first input sub-signals according to a preset length, and performing time-sequence inversion on the plurality of groups of first input sub-signals respectively, to obtain a plurality of groups of second input sub-signals; Inputting the plurality of groups of second input sub-signals into an infinite impulse response filter IIR respectively to obtain a first output signal; Dividing the first output signal into a plurality of groups of third input sub-signals according to the preset length, and performing time sequence inversion on the plurality of groups of third input sub-signals respectively, to obtain a plurality of groups of fourth input sub-signals; The plurality of groups of fourth input sub-signals are input into an IIR filter to obtain a second output signal.
2. The method for realizing a linear phase IIR filter according to claim 1, It is characterized in that The step of dividing the input signal into a plurality of groups of first input sub-signals according to a preset length comprises: The input signal is divided into two groups of equal-length segments of the first input sub-signals according to a preset length of 2.
3. The method for realizing a linear phase IIR filter according to claim 1, It is characterized in that The step of respectively performing time-sequence inversion on the plurality of groups of first input sub-signals to obtain a plurality of groups of second input sub-signals comprises: The multiple groups of first input sub-signals are stored in different cache areas, and the first input sub-signals are respectively time-inverted in the different cache areas to obtain multiple groups of second input sub-signals.
4. The method for realizing a linear phase IIR filter according to claim 1, It is characterized in that The step of inputting the plurality of groups of second input sub-signals into an infinite impulse response filter IIR to obtain a first output signal comprises: The plurality of groups of second input sub-signals are input into different IIR filters instantiated by a field programmable gate array (FPGA) module to obtain the first output signal.
5. The method for realizing a linear phase IIR filter according to claim 4, It is characterized in that The IIR filter instantiated by the FPGA module is any one of Butterworth, Chebyshev, and Elliptic.
6. The method for realizing a linear phase IIR filter according to any one of claims 1 to 5, It is characterized in that The step of inputting the plurality of groups of second input sub-signals into an infinite impulse response filter IIR to obtain a first output signal comprises: Inputting the plurality of groups of second input sub-signals into different IIR filters respectively, to obtain filtering output responses corresponding to the plurality of groups of second input sub-signals respectively; The filtered output responses corresponding to the plurality of groups of second input sub-signals are delayed and superimposed to obtain the first output signal.
7. The method for realizing a linear phase IIR filter according to claim 1, It is characterized in that The step of inputting the plurality of groups of fourth input sub-signals into an IIR filter to obtain a second output signal comprises: The multiple groups of fourth input sub-signals are input into the same IIR filter to obtain the second output signal.
8. A linear phase IIR filter implementation device, It is characterized in that include: A first division module, configured to divide the input signal into a plurality of groups of first input sub-signals according to a preset length, and respectively perform time sequence inversion on the plurality of groups of first input sub-signals to obtain a plurality of groups of second input sub-signals; A first input module, used for inputting the plurality of groups of second input sub-signals into an infinite impulse response filter IIR to obtain a first output signal; a second division module, configured to divide the first output signal into a plurality of groups of third input sub-signals according to the preset length, and respectively perform time sequence inversion on the plurality of groups of third input sub-signals to obtain a plurality of groups of fourth input sub-signals; The second input module is used to input the multiple groups of fourth input sub-signals into the IIR filter to obtain a second output signal.
9. A computer device, include: The method comprises a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, the steps of the method for realizing the linear phase IIR filter according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method for realizing a linear-phase IIR filter according to any one of claims 1 to 7 are implemented.
