Fixed-point iir filter supporting floating-point coefficients and electronic device
By introducing a scaling factor register and an arithmetic unit into the fixed-point IIR filter, the problem that the fixed-point IIR filter does not support floating-point coefficients is solved, enabling fast floating-point operations and reducing hardware and design costs.
Patent Information
- Application Number
- CN202211524213.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-11-30
AI Technical Summary
Existing fixed-point IIR filters do not support floating-point coefficients, which prevents floating-point operations and limits their application scenarios and hardware costs.
In a fixed-point IIR filter, a numerator scaling factor register, a denominator scaling factor register, a feedback scaling factor register, an output scaling factor register, a multiplier, a divider, and a limiter are added to scale the floating-point coefficients, thereby enabling floating-point coefficient operations.
It enables the rapid computation of floating-point coefficients in fixed-point IIR filters, maintaining computational speed without degrading the performance of existing fixed-point IIR filters, and reducing hardware and design costs.
Smart Images

Figure CN115865044B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital signal processing, and more particularly to a fixed-point IIR filter and electronic device that supports floating-point coefficients. Background Technology
[0002] In digital circuits, filtering and feedback control of digital signals are inseparable from filters. IIR (Infinite Impulse Response) filters, capable of low-pass, high-pass, band-pass, and band-stop filtering, and even replacing classic PID control and zero-pole compensation control in digital control, are becoming increasingly widely used. However, the filter coefficients (numerator and denominator coefficients) of IIR filters are typically of floating-point data type. This requires IIR filters to support floating-point operations and demands high floating-point processing capabilities. However, in practical applications, IIR filters that do not support floating-point operations are often used, as IIR filters do not support floating-point coefficients. Summary of the Invention
[0003] The IIR filter and electronic device provided in this application can solve the problem that fixed-point IIR filters in related technologies do not support floating-point coefficients. The technical solution is as follows:
[0004] In a first aspect, embodiments of this application provide a fixed-point IIR filter supporting floating-point coefficients, comprising:
[0005] The system includes a data input terminal, a numerator scaling factor register, a denominator scaling factor register, a feedback scaling factor register, an output scaling factor register, a data output terminal, numerator coefficient registers R0 to Rn, multipliers A0 to An, B0 to Bn, adders C0 to Cn, delayers D0 to Dn-1, multipliers E1 to En, F1 to Fn, denominator coefficient registers S1 to Sn, a first divider M1, a second divider M2, and a limiter M2; n is an integer greater than 1; the numerator coefficient registers R0 to Rn are used to store floating-point numerator coefficients, and the denominator coefficient registers S1 to Sn are used to store floating-point denominator coefficients.
[0006] The input terminals are respectively connected to the first input terminals of multipliers B0 to Bn;
[0007] The molecular scaling factor registers are respectively connected to the first input terminals of multipliers A0 to An;
[0008] The denominator scaling factor register is connected to the first input terminal of multipliers F1 to Fn respectively;
[0009] The numerator coefficient registers R0 to Rn are connected one-to-one with the second input terminals of multipliers A0 to An.
[0010] The output terminals of multipliers A0 to An are connected to the second input terminals of multipliers B0 to Bn in a one-to-one manner;
[0011] The output terminals of multipliers B0 to Bn are connected to the first input terminals of adders C0 to Cn in a one-to-one manner;
[0012] The output terminals of delay units D0 to Dn-1 are connected to the second input terminals of adders C0 to Cn-1 in a one-to-one manner;
[0013] The output terminals of multipliers E1 to En-1 are connected one-to-one with the third input terminals of adders C1 to Cn-1.
[0014] The output of adder C0 is connected to the dividend terminal of first divider M1, the divisor terminal of first divider is connected to feedback scaling factor register, and the output of first divider is connected to the input of limiter; the output of limiter is connected to the output terminal of second divider, and the output of limiter is connected to the first input terminals of multipliers E1 to En respectively; the divisor terminal of second divider is connected to output scaling factor register, and the output of second divider is connected to the data output terminal.
[0015] The second input terminal of adder Cn is connected to the output terminal of multiplier En, and the output terminal of adder Cn is connected to the input terminal of delayer Dn-1;
[0016] The output terminals of multipliers F1 to Fn are connected to the second input terminals of multipliers E1 to En in a one-to-one manner;
[0017] The denominator coefficient registers S1 to Sn are connected one-to-one with the first input terminals of multipliers F1 to Fn.
[0018] Secondly, this application provides an electronic device, including: the IIR filter described above.
[0019] The beneficial effects of the technical solutions provided in some embodiments of this application include at least the following:
[0020] Based on the existing fixed-point IIR filter structure, this paper adds a numerator scaling factor register, a denominator scaling factor register, a feedback scaling factor register, an output scaling factor register, multipliers A0 to An, multipliers F1 to Fn, a first divider M1, a second divider M2, and a limiter M2. By scaling the floating-point coefficients, IIR filtering using floating-point coefficients is achieved in the fixed-point IIR filter. This has the advantages of fast operation speed and short operation time. Compared with floating-point IIR filters, it does not reduce the operation speed and can be designed compatiblely with existing fixed-point IIR filters, reducing hardware and design costs. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of the structure of an n-order IIR filter provided in an embodiment of the present invention;
[0023] Figure 2 This is a structural diagram of a fourth-order IIR filter provided in an embodiment of the present invention;
[0024] Figure 3 This is a schematic diagram of the distribution of numerical ranges provided in an embodiment of the present invention. Detailed Implementation
[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] Please see Figure 1 The present invention provides a schematic diagram of the structure of an IIR filter according to an embodiment. The IIR filter includes:
[0027] Data input terminal 1, numerator scaling factor register 2, denominator scaling factor register 3, feedback scaling factor register 4, output scaling factor register 5, data output terminal 6, numerator coefficient register R0~numerator coefficient register Rn, multiplier A0~multiplier An, multiplier B0~multiplier Bn, adder C0~adder Cn, delay D0~delay Dn-1, multiplier E1~multiplier En, multiplier F1~multiplier Fn, denominator coefficient register S1~denominator coefficient register Sn, first divider M1, second divider M2, limiter M2; n is an integer greater than 1.
[0028] The multiplier performs multiplication, the adder performs addition, the register stores relevant data, the divider performs trigger operations, the delay unit performs delay processing (i.e., temporarily stores the previous data), and the limiter limits the range of output data. All of the above devices are digital devices.
[0029] The IIR filter can be implemented using at least one of the following hardware methods: Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA).
[0030] The connection relationships of the various components of an IIR filter are as follows:
[0031] There are a total of n+1 multipliers, from B0 to Bn, each with a first input terminal, a second input terminal, and an output terminal. The data input terminals of this application are connected to the first input terminals of multipliers B0 to Bn, respectively.
[0032] The numerator scaling factor register is used to store the first scaling factor, and the numerator scaling factor register is connected to the first input terminals of multipliers A0 to An respectively.
[0033] The denominator scaling factor register is used to store the second scaling factor. The denominator scaling factor register is connected to the first input terminal of multipliers F1 to Fn respectively.
[0034] The numerator coefficient registers R0 to Rn are connected one-to-one with the second input terminals of multipliers A0 to An. The numerator coefficient registers R0 to Rn are used to store the floating-point numerator coefficients F_b0 to F_bn, respectively. The numerator coefficient register R0 is connected to the second input terminal of multiplier A0, the numerator coefficient register R1 is connected to the second input terminal of multiplier A1, ..., the numerator coefficient register Rn is connected to the second input terminal of multiplier An.
[0035] The output terminals of multipliers A0 to An are connected to the second input terminals of multipliers B0 to Bn in a one-to-one manner, that is, the output terminal of multiplier A0 is connected to the second input terminal of multiplier B0, the output terminal of multiplier A1 is connected to the second input terminal of multiplier B1, ..., the output terminal of multiplier An is connected to the second input terminal of multiplier Bn.
[0036] The output terminals of multipliers B0 to Bn are connected to the first input terminals of adders C0 to Cn in a one-to-one manner, that is, the output terminal of multiplier B0 is connected to the first input terminal of adder C0, the output terminal of multiplier B1 is connected to the first input terminal of adder C1, ..., the output terminal of multiplier Bn is connected to the first input terminal of adder Bn.
[0037] The output terminals of delay units D0 to Dn-1 are connected to the second input terminals of adders C0 to Cn-1 in a one-to-one manner, that is, the output terminal of delay unit D0 is connected to the second input terminal of adder C0, the output terminal of delay unit D1 is connected to the second input terminal of adder C1, ..., the output terminal of delay unit Dn-1 is connected to the second input terminal of adder Cn-1.
[0038] The outputs of multipliers E1 to En-1 are connected one-to-one with the third inputs of adders C1 to Cn-1.
[0039] The output of adder C0 is connected to the dividend of the first divider M1. The divisor of the first divider is connected to the feedback scaling factor register. The output of the first divider is connected to the input of the limiter. The output of the limiter is connected to the output of the second divider, and the output of the limiter is connected to the first input of multipliers E1 to En respectively. The divisor of the second divider is connected to the output scaling factor register. The output of the second divider is connected to the data output.
[0040] The second input of adder Cn is connected to the output of multiplier En, and the output of adder Cn is connected to the input of delay timer Dn-1.
[0041] The output terminals of multipliers F1 to Fn are connected one-to-one with the second input terminals of multipliers E1 to En. The denominator coefficient registers S1 to Sn are connected one-to-one with the first input terminals of multipliers F1 to Fn. The denominator coefficient registers S1 to Sn are used to store floating-point denominator coefficients: F_a1 to F_an.
[0042] The operation of the IIR filter in this application includes:
[0043] Floating-point numerator coefficients F_b0~F_bn and floating-point denominator coefficients F_a1~F_an are generated based on the performance specifications of an n-order IIR filter. For example, based on the performance specifications of low-pass, high-pass, band-pass, or band-stop filters, the above floating-point numerator and denominator coefficients are generated using the fdatool tool in MATLABLE. The floating-point denominator coefficients belong to the denominator of the transfer function of the n-order IIR filter, and the floating-point numerator coefficients belong to the numerator of the transfer function of the n-order IIR filter. The data type of the floating-point numerator and denominator coefficients is floating-point. The processor writes the generated floating-point numerator coefficients F_b0~F_bn to the numerator coefficient registers R0~Rn, and the generated floating-point denominator coefficients F_a1~F_an to the denominator coefficient registers S1~Sn, respectively. The floating-point denominator coefficient F_a0 = 1.
[0044] Then, input the data to be processed at data input terminal 1. Using multipliers A0 to An, the molecular scaling factor 2 is stored in the molecular scaling factor register 2. bx_coef_bit The floating-point numerator coefficients F_b0 to F_bn are multiplied respectively to obtain the fixed-point numerator coefficients Q_b0 to Q_bn. Then, using multipliers F1 to Fn, the 2 stored in the denominator scaling factor register 3 are multiplied... ax_coef_bit The fixed-point denominator coefficients F_a1 to F_an are obtained by multiplying them respectively with the floating-point denominator coefficients F_a1 to F_an. The data type of the fixed-point numerator and denominator coefficients is fixed-point.
[0045] For the output of adder C0, the first divider M1 divides the output by the feedback scaling factor 2 stored in the feedback scaling factor register 4. feedback_bit The quotient value is obtained, and then the limiter Q1 is used to limit the quotient value. The second divider M2 divides the result after the limiting process by the output scaling factor 2 stored in the output scaling factor register 5. fscale_o_bit The output data of the IIR filter is obtained and output through data output terminal 7.
[0046] For example, see Figure 2 The diagram shown illustrates the structure of an IIR filter, where n = 4. Figure 3The IIR registers in this configuration omit the numerator coefficient registers R0-R4, multipliers A0-A4, multipliers F1-F4, and denominator coefficient registers S1-S4. The data input terminal takes in 16 bits of data to be processed, generating five fixed-point numerator coefficients F_b0-F_b4 and four fixed-point denominator coefficients F_a1-F_a4, all of which are 16 bits. Then, adder C0 outputs a 60-bit result. First divider M1 divides this output result by the feedback scaling factor Q_feedback stored in feedback scaling factor register 4 to obtain the quotient. Then, limiter Q1 limits this quotient. Second divider M2 divides the limited result by the output scaling factor Q_scaleO stored in output scaling factor register 5 to obtain the IIR filter output data. This 24-bit output data is output through data output terminal 7, realizing the fixed-point operation of the IIR filter.
[0047] Furthermore, in this embodiment, the processor can select a corresponding coefficient set for the IIR filter from multiple coefficient sets according to different needs, and then configure each coefficient in the coefficient set into the IIR filter to adapt to different computing scenarios. Each coefficient set includes numerator scaling coefficients, denominator scaling coefficients, n+1 floating-point numerator coefficients, n floating-point denominator coefficients, feedback scaling coefficients, and output scaling coefficients.
[0048] Optionally, the selected coefficient set is related to the size of the input data to be processed. Before the IIR filter processes the data to be processed, the numerical range of the data to be processed is determined, and then the target coefficient set corresponding to the numerical range in multiple coefficient sets is queried and the target coefficient set is configured into the register in the IIR filter.
[0049] For example: see Figure 3 The diagram showing the numerical range distribution illustrates that this application pre-configures four coefficient sets: g0, g1, g2, and g3. When |Din| > L3, coefficient set g3 is selected to configure the IIR filter; when |Din| ∈ [L2, L23], coefficient set g2 is selected to configure the IIR filter; when |Din| ∈ [L1, L12], coefficient set g1 is selected to configure the IIR filter; and when |Din| ∈ [0, L0], coefficient set g0 is selected to configure the IIR filter. The order is L3 > L2 > L1 > L0.
[0050] Furthermore, L12 and L23 are determined according to any of the following formulas:
[0051] or or Where k and a are constants, 1 < k < 10, 0 < a < k.
[0052] The hardware architecture of this application embodiment, based on the existing fixed-point IIR filter structure, adds a numerator scaling factor register, a denominator scaling factor register, a feedback scaling factor register, an output scaling factor register, multipliers A0 to An, multipliers F1 to Fn, a first divider M1, a second divider M2, and a limiter M2. By scaling the floating-point coefficients, IIR filtering using floating-point coefficients is achieved in the fixed-point IIR filter. It has advantages such as fast operation speed and short operation time. Compared with the floating-point IIR filter, it does not reduce the operation speed and can be designed with compatibility with existing fixed-point IIR filters, reducing hardware and design costs.
[0053] In addition to the control device described above, the electronic device provided in this application embodiment may also include a housing for accommodating various components.
[0054] The embodiments described above do not constitute a limitation on the scope of protection of this technical solution. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the above embodiments should be included within the scope of protection of this technical solution.
Claims
1. A fixed-point IIR filter supporting floating-point coefficients, characterized in that, include: The system includes a data input terminal, a numerator scaling factor register, a denominator scaling factor register, a feedback scaling factor register, an output scaling factor register, a data output terminal, numerator coefficient registers R0 to Rn, multipliers A0 to An, B0 to Bn, adders C0 to Cn, delayers D0 to Dn-1, multipliers E1 to En, F1 to Fn, denominator coefficient registers S1 to Sn, a first divider M1, a second divider M2, and a limiter; n is an integer greater than 1; the numerator coefficient registers R0 to Rn are used to store floating-point numerator coefficients, and the denominator coefficient registers S1 to Sn are used to store floating-point denominator coefficients. The input terminals are respectively connected to the first input terminals of multipliers B0 to Bn; The molecular scaling factor registers are respectively connected to the first input terminals of multipliers A0 to An; The denominator scaling factor register is connected to the first input terminal of multipliers F1 to Fn respectively; The numerator coefficient registers R0 to Rn are connected one-to-one with the second input terminals of multipliers A0 to An; The output terminals of multipliers A0 to An are connected to the second input terminals of multipliers B0 to Bn in a one-to-one manner; The output terminals of multipliers B0 to Bn are connected to the first input terminals of adders C0 to Cn in a one-to-one manner; The output terminals of delay units D0 to Dn-1 are connected to the second input terminals of adders C0 to Cn-1 in a one-to-one manner; The output terminals of multipliers E1 to En-1 are connected one-to-one with the third input terminals of adders C1 to Cn-1. The output of adder C0 is connected to the dividend terminal of first divider M1, the divisor terminal of first divider is connected to feedback scaling factor register, and the output of first divider is connected to the input of limiter; the output of limiter is connected to the dividend terminal of second divider, and the output of limiter is connected to the first input terminals of multipliers E1 to En respectively; the divisor terminal of second divider is connected to output scaling factor register, and the output of second divider is connected to the data output terminal; The second input terminal of adder Cn is connected to the output terminal of multiplier En, and the output terminal of adder Cn is connected to the input terminal of delayer Dn-1; The output terminals of multipliers F1 to Fn are connected to the second input terminals of multipliers E1 to En in a one-to-one manner; The denominator coefficient registers S1 to Sn are connected one-to-one with the first input terminals of multipliers F1 to Fn.
2. The IIR filter according to claim 1, characterized in that, Also includes: The system includes an input register for storing data to be processed and an output register for storing output data.
3. An electronic device, characterized in that, Includes the IIR filter as described in claim 1 or 2.
4. The electronic device according to claim 3, characterized in that, Also includes: Processor and memory; The processor is connected to both the memory and the IIR filter. The memory is used to store multiple sets of coefficients; The processor is configured to select a target coefficient set from the plurality of coefficient sets before performing filtering processing, and then assign each coefficient in the target coefficient set to the IIR filter.
5. The electronic device according to claim 4, characterized in that, Select a target coefficient set from the plurality of coefficient sets, including: Determine the numerical range to which the data to be processed belongs; Obtain the target coefficient set corresponding to the numerical range in the plurality of coefficient sets.
Citation Information
Patent Citations
Configurable recursive digital filter for processing television audio signals
CN101088237A
Chip with built-in reconfigurable coprocessor and electronic equipment
CN114116598A
