Infinite impulse response filter and data processing method thereof

By introducing shift circuits and error compensation circuits into the digital filter, the hardware complexity and computing speed limitation problems caused by multiplier are solved, and an infinite impulse response filter with small area and high accuracy is realized, ensuring that in complex environments Real-time high-speed signal processing capability.

CN118921039APending Publication Date: 2024-11-083PEAK (SHANGHAI) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411037155.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

Because digital filters contain multipliers, the hardware structure is complex and difficult to implement. The operation characteristics of the multiplier limit the operation speed of the digital filter, making it difficult to realize real-time high-speed signal processing in complex working environments.

Method used

An infinite impulse response (IIR) filter is designed, using shift circuit and error compensation circuit, multiplication weighting is achieved through shift operation equivalent, reducing the area of ​​the filter, and reducing the shift due to the error compensation circuit. The accuracy loss caused by operation ensures high accuracy and rapid convergence of the filter.

Benefits of technology

It realizes an infinite impulse response filter with small area and high accuracy, which can realize real-time high-speed signal processing in complex environments, and improves the output accuracy and convergence performance of the filter.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921039A_ABST
    Figure CN118921039A_ABST
Patent Text Reader

Abstract

The invention provides an infinite impulse response filter and a data processing method thereof, the infinite impulse response filter comprises a shift circuit, an error compensation circuit, a first addition circuit and a feedback path, the feedback path is used for feeding back a part of an output signal of the filter and providing an output feedback signal; the shift circuit equivalently realizes multiplication weighting of a difference signal of an input feedback signal and an output feedback signal relative to a filter coefficient by utilizing shift operation; the error compensation circuit generates a compensation signal according to the range of the difference signal; the first adding circuit adds the weighted signal, the compensation signal and the output feedback signal to generate an output signal. By arranging the residual amplifier in the infinite impulse response filter, the precision loss caused by the shift operation can be reduced, so that the infinite impulse response (IIR) filter has the advantage of small area and can still complete convergence, and the output precision of the filter is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of digital filters, and in particular to an infinite impulse response filter and a data processing method thereof. Background Art

[0002] In recent years, with the development of information science and technology, digital filters have played an increasingly important role in the field of electronic information. Digital filters are widely used in various fields such as graphics processing, electronic communications, aviation, military, and biomedicine due to their high precision, easy integration, and stable performance. Due to the powerful digital signal processing capabilities of digital filters, they play an irreplaceable role in the field of information transmission.

[0003] Digital filters are composed of basic logic components (multipliers, adders, delay devices), which can select the frequency components of the signal, transmit the required frequency band signal, and filter interference noise. However, since digital filters contain multipliers, the hardware structure is complex and difficult to implement. At the same time, the operation characteristics of the multiplier also limit the operation speed of the digital filter. In order to ensure that the digital filter can process the signal in real time and at high speed in a complex working environment, the design of a digital filter without multiplication has become the key to solving the problem. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides an infinite impulse response filter and a data processing method thereof, aiming to realize an infinite impulse response (IIR) filter with small area, accurate convergence and high precision.

[0005] According to a first aspect of the present application, an infinite impulse response filter is provided, comprising:

[0006] A shift circuit, used for performing a shift operation on a difference signal between an input feedback signal and an output feedback signal to obtain a weighted signal of the difference signal relative to a filter coefficient;

[0007] an error compensation circuit, configured to generate a compensation signal according to a range of the difference signal, so as to compensate for a bit truncation error of the shift circuit during a shift operation;

[0008] A first adding circuit, configured to add the weighted signal, the compensation signal and the output feedback signal to generate an output signal;

[0009] A feedback path is used to feed back part of the output signal to provide the output feedback signal.

[0010] Optionally, the bits of the difference signal include a sign bit, a plurality of valid bits retained after the shift operation, and at least one invalid bit discarded after the shift operation.

[0011] Optionally, the error compensation circuit includes:

[0012] The residual amplifier circuit is used to amplify the digital signal corresponding to at least one invalid bit in the difference signal, and generate the compensation signal according to the sign information of the sign bit in the difference signal and the amplification result.

[0013] Optionally, the residual amplification circuit includes a digital comparison unit, and the digital comparison unit is used to compare the magnitude relationship between a digital signal corresponding to at least one invalid bit in the difference signal and a digital signal 0.

[0014] When the digital signal corresponding to the at least one invalid bit is greater than the digital signal 0 and the sign information of the sign bit in the difference signal is positive, d is output as the compensation signal,

[0015] When the digital signal corresponding to the at least one invalid bit is greater than the digital signal 0 and the sign information of the sign bit in the difference signal is negative, -d is output as the compensation signal,

[0016] When the digital signal corresponding to the at least one invalid bit is equal to the digital signal 0, the digital signal 0 is output as the compensation signal,

[0017] Wherein, d is a digital signal greater than or equal to 1.

[0018] Optionally, the residual amplifier circuit is configured to use a step activation function to implement the function of the digital comparison unit.

[0019] Optionally, the infinite impulse response filter further includes:

[0020] A control unit is started to compare the digital signals corresponding to the multiple valid bits in the difference signal with a preset digital signal threshold,

[0021] When the digital signals corresponding to the multiple valid bits in the difference signal are greater than the preset digital signal threshold, an invalid enable signal is output to control the error compensation circuit to be in a shutdown or standby state.

[0022] When the digital signals corresponding to the multiple valid bits in the difference signal are less than or equal to the preset digital signal threshold, a valid enable signal is output to control the error compensation circuit to be in a working state.

[0023] Optionally, the feedback path includes:

[0024] The delay circuit is used to perform delay processing on the output signal to obtain the output feedback signal according to the historical data of the output signal.

[0025] Optionally, the filter coefficient is equal to 2 raised to the jth power, where j is an integer;

[0026] The shift circuit comprises:

[0027] A shifter is used to shift the difference signal to the left by j bits to obtain a weighted signal of the difference signal relative to the filter coefficient.

[0028] Optionally, the filter coefficient is between 2 to the jth power and 2 to the j+1th power, where j is an integer;

[0029] The shift circuit comprises:

[0030] At least one shifter, each of the shifters is used to perform a shift operation on the difference signal;

[0031] The second adder is used to add or subtract the output signal of at least one of the shifters to obtain a weighted signal of the difference signal relative to the filter coefficient.

[0032] Optionally, the infinite impulse response filter further includes:

[0033] A coefficient register for storing filter coefficients of the infinite impulse response filter;

[0034] The control unit is used to adjust the filter coefficients output to the shift circuit to achieve the required filtering function.

[0035] Optionally, the infinite impulse response filter further includes:

[0036] A feedforward path is used to feedforward at least part of an input signal to the infinite impulse response filter to provide the input feedback signal.

[0037] According to a second aspect of the present application, a data processing method of an infinite impulse response filter is provided, comprising:

[0038] Feedback is performed on part of the output signal to provide an output feedback signal;

[0039] Performing a shift operation on a difference signal between an input feedback signal and an output feedback signal to obtain a weighted signal of the difference signal relative to a filter coefficient;

[0040] generating a compensation signal according to the range of the difference signal, wherein the compensation signal is used to compensate for a bit truncation error during a shift operation;

[0041] The weighted signal, the compensation signal and the output feedback signal are added to generate an output signal.

[0042] Optionally, the bits of the difference signal include a sign bit, a plurality of valid bits retained after the shift operation, and at least one invalid bit discarded after the shift operation;

[0043] Generating a compensation signal according to a range of the difference signal includes:

[0044] When the digital signal corresponding to at least one invalid bit in the difference signal is greater than the digital signal 0 and the sign information of the sign bit in the difference signal is positive, output d as the compensation signal;

[0045] When the digital signal corresponding to at least one invalid bit in the difference signal is greater than the digital signal 0 and the sign information of the sign bit in the difference signal is negative, outputting -d as the compensation signal;

[0046] When the digital signal corresponding to at least one invalid bit in the difference signal is equal to the digital signal 0, a digital signal 0 is output as the compensation signal,

[0047] Wherein, d is a digital signal greater than or equal to 1.

[0048] The beneficial effects of this application include at least:

[0049] The embodiment of the present application sets a shift circuit and an error compensation circuit in an infinite impulse response filter. The shift circuit can equivalently realize multiplication weighting through a shift operation. Therefore, based on the advantage of the small area of ​​the shift circuit, the occupied area of ​​the IIR filter can be reduced, and the residual amplifier can generate a compensation signal according to the range of the difference signal between the input feedback signal and the output feedback signal. The compensation signal can be used to compensate for the bit truncation error of the shift circuit during the shift operation, thereby reducing the accuracy loss caused by the shift operation. Compared with the existing solution, the solution of the present application can enable the IIR filter to have the advantage of a small area while still completing convergence, thereby improving the output accuracy of the filter.

[0050] It should be noted that the above general description and the following detailed description are merely exemplary and explanatory and do not limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A schematic diagram showing an application scenario of a digital filter provided according to an embodiment of the present application is shown;

[0052] Figure 2 A data flow diagram showing an IIR filter;

[0053] Figure 3 A data flow diagram showing a first-order IIR filter;

[0054] Figure 4 Show Figure 3 Schematic diagram of the frequency response characteristics of the first-order IIR filter under different filter coefficients;

[0055] Figure 5 Show Figure 3 A schematic diagram of an implementation circuit of a first-order IIR filter;

[0056] Figure 6 Show Figure 3 Another circuit diagram of the first-order IIR filter;

[0057] Figure 7 Show Figure 3 Another circuit diagram of a first-order IIR filter;

[0058] Figure 8 A schematic diagram of an implementation circuit of an IIR filter provided according to a first embodiment of the present application is shown;

[0059] Fig. 9 A schematic diagram of an implementation circuit of an IIR filter provided according to a second embodiment of the present application is shown;

[0060] Fig.10 A schematic diagram of an implementation circuit of an IIR filter provided according to a third embodiment of the present application is shown;

[0061] Fig.11 A schematic diagram of an implementation circuit of an IIR filter provided according to a fourth embodiment of the present application is shown;

[0062] Fig.12a and Figure 12b Schematic diagrams of the bits of the difference signal in each embodiment of the present application are respectively shown;

[0063] Fig.13 A schematic diagram showing the input-output relationship of the error compensation circuit in an embodiment of the present application;

[0064] Fig.14 A flow chart of a data processing method of an IIR filter provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0065] In order to facilitate the understanding of the present application, the present application will be described more comprehensively below with reference to the relevant drawings. The preferred embodiments of the present application are given in the drawings. However, the present application can be implemented in different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive.

[0066] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0067] In the description of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments. "And / or" herein is a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. "Multiple" refers to two or more than two. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, the words "first", "second" and the like are used to distinguish between the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not limit them to be necessarily different.

[0068] In addition, the same figure marks in the figures represent the same or similar structures, and thus their repeated description will be omitted. That is, the various parts in this specification are described in a combination of parallel and progressive manners, and each part focuses on the differences from other parts. The same or similar parts between the various parts can be referenced to each other.

[0069] Digital filters are widely used in many fields, including but not limited to communication systems, audio equipment, image processing, biomedical signal processing, control systems, and instrumentation. For example, in communication systems, digital filters are used to filter out unnecessary frequency components, extract the required signal frequency range, and ensure clear and accurate signal transmission; in audio signal processing, digital filters are used for denoising, equalization, and timbre adjustment to improve audio quality, and are suitable for speakers, headphones, audio and other equipment; in digital cameras, image sensors, and display devices, digital filters are used to remove noise and interference in images and improve image quality; in biomedical signal processing such as electrocardiograms, electroencephalograms, and blood pressure signals, digital filters are used to remove interference and extract the required biological signals; in automatic control systems, digital filters are used to filter out noise, improve system stability and robustness, and ensure control accuracy and reliability; in various instruments and meters, such as oscilloscopes, spectrum analyzers, digital multimeters, etc., digital filters are used for signal processing and data acquisition to improve measurement accuracy and efficiency. Figure 1 As shown, the digital filter 200 performs operations on the digital code of the discrete signal output by the digital unit (such as an analog-to-digital converter) 100 to achieve the purpose of changing the signal spectrum, thereby realizing processing such as signal filtering, detection and parameter estimation.

[0070] Digital filters are divided into two categories: IIR (Infinite Impulse Response) filters and FIR (Finite Impulse Response) filters. In terms of performance, IIR filters can achieve higher frequency selectivity with lower orders, use fewer storage units, and are economical and efficient; FIR filters can only achieve high selectivity with higher orders, which makes the cost higher, and higher orders also lead to greater signal delays.

[0071] Taking the infinite impulse response filter (also referred to as IIR filter in this article) as an example, the transfer function of the IIR filter is:

[0072]

[0073] The difference equation for the IIR filter is:

[0074]

[0075] Among them, x(n) represents the input signal before filtering, y(n) represents the output signal after filtering, and b(i) and a(l) represent the filtering coefficients of the IIR filter respectively.

[0076] The direct type I structure of the IIR filter can be directly obtained from the difference equation of the IIR filter, such as Figure 2 As shown, the left part of the data flow graph is the zero part of the IIR filter, and the right part of the data flow graph is the pole part of the IIR filter.

[0077] For ease of understanding, this article will take a first-order IIR filter as an example to illustrate the present application scheme, but it should be understood that the present application scheme is also applicable to second-order or higher-order IIR filters. Therefore, as long as the scheme conforms to the basic inventive concept of the present application, it falls within the scope of protection required by the present application.

[0078] The data flow diagram of the first-order IIR filter is as follows Figure 3 As shown, assuming that the filter coefficients b0 = k, b1 = 0, a0 = 1, a1 = 1-k, that is, using a filter coefficient k to represent each filter coefficient in the differential equation of the IIR filter, then Figure 3 The transfer function of the IIR filter can be expressed as:

[0079]

[0080] Optionally, in some examples, the value of k includes: 1 / 2, 1 / 4, 1 / 8, 1 / 16, 1 / 32, 1 / 64, and 1 / 128, and Figure 3 The frequency response characteristics of the IIR filter shown in the figure at different positions (i.e., k values) are as follows: Figure 4 As shown, the horizontal axis is frequency and the vertical axis is gain. Figure 4 It can be seen that the cutoff frequencies of the IIR filter when performing low-pass filtering at different k values ​​are approximately 10 Hz, 20 Hz, 39 Hz, 80 Hz, 166 Hz, 360 Hz, and 899 Hz, respectively.

[0081] Taking the value of k equal to 1 / 128 as an example, in an ideal case, the circuit of the IIR filter can be implemented as follows Figure 5 The structure shown. Figure 5 In the example shown, the IIR filter includes: a first multiplier 510, an adder 520, and a feedback path 530, wherein the input end of the first multiplier 510 receives the input signal x(n), the output end of the first multiplier 510 is connected to the first input end of the adder 520, the second input end of the adder 520 is connected to the output end of the feedback path 530, the output end of the adder 520 is connected to the input end of the feedback path 530, and the output end of the adder 520 outputs the output signal y(n). The feedback path 530 further includes a delay circuit 540, a second multiplier 550, and a third multiplier 560.

[0082] Since the circuit area of ​​multipliers 510, 550 and 560 is relatively large, Figure 5The area of ​​the IIR filter shown is also relatively large. Based on this, in an optimization scheme for the IIR filter, for example, the number of multipliers in the IIR filter can be reduced by combining multiplication operations, thereby reducing the area of ​​the IIR filter.

[0083] In the optimized example, Figure 6 As shown, at this time, the IIR filter includes: a first adding circuit 610, a multiplying circuit 620, a second adding circuit 630, and a delay circuit 640 located on the feedback path, wherein the first input end of the first adder 610 receives the input signal x(n) or the input feedback signal, and the second input end of the first adder 610 is connected to the output end of the feedback path to receive the output feedback signal z -1 y(n), the output terminal of the first adder 610 is connected to the input terminal of the multiplier 600 to provide the input signal x(n) (or the input feedback signal) and the output feedback signal z to the multiplier 620 -1 The output terminal of the multiplier 620 is connected to the first input terminal of the second adding circuit 630 to provide the second adding circuit 630 with a weighted signal of the difference signal delta relative to the filter coefficient k, and the second input terminal of the second adding circuit 630 is connected to the output terminal of the feedback path to receive the output feedback signal z -1 y(n), the output terminal of the second adding circuit 630 is connected to the input terminal of the feedback path, and the output terminal of the second adding circuit 630 outputs the output signal y(n).

[0084] exist Figure 6 In the example shown, since the circuit area of ​​the multiplication circuit 620 is still relatively large, in order to further reduce the area of ​​the IIR filter, in a further optimization scheme for the IIR filter, for example, a shift circuit 650 can be used to replace the multiplication circuit 620, and the shift operation of the shift circuit 650 can be used to equivalently implement the multiplication operation, such as Figure 7 As shown. Since the circuit area of ​​the shift circuit 650 is smaller than the circuit area of ​​the multiplication circuit 620, Figure 7 The IIR filter shown is compared to Figure 6 The IIR filter shown has a smaller area.

[0085] exist Figure 7 In the example shown, the IIR filter after using the shift circuit 650 instead of the multiplication circuit 620 has the advantages of small area and low consumption, but the bit truncation operation of the shift circuit 650 during the shift process will cause the decimal part of the shifted signal to be discarded, resulting in partial loss of precision. It can be understood that this loss of precision will cause the IIR filter to fail to converge. For example, when the input signal x(n) is 65535, the output feedback signal z -1When y(n) is 65534 and the difference signal delta is equal to 1, the weighted signal kdelta after the shift operation will be constant to 0. In the next addition operation, the feedback signal z is output. - 1 The output signal y(n) obtained by adding y(n) to the weighted signal kdelta is 65534, which can never converge to 65535 of the input signal x(n).

[0086] To solve Figure 7 The problem that the IIR filter shown cannot converge is solved by the implementation scheme of the present application. Figure 7 The IIR filter shown has been further optimized, see Figures 8 to 11 As shown in the various implementation schematics, the implementation scheme of the present application amplifies the decimal part of the difference signal discarded due to the shift operation by adding an error compensation circuit in the IIR filter, so that the discarded decimal part can still participate in the subsequent operations of the system after amplification, thereby enabling the IIR filter to complete convergence.

[0087] The following also takes a first-order IIR filter as an example to illustrate the structure and data processing method of the IIR filter shown in each embodiment of the present application. It should be noted that the embodiments listed in this article are only used as exemplary descriptions of the scheme of the present application. In some other embodiments, the scheme of the present application is also applicable to multi-order IIR filters of second order or higher. Therefore, as long as the scheme conforms to the basic inventive concept of the present application, it belongs to the scope of protection claimed by the present application.

[0088] exist Figure 8 In the example shown, the infinite impulse response filter (i.e., IIR filter) includes: a first adding circuit 610, a shifting circuit 650, an error compensation circuit 660, a second adding circuit 630, and a feedback path. The first input terminal of the first adder 610 receives an input signal x(n) or an input feedback signal, and the second input terminal of the first adder 610 is connected to the output terminal of the feedback path to receive the output feedback signal z -1 y(n), the output end of the first adder 610 is connected to the input end of the shift circuit 650, the output end of the shift circuit 650 is connected to the first input end of the second adder circuit 630, and the second input end of the second adder circuit 630 is connected to the output end of the feedback path to receive the output feedback signal z -1 y(n), the output end of the second adding circuit 630 is connected to the input end of the feedback path, and the output end of the second adding circuit 630 outputs the output signal y(n). It can be understood that in this first-order IIR filter, the input feedback signal is equal to the input signal x(n).

[0089] In this embodiment, the first adding circuit 610 is used to receive the input signal x(n) (or the input feedback signal) and output the feedback signal z -1 y(n) is subjected to a difference operation to provide the input signal x(n) (or the input feedback signal) and the output feedback signal z to the shift circuit 650. -1 The shift circuit 650 is used to perform a shift operation on the difference signal delta to obtain a weighted signal kdelta of the difference signal delta relative to the filter coefficient (recorded as k, where k is an integer). The error compensation circuit 660 is used to generate a compensation signal accu according to the range of the difference signal delta and provide it to the second adder 630 to compensate for the bit truncation error of the shift circuit 650 during the shift operation. The second adder circuit 630 is used to perform a shift operation on the weighted signal kdelta, the compensation signal accu and the output feedback signal z -1 y(n) is added to generate the output signal y(n). The feedback path is used to feed back part of the output signal y(n) to provide an output feedback signal z -1 y(n).

[0090] In some optional examples, the feedback path includes a delay circuit 640, which is used to delay the output signal y(n) to obtain an output feedback signal z according to the historical data of the output signal. -1 y(n).

[0091] The shift operation performed by the shift circuit 650 on the difference signal delta includes a carry operation or a borrow operation. For a binary digital signal, a carry operation (such as left shift) performed on it can be equivalent to a multiplication operation of 2 to a positive integer power, and a borrow operation (such as right shift) performed on it can be equivalent to a multiplication operation of 2 to a negative integer power.

[0092] Based on this principle, in some examples, when the filter coefficient k of the IIR filter is equal to 2 raised to the jth power (j is an integer), the shift circuit 650 includes a shifter, which shifts the difference signal delta to the left by j bits to obtain a weighted signal kdelta of the difference signal delta relative to the filter coefficient k. For example, when k is equal to 1 / 128, j=log2(1 / 128)=-7 can be obtained by calculation. At this time, only the shifter can be set or started to realize the weighted signal kdelta of the difference signal delta relative to the filter coefficient k=1 / 128 by shifting the difference signal delta to the left by -7 bits (equivalent to shifting it to the right by 7 bits).

[0093] In other examples, when the filter coefficient k of the IIR filter is not equal to 2 to the jth power, such as when the filter coefficient k is between 2 to the jth power and 2 to the j+1th power, the shift circuit 650 includes at least one shifter and an adder, each shifter being used to shift the difference signal delta to the same or different degrees, and the adder being used to add or subtract the output signal of at least one shifter to obtain a weighted signal delta of the difference signal delta relative to the filter coefficient k. For example, when k is equal to 3 / 128, it can be calculated that log2(3 / 128) is greater than 1 / 128 but less than 1 / 32. At this time, a shifter can be set to shift the difference signal delta to the left by -5 bits (equivalent to shifting it to the right by 5 bits), and another shifter can be set to shift the difference signal delta to the left by -7 bits (equivalent to shifting it to the right by 7 bits). Then, the output signals of the two shifters are subtracted to achieve a weighted signal kdelta of the difference signal delta relative to the filter coefficient k=3 / 128.

[0094] In this embodiment, the difference signal delta output by the first adding circuit 610 is a digital signal, and the bits of the difference signal delta include a sign bit, a plurality of valid bits retained after the shift operation, and at least one invalid bit discarded after the shift operation.

[0095] In some examples, such as Fig.12a As shown, when the shift circuit 650 is set to perform a right shift operation on the difference signal delta, the bits of the difference signal delta are a sign bit, a valid bit, and an invalid bit from left to right. For example, assuming that the difference signal delta is a 16-bit digital signal, and the filter coefficient k is equal to 1 / 128, that is, j is equal to -3, then the first bit of the difference signal delta from the left is the sign bit, the second to the thirteenth bits from the left are valid bits, and the fourteenth to the sixteenth bits from the left are valid bits.

[0096] In other examples, such as Figure 12b As shown, when the shift circuit 650 is set to perform a left shift operation on the difference signal delta, the bits of the difference signal delta are a sign bit, an invalid bit and a valid bit from left to right. For example, assuming that the difference signal delta is a 16-bit digital signal, and the filter coefficient k is equal to 1 / 128, that is, j is equal to -3, then the first bit of the difference signal delta from the left is the sign bit, the second to fourth bits from the left are valid bits, and the fifth to sixteenth bits from the left are valid bits.

[0097] In this embodiment, the error compensation circuit 660 includes a residual amplifier circuit, which is used to amplify a digital signal corresponding to at least one invalid bit in the difference signal delta, and generate a compensation signal accu according to the sign information of the sign bit in the difference signal delta and the amplification result.

[0098] In a specific implementation, the residual amplifier circuit includes a digital comparison unit, which is used to compare the magnitude relationship between the digital signal corresponding to at least one invalid bit in the difference signal delta and the digital signal 0, and output d as the compensation signal accu when the digital signal corresponding to the at least one invalid bit is greater than the digital signal 0 and the sign information of the sign bit in the difference signal delta is positive, or output -d as the compensation signal accu when the digital signal corresponding to the at least one invalid bit is greater than the digital signal 0 and the sign information of the sign bit in the difference signal delta is negative, or output digital signal 0 as the compensation signal accu when the digital signal corresponding to the at least one invalid bit is equal to the digital signal 0, wherein d is a digital signal greater than or equal to 1, and is preferably 1, such as Fig.13 shown.

[0099] For example, assuming that the shift circuit 650 is set to right-shift the difference signal delta by 7 bits to realize a weighted signal of the difference signal delta relative to the filter coefficient 1 / 128, if within a certain clock cycle, the error compensation circuit 660 detects that the digital signal corresponding to the invalid bit of the difference signal delta is not 0000000, and the sign bit of the difference signal delta is a digital signal 0, then the error compensation circuit 660 outputs a digital signal 1 to the second adding circuit 630 as the compensation signal accu; if within a certain clock cycle, the error When the compensation circuit 660 detects that the digital signal corresponding to the invalid bit of the difference signal delta is not 0000000, and the sign bit of the difference signal delta is the digital signal 1, the error compensation circuit 660 outputs a digital signal -1 as the compensation signal accu to the second adding circuit 630; if within a certain clock cycle, the error compensation circuit 660 detects that the digital signal corresponding to the invalid bit of the difference signal delta is 0000000, the error compensation circuit 660 outputs a digital signal 0 as the compensation signal accu to the second adding circuit 630.

[0100] In some examples, the residual amplifier circuit is configured to implement the function of the digital comparison unit using a step activation function.

[0101] It can be understood that the IIR filter provided in this embodiment can filter the input signal x(n) based on the filter coefficient k, and the output signal y(n) can gradually approach the input signal x(n) based on the recursive accumulation of the difference signal delta relative to the weighted signal kdelta of the filter coefficient k. In the recursive process of the IIR filter, the present embodiment also introduces an error compensation circuit 660 to generate a corresponding compensation signal accu following the change of the difference signal delta, so as to compensate for the truncated value in the shift operation, so that the IIR filter can achieve rapid convergence. For example, when the input signal x(n) is 65535, the output feedback signal z -1 When y(n) is 65534 and the difference signal delta is equal to 1, the weighted signal kdelta after the shift operation will be constant at 0, but the compensation signal accu output by the error compensation circuit 660 is 1. In the next addition operation, the feedback signal z is output. -1 After y(n) is added to the weighted signal kdelta and the compensation signal accu, the output signal y(n) can be equal to 65535, achieving rapid convergence of the output signal y(n) to the input signal x(n). Compared with the existing related schemes, the object of compensation in the scheme of this embodiment is the shifted weighted signal kdelta, and before compensation, the scheme of this embodiment also introduces the sign information of the difference signal delta, which is convenient for positive or negative compensation, and the compensation precision and accuracy are higher.

[0102] In addition, the solution of this embodiment only introduces one digital comparison unit to achieve corresponding error or precision compensation, so that the optimized IIR filter can still maintain the advantages of simple structure and small area.

[0103] Embodiment 2

[0104] The implementation structure of the IIR filter disclosed in this embodiment is as follows: Fig. 9 shown.

[0105] Specifically, the IIR filter provided in this embodiment basically adopts the same structure as that of the above-mentioned embodiment 1, so the similarities are not repeated here.

[0106] The difference is that: in this embodiment, the IIR filter further includes a startup control unit 670. The startup control unit 670 is used to compare the digital signals corresponding to the multiple valid bits in the difference signal delta with the preset digital signal threshold, and output an invalid enable signal when the digital signals corresponding to the multiple valid bits in the difference signal delta are greater than the preset digital signal threshold, and control the error compensation circuit 660 to be in a shutdown or standby state, and output a valid enable signal when the digital signals corresponding to the multiple valid bits in the difference signal delta are less than or equal to the preset digital signal threshold, and control the error compensation circuit 660 to be in a working state.

[0107] In some examples, the preset digital signal threshold is preferably a digital signal of 0. Of course, in other examples, the preset digital signal threshold may also be selected as other values.

[0108] Exemplarily, taking the preset digital signal threshold as the digital signal 0 as an example, in the recursive process of the IIR filter, if within a certain clock cycle, the start control unit 670 detects that the digital signal corresponding to the valid bit of the difference signal delta before the shift operation is not a digital signal of all 0s, that is, it is greater than the preset digital signal threshold, then an invalid enable signal is generated to control the error compensation circuit 660 to be in a non-working state such as shutdown or standby; if within a certain clock cycle, the start control unit 670 detects that the digital signal corresponding to the valid bit of the difference signal delta before the shift operation is a digital signal of all 0s, that is, it is equal to the preset digital signal threshold, then a valid enable signal is generated to control the error compensation circuit 660 to be in a working state, so as to generate a corresponding compensation signal accu according to the information of the sign bit and at least one invalid bit in the difference signal delta.

[0109] That is to say, in this embodiment, the error compensation circuit 660 is controlled to work only when the output signal y(n) of the IIR filter is close to converging to the input signal x(n), and the error compensation circuit 660 is controlled not to work when the difference between the input signal x(n) and the output signal y(n) of the IIR filter is large, thereby ensuring that the output signal y(n) of the IIR filter will not converge too quickly, which not only ensures that the filter can have a better filtering effect, but also helps to reduce the power consumption of the filter.

[0110] Embodiment 3

[0111] The implementation structure of the IIR filter disclosed in this embodiment is as follows: Fig.10 shown.

[0112] Specifically, the IIR filter provided in this embodiment basically adopts the same structure as the above-mentioned embodiment 1 or embodiment 2, so the similarities are not repeated here.

[0113] The difference is that in this embodiment, the IIR filter further includes a feedforward path 680, and the feedforward path 680 is used to feedforward at least part of the input signal x(n) to provide an input feedback signal.

[0114] It can be understood that by setting the feedforward path 680, the IIR filter can simultaneously realize feedforward of the input signal x(n) and feedback of the output signal y(n) during filtering, thereby facilitating better implementation of the filtering functions corresponding to various differential equations and achieving better filtering effects.

[0115] Embodiment 4

[0116] The implementation structure of the IIR filter disclosed in this embodiment is as follows: Fig.11 shown.

[0117] Specifically, the IIR filter provided in this embodiment basically adopts the same structure as any one of the above-mentioned embodiments 1 to 3, so the similarities are not repeated here.

[0118] The difference is that in this embodiment, the IIR filter further includes a control unit 691 and a coefficient register 692, wherein the coefficient register 692 is used to store the filter coefficient k of the IIR filter. The control unit 691 is used to adjust the filter coefficient k output to the shift circuit 650 to configure the IIR filter to achieve the required filtering function.

[0119] It can be understood that by introducing the control unit 691 and the coefficient register 692 to adjust the filter coefficient k of the IIR filter, the IIR filter can realize a variety of different filtering functions, improve the functional diversity of the IIR filter, and make the IIR filter more widely applicable.

[0120] Furthermore, the present application also provides a data processing method for an infinite impulse response filter, which can be applied to the IIR filter described in the above embodiments of this document. Fig.14 As shown, the data processing method includes executing the following steps:

[0121] In step 141, part of the output signal is fed back to provide an output feedback signal.

[0122] In step 142, a shift operation is performed on the difference signal between the input feedback signal and the output feedback signal to obtain a weighted signal of the difference signal relative to the filter coefficient.

[0123] In step 143, a compensation signal is generated according to the range of the difference signal, and the compensation signal is used to compensate for the bit truncation error in the shift operation.

[0124] In step 144, the weighted signal, the compensation signal and the output feedback signal are added to generate an output signal.

[0125] In this embodiment, the bit positions of the difference signal include a sign bit, a plurality of valid bits retained after the shift operation, and at least one invalid bit discarded after the shift operation. On this basis, step 143 further includes: outputting d as a compensation signal when the digital signal corresponding to at least one invalid bit in the difference signal is greater than the digital signal 0 and the sign information of the sign bit in the difference signal is positive; outputting -d as a compensation signal when the digital signal corresponding to at least one invalid bit in the difference signal is greater than the digital signal 0 and the sign information of the sign bit in the difference signal is negative; and outputting digital signal 0 as a compensation signal when the digital signal corresponding to at least one invalid bit in the difference signal is equal to the digital signal 0, wherein d is a digital signal greater than or equal to 1, and preferably 1.

[0126] In specific implementation, the specific implementation of each step in the data processing method of the infinite impulse response filter described above and the beneficial effects that can be achieved can be found in the aforementioned embodiments of the infinite impulse response filter, which will not be described in detail here.

[0127] In summary, the embodiment of the present application sets a shift circuit and an error compensation circuit in the infinite impulse response filter. The shift circuit can equivalently realize multiplication weighting through a shift operation. Therefore, based on the advantage of the small area of ​​the shift circuit, the occupied area of ​​the IIR filter can be reduced, and the residual amplifier can generate a compensation signal according to the range of the difference signal between the input feedback signal and the output feedback signal. The compensation signal can be used to compensate for the bit truncation error of the shift circuit during the shift operation, thereby reducing the accuracy loss caused by the shift operation. Compared with the existing solution, the solution of the present application can enable the IIR filter to have the advantage of a small area while still completing convergence, thereby improving the output accuracy of the filter.

[0128] Finally, it should be noted that: Obviously, the above embodiments are only examples for clearly explaining the present application, and are not intended to limit the implementation methods. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from this are still within the scope of protection of the present application.

Claims

1. An infinite impulse response filter, include: A shift circuit, used for performing a shift operation on a difference signal between an input feedback signal and an output feedback signal to obtain a weighted signal of the difference signal relative to a filter coefficient; an error compensation circuit, configured to generate a compensation signal according to a range of the difference signal, so as to compensate for a bit truncation error of the shift circuit during a shift operation; A first adding circuit, configured to add the weighted signal, the compensation signal and the output feedback signal to generate an output signal; A feedback path is used to feed back part of the output signal to provide the output feedback signal.

2. The infinite impulse response filter according to claim 1, in, The bits of the difference signal include a sign bit, a plurality of valid bits retained after the shift operation, and at least one invalid bit discarded after the shift operation.

3. The infinite impulse response filter according to claim 2, in, The error compensation circuit comprises: The residual amplifier circuit is used to amplify the digital signal corresponding to at least one invalid bit in the difference signal, and generate the compensation signal according to the sign information of the sign bit in the difference signal and the amplification result.

4. The infinite impulse response filter according to claim 3, in, The residual amplification circuit includes a digital comparison unit, which is used to compare the magnitude relationship between the digital signal corresponding to at least one invalid bit in the difference signal and the digital signal 0. When the digital signal corresponding to the at least one invalid bit is greater than the digital signal 0 and the sign information of the sign bit in the difference signal is positive, d is output as the compensation signal, When the digital signal corresponding to the at least one invalid bit is greater than the digital signal 0 and the sign information of the sign bit in the difference signal is negative, -d is output as the compensation signal, When the digital signal corresponding to the at least one invalid bit is equal to the digital signal 0, the digital signal 0 is output as the compensation signal, Wherein, d is a digital signal greater than or equal to 1.

5. The infinite impulse response filter according to claim 4, in, The residual amplifier circuit is configured to use a step activation function to implement the function of the digital comparison unit.

6. An infinite impulse response filter according to any one of claims 3 to 5, in, The infinite impulse response filter further comprises: A control unit is started to compare the digital signals corresponding to the multiple valid bits in the difference signal with a preset digital signal threshold, When the digital signals corresponding to the multiple valid bits in the difference signal are greater than the preset digital signal threshold, an invalid enable signal is output to control the error compensation circuit to be in a shutdown or standby state. When the digital signals corresponding to the multiple valid bits in the difference signal are less than or equal to the preset digital signal threshold, a valid enable signal is output to control the error compensation circuit to be in a working state.

7. The infinite impulse response filter according to claim 1, in, The feedback path includes: The delay circuit is used to perform delay processing on the output signal to obtain the output feedback signal according to the historical data of the output signal.

8. The infinite impulse response filter according to claim 1, in, The filter coefficient is equal to 2 raised to the jth power, where j is an integer; The shift circuit comprises: A shifter is used to shift the difference signal to the left by j bits to obtain a weighted signal of the difference signal relative to the filter coefficient.

9. The infinite impulse response filter according to claim 1, in, The filter coefficient is between 2 to the jth power and 2 to the j+1th power, where j is an integer; The shift circuit comprises: At least one shifter, each of the shifters is used to perform a shift operation on the difference signal; The second adder is used to add or subtract the output signal of at least one of the shifters to obtain a weighted signal of the difference signal relative to the filter coefficient.

10. An infinite impulse response filter according to any one of claims 1, 8 and 9, in, The infinite impulse response filter further comprises: A coefficient register for storing filter coefficients of the infinite impulse response filter; The control unit is used to adjust the filter coefficients output to the shift circuit to achieve the required filtering function.

11. The infinite impulse response filter according to claim 1, in, The infinite impulse response filter further comprises: A feedforward path is used to feedforward at least part of an input signal to the infinite impulse response filter to provide the input feedback signal.

12. A data processing method for an infinite impulse response filter, include: Feedback is performed on part of the output signal to provide an output feedback signal; Performing a shift operation on a difference signal between an input feedback signal and an output feedback signal to obtain a weighted signal of the difference signal relative to a filter coefficient; generating a compensation signal according to the range of the difference signal, wherein the compensation signal is used to compensate for a bit truncation error during a shift operation; The weighted signal, the compensation signal and the output feedback signal are added to generate an output signal.

13. The data processing method according to claim 12, in, The bit positions of the difference signal include a sign bit, a plurality of valid bits retained after the shift operation, and at least one invalid bit discarded after the shift operation; Generating a compensation signal according to a range of the difference signal includes: When the digital signal corresponding to at least one invalid bit in the difference signal is greater than the digital signal 0 and the sign information of the sign bit in the difference signal is positive, output d as the compensation signal; When the digital signal corresponding to at least one invalid bit in the difference signal is greater than the digital signal 0 and the sign information of the sign bit in the difference signal is negative, outputting -d as the compensation signal; When the digital signal corresponding to at least one invalid bit in the difference signal is equal to the digital signal 0, a digital signal 0 is output as the compensation signal, Wherein, d is a digital signal greater than or equal to 1.