First-order high-pass IIR filter and design method thereof
By performing fixed-point quantization on the quantization coefficients δ of the first-order high-pass IIR filter, the quantization error problem caused by the filter coefficients being close to ±1 at low cutoff frequencies is solved, reducing hardware resource requirements and improving the stability and efficiency of the filter.
Patent Information
- Application Number
- CN202511349919.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2026-01-23
AI Technical Summary
Traditional first-order high-pass IIR filters suffer from significant quantization errors due to fixed-point quantization of filter coefficients close to ±1 at low cutoff frequencies, leading to functional abnormalities. Existing technologies have increased hardware resource requirements to address this issue.
Instead of directly quantizing the filter coefficients b0, b1, and a1, fixed-point quantization is used for the quantization coefficient δ. The quantization error is reduced by calculating ytfix=[δfix*(xtfix+xt-1fix–2*yt-1fix)+0.5fix]>>N+(xtfix-xt-1fix+yt-1fix).
It significantly reduces the quantization error of near ±1 filter coefficients, reduces hardware resource requirements, and improves the stability and efficiency of the filter.
Smart Images

Figure SMS_1
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of filter, in particular to a first-order high-pass IIR (Infinite Impulse Response) filter and a design method thereof.
BACKGROUND
[0002] The calculation formula of a conventional first-order high-pass IIR filter is: y t = b 0* x t + b 1* x t-1 - a 1* y t-1 , wherein b0, b1, a1 are filter coefficients, x t is input data at time t, x t is input data at time t-1 buffered in the filter, and y t-1 is output data at time t-1 buffered in the filter. With Matlab or other tools, the filter coefficients b0, b1, a1 can be calculated according to a target cutoff frequency. However, when the cutoff frequency of the first-order high-pass IIR filter is extremely low, each filter coefficient is close to ±1. In order to reduce hardware overhead and power consumption, the filter usually adopts fixed-point arithmetic rather than floating-point arithmetic. When the coefficients close to ±1 are quantized in fixed-point, a slight change in the coefficient value will be amplified sharply due to quantization error, causing abnormal function of the filter.
[0003] To solve the above-mentioned quantization error problem, the prior art usually adopts the following improvement scheme: using a floating-point multiplier or increasing the filter coefficients or the data bit width of the operation. Either way will significantly increase the hardware resource requirement of the filter.
SUMMARY
[0004] To solve the above-mentioned technical problems or at least partially solve the above-mentioned technical problems, embodiments of the present application provide a first-order high-pass IIR filter and a design method thereof.
[0005] According to one aspect of the present application, embodiments of the present application provide a first-order high-pass IIR filter, and the calculation formula thereof is: y t fix = [δ fix *(x t fix + x t-1 fix - 2*y t-1 fix ) + 0.5 fix ] >> N + (x t fix - x t-1fix +y t-1 fix ), where x t fix For x t The input data after fixed-point quantization, x t Let x be the input data at time t. t-1 fix For x t-1 The input data after fixed-point quantization, x t-1 The input data at time t-1 is buffered within the first-order high-pass IIR filter, y t-1 fix For y t-1 The input data after fixed-point quantization, y t-1 y is the output data at time t-1 that is internally buffered by a first-order high-pass IIR filter. t fix For y t The output data after fixed-point quantization, y t This represents the output data of a first-order high-pass IIR filter at time t, 0.5 fix This is the integer after 0.5 fixed-point quantization, >> indicates right shift, δ fix =round(δ*2) N N is the equivalent precision bit width of δ, and the quantization factor is 1 / 2. N , δ=d / (1+d), where d=(ω c T) / 2, where ω c Where ω is the cutoff angular frequency, and T is the sampling period.
[0006] According to another aspect of the present invention, embodiments of the present invention provide a design method for a first-order high-pass IIR filter, wherein the calculation formula for the first-order high-pass IIR filter is: y t fix =[δ fix *(x t fix +x t-1 fix –2*y t-1 fix )+0.5 fix >>N+(x t fix -x t-1 fix +y t-1 fix ), where x t fix For x t The input data after fixed-point quantization, x t Let x be the input data at time t. t-1 fix For xt-1 quantized input data, x t-1 input data at time t-1 buffered internally by the first-order high-pass IIR filter, y t-1 fix quantized input data, y t-1 quantized input data, y t-1 output data at time t-1 buffered internally by the first-order high-pass IIR filter, y t fix quantized input data, y t quantized output data, y t output data at time t by the first-order high-pass IIR filter, 0.5 fix quantized integer of 0.5, >> represents right shift, δ fix = round(δ*2 N ), N is the equivalent precision bit width of δ, the quantization coefficient is 1 / 2 N , δ = d / (1+d), wherein d = (ω c T) / 2, wherein ω c is the cutoff angular frequency, and T is the sampling period.
[0007] Compared with the prior art, the first-order high-pass IIR filter is not directly quantized by using filter coefficients b0, b1 and a1, but is quantized by using δ, so that the quantization error introduced when each filter coefficient close to ±1 is quantized is significantly reduced. DETAILED DESCRIPTION
[0008] In order to make the above-mentioned objects, features and advantages of the present application more apparent, the present application will be further described in detail below with specific embodiments.
[0009] The term "one embodiment" or "an embodiment" as used herein means that a particular feature, structure, or characteristic described can be included in at least one implementation of the present application. The appearances of the phrase "in one embodiment" or "in an embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily all referring to a single, alternative embodiment, or a single implementation.
[0010] The present application provides a design method of a first-order high-pass IIR filter, which does not directly quantize filter coefficients b0, b1 and a1, but quantizes δ, so that the quantization error introduced when each filter coefficient close to ±1 is quantized is significantly reduced.
[0011] The calculation formula of a conventional first-order high-pass IIR filter is: y t = b 0* x t + b 1* x t-1 -a 1*y t-1 ( Formula 1 ), wherein b0, b1, a1 are filter coefficients, x t is input data at time t, x t is input data at time t-1 buffered inside the filter, y t-1 is output data at time t-1 buffered inside the filter. With Matlab or other tools, filter coefficients b0, b1, a1 can be calculated according to target cut-off frequency.
[0012] The filter coefficients b0, b1, a1 are respectively:
[0013]
[0014] Another δ = d / (1 + d), and the above formula is arranged: b0 = 1 + δ, b1 = -1 + δ, a1 = -1 + 2 * δ.
[0015] When the cut-off frequency is extremely low, δ is a small amount close to 0. d = (ω c T) / 2, wherein ω c is the cut-off angular frequency, and T is the sampling period.
[0016] In this way, the calculation formula 1 of the first-order high-pass IIR filter can be arranged as:
[0017] y t = (1 + δ) * x t + (-1 + δ) * x t-1 - (-1 + 2 * δ) * y t-1 ( Formula 2 )
[0018] Further transformation of formula 2 can obtain:
[0019] y t = ( δ * x t + δ * x t-1 - 2 * δ * y t-1 ) + ( x t - x t-1 + y t-1 ) ( Formula 3 ).
[0020] In actual hardware, fixed-point quantization is performed on formula 3, and the calculation formula of the first-order high-pass IIR filter can be converted to: y t fix = [ δ fix * ( x t fix + x t-1fix –2*y t-1 fix )+0.5 fix ]>>N+(x t fix -x t-1 fix +y t-1 fix )(Formula 4).
[0021] Where x t fix For x t The input data after fixed-point quantization, x t Let x be the input data at time t. t-1 fix For x t-1 The input data after fixed-point quantization, x t-1 The input data at time t-1 is buffered within the first-order high-pass IIR filter, y t-1 fix For y t-1 The input data after fixed-point quantization, y t-1 y is the output data at time t-1 buffered internally by a first-order high-pass IIR filter. t fix For y t The output data after fixed-point quantization, y t This represents the output data of a first-order high-pass IIR filter at time t, 0.5 fix This is the integer after 0.5 fixed-point quantization; >> indicates a right shift.
[0022] In one embodiment, δ fix =round(δ*2) N ), round is the floor function, δ fix Let δ be the fixed-point quantized value, N be the equivalent precision bit width of δ, and the quantization coefficient be 1 / 2. N N is a natural number greater than or equal to 1.
[0023] The value of N is crucial for the quantization of δ. In one embodiment, N is a quantization condition that satisfies (1 / 2...). N The smallest integer value of <δ / 2).
[0024] The choice of δ value also has a significant impact on quantization error. In one embodiment, the minimum value of δ can be calculated using tools such as MATLAB, based on the cutoff frequency range of the first-order high-pass IIR filter (when designing a filter, the cutoff frequency range is a frequency range centered on the target cutoff frequency) and the sampling frequency, thereby allowing the calculation of the range of filter coefficient values.
[0025] In another alternative embodiment, delta can also be calculated as follows: for a target cutoff frequency f c , a certain number (such as 10000, 9000, etc.) of candidate cutoff frequencies are uniformly sampled in a cutoff frequency range centered at the target cutoff frequency, and the absolute value of the quantization error of delta corresponding to each candidate cutoff frequency is calculated: coeff_quant_err = |delta - delta fix / 2 N , the delta with the minimum quantization error is selected, wherein the cutoff frequency range is [f c - Δ, f c + Δ], and Δ is a predetermined frequency value, ω c = 2πf c . By screening the delta with the minimum quantization error, the quantization error of the system can be reduced.
[0026] In one embodiment, y t-1 fix , x t fix , and x t-1 each contain i integer bits and e fractional bits, wherein x t fix , and x t-1 have e fractional bits of 0, y t-1 fix has e fractional bits not equal to 0, and 0.5 fix includes e fractional bits, wherein i and e are positive integers, such as i = 16 and e = 8.
[0027] Before being right-shifted by N bits, 0.5 fix is additionally added to prevent numerical drift caused by rounding operations.
[0028] According to another aspect of the present application, the present application provides a first-order high-pass IIR filter, which does not directly perform fixed-point quantization on filter coefficients b0, b1, and a1, but performs fixed-point quantization on delta, thereby significantly reducing quantization errors introduced when each filter coefficient close to ±1 is quantized.
[0029] The calculation formula of the first-order high-pass IIR filter is:
[0030] y t fix = [delta fix *(x t fix + x t-1 fix - 2*y t-1 fix ) + 0.5 fix ] » N + (x tfix - x t-1 fix + y t-1 fix ( Formula 4 ).
[0031] where x t fix is the input data after fixed-point quantization, x t is the input data at time t, x t t-1 fix is the input data after fixed-point quantization, x t-1 is the input data at time t, x t-1 t-1 fix is the input data after fixed-point quantization, y t-1 is the input data at time t, y t-1 t fix is the output data after fixed-point quantization, y t is the output data at time t, y t fix is the output data at time t, 0.5 fix is an integer after fixed-point quantization of 0.5, and >> represents right shift.
[0032] In one embodiment, δ fix = round ( δ * 2 N ), where round is a rounding function, δ fix is the δ after fixed-point quantization, N is the equivalent precision bit width of δ, the quantization coefficient is 1 / 2 N , and N is a natural number greater than or equal to 1.
[0033] The value of N is very important for the quantization of δ. In one embodiment, N is the smallest integer value that satisfies (1 / 2 N < δ / 2 ).
[0034] The selection of the value of δ also has a great influence on the quantization error. In one embodiment, the numerical range of the filter coefficient can be calculated according to the cutoff frequency range (the cutoff frequency range is a frequency range centered on the target cutoff frequency when designing the filter) and the sampling frequency of the first-order high-pass IIR filter by using tools such as matlab, and then the minimum value of δ can be calculated.
[0035] In another alternative embodiment, δ can also be calculated as follows: for the target cutoff frequency f c In a range of cutoff frequencies centered on the target cutoff frequency, a certain number (such as 10000, 9000, etc.) of candidate cutoff frequencies are uniformly sampled, and the absolute value of the quantization error of each candidate cutoff frequency corresponding to δ is calculated: coeff_quant_err = |δ-δ fix / 2 N |, and the δ with the minimum quantization error is selected, wherein the range of cutoff frequencies is [f c -Δ, f c +Δ], and Δ is a predetermined frequency value, ω c = 2πf c . By screening the δ with the minimum quantization error, the quantization error of the system can be reduced.
[0036] In one embodiment, y t-1 fix , x t fix , and x t-1 each contain i-bit integer bits and e-bit decimal bits, wherein x t fix and x t-1 each have 0 e-bit decimal bits, y t-1 fix has e-bit decimal bits that are not 0, and 0.5 fix includes e-bit decimal bits, wherein i and e are positive integers, such as i = 16 and e = 8.
[0037] Before being right-shifted by N bits, 0.5 fix is additionally added to prevent numerical drift caused by rounding operations.
[0038] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, a person skilled in the art can combine and combine different embodiments or examples described in the present specification.
[0039] Although the embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications and variations to the above embodiments within the scope of the present application.
Claims
1. A first-order high-pass IIR filter, characterized in that, The calculation formula is as follows: and t fix =[δ fix *(x t fix +x t-1 fix –2*y t-1 fix )+0.5 fix ]>>N+(x t fix -x t-1 fix +and t-1 fix ), Where x t fix For x t The input data after fixed-point quantization, x t Let x be the input data at time t. t-1 fix For x t-1 The input data after fixed-point quantization, x t-1 The input data at time t-1 is buffered internally by a first-order high-pass IIR filter, y t-1 fix For y t-1 The input data after fixed-point quantization, y t-1 y is the output data at time t-1 that is internally buffered by a first-order high-pass IIR filter. t fix For y t The output data after fixed-point quantization, y t This represents the output data of a first-order high-pass IIR filter at time t, 0.5 fix This is the integer after 0.5 fixed-point quantization; >> indicates a right shift. δ fix =round(δ*2) N N is the equivalent precision bit width of δ, and the quantization factor is 1 / 2. N , δ = d / (1+d), where d = (ω c T) / 2, where ω c Where ω is the cutoff angular frequency, and T is the sampling period.
2. The first-order high-pass IIR filter according to claim 1, characterized in that, N satisfies (1 / 2) N The smallest integer value of <δ / 2).
3. The first-order high-pass IIR filter according to claim 2, characterized in that, The minimum value of δ is calculated based on the cutoff frequency range and sampling frequency of the first-order high-pass IIR filter.
4. The first-order high-pass IIR filter according to claim 2, characterized in that, δ is calculated as follows: For the target cutoff frequency fc of the first-order high-pass IIR filter, a specific number of candidate cutoff frequencies are uniformly sampled within a cutoff frequency range centered on the target cutoff frequency, and the absolute value of the quantization error δ corresponding to each candidate cutoff frequency is calculated: coeff_quant_err=|δ-δ fix / 2 N |, select the δ with the smallest absolute value of the quantization error, where the cutoff frequency range is [f c -Δ, f c +Δ], where Δ is the predetermined frequency value, ω c =2πf c .
5. The first-order high-pass IIR filter according to claim 2, characterized in that, y t-1 fix x t fix and x t-1 Each contains i integer digits and e decimal digits, where x t fix and x t-1 The e-th decimal place is all 0, y t -1 fix The e-th decimal place is not 0, 0.5 fix Includes e decimal places, where i and e are positive integers.
6. A design method for a first-order high-pass IIR filter, characterized in that, The calculation formula for the first-order high-pass IIR filter is as follows: and t fix =[δ fix *(x t fix +x t-1 fix –2*y t-1 fix )+0.5 fix ]>>N+(x t fix -x t-1 fix +and t-1 fix ), Where x t fix For x t The input data after fixed-point quantization, x t Let x be the input data at time t. t-1 fix For x t-1 The input data after fixed-point quantization, x t-1 The input data at time t-1 is buffered internally by a first-order high-pass IIR filter, y t-1 fix For y t-1 The input data after fixed-point quantization, y t-1 y is the output data at time t-1 that is internally buffered by a first-order high-pass IIR filter. t fix For y t The output data after fixed-point quantization, y t This represents the output data of a first-order high-pass IIR filter at time t, 0.5 fix This is the integer after 0.5 fixed-point quantization; >> indicates a right shift. δ fix =round(δ*2) N N is the equivalent precision bit width of δ, and the quantization factor is 1 / 2. N , δ = d / (1+d), where d = (ω c T) / 2, where ω c Where ω is the cutoff angular frequency, and T is the sampling period.
7. The design method according to claim 6, characterized in that, N satisfies (1 / 2) N The smallest integer value of <δ / 2).
8. The design method according to claim 7, characterized in that, The minimum value of δ is calculated based on the cutoff frequency range and sampling frequency of the first-order high-pass IIR filter.
9. The design method according to claim 7, characterized in that, δ is calculated as follows: For the target cutoff frequency fc of the first-order high-pass IIR filter, a specific number of candidate cutoff frequencies are uniformly sampled within a cutoff frequency range centered on the target cutoff frequency, and the absolute value of the quantization error δ corresponding to each candidate cutoff frequency is calculated: coeff_quant_err=|δ-δ fix / 2 N |, select the δ with the smallest absolute value of the quantization error, where the cutoff frequency range is [f c -Δ, f c +Δ], where Δ is the predetermined frequency value, ω c =2πf c .
10. The design method according to claim 7, characterized in that, y t-1 fix x t fix and x t-1 Each contains i integer digits and e decimal digits, where x t fix and x t-1 The e-th decimal place is all 0, y t -1 fix The e-th decimal place is not 0, 0.5 fix Includes e decimal places, where i and e are positive integers.