FPGA Implementation of Full-precision Low-pass IIR Filter

By using ΣΔ noise shaping technology on the FPGA platform to modulate and filter out the cutoff error of the IIR filter, the oscillation problem caused by the cutoff error in fixed-point number operation is solved, and the output of the full-precision IIR low-pass filter is achieved, satisfying the satisfaction of the output of the The demand for high-speed real-time IIR low-pass filters.

CN114142830BActive Publication Date: 2024-11-15CHANGZHOU TONGHUI ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111499149.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-09
Publication Date
2024-11-15
Estimated Expiration
2041-12-09

AI Technical Summary

Technical Problem

The existing IIR low-pass filter implemented by fixed-point number operation based on FPGA has a cutoff error, resulting in oscillation and cannot realize full-precision filtering output.

Method used

Using ∑Δ noise shaping technology, the cutoff error is modulated to the high frequency band and filtered out through the low-pass filtering function of the filter to achieve full accuracy output.

Benefits of technology

On the FPGA platform, the cutoff error is eliminated through ΣΔ noise shaping technology, and the output of the full-precision IIR low-pass filter is achieved, overcoming the oscillation problem of traditional IIR filters and meeting the needs of high-speed real-time IIR low-pass filters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114142830B_ABST
    Figure CN114142830B_ABST
Patent Text Reader

Abstract

The present invention relates to an FPGA implementation method of a full-precision low-pass IIR filter, comprising the following steps: (1) establishing a mathematical model of an IIR filter; (2) establishing a basic structure of a direct IIR digital filter; and (3) using a ΣΔ noise shaping technique to eliminate truncation errors. The present invention is based on an FPGA platform and combines the ΣΔ noise shaping technique to modulate the truncation output of the direct IIR low-pass filter, thereby achieving a full-precision low-pass filter output that cannot be achieved by traditional technologies. The present invention meets the needs of electronic measurement, digital communication and other fields for high-speed real-time IIR low-pass filters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field:

[0001] The invention relates to the field of electronic measurement technology, and in particular to an FPGA implementation method of a full-precision low-pass IIR filter, which is directly applied to low-pass filtering of high-speed sampled digital signals. Background technology:

[0002] In the process of high-speed digital signal sampling and processing, digital filters based on FPGA have been widely used to complete various types of digital signal operations and change signal spectrum. Digital filters are usually divided into infinite impulse response filters (IIR) and finite impulse response filters (FIR). Under the same design requirements, the required order of IIR filters is significantly lower than that of FIR filters, so IIR filters can obtain good amplitude-frequency characteristics with less hardware resources. In the case of not requiring strict linear phase characteristics, IIR filters have obvious performance advantages.

[0003] Field Programmable Gate Array (FPGA) is an irreplaceable core application in the field of high-speed digital signal processing due to its high-speed real-time performance, good parallel computing capabilities, and unparalleled reconfigurability and scalability.

[0004] However, due to the floating-point operation efficiency of FPGA, in most applications, digital filters are still implemented based on fixed-point numbers. Therefore, FPGA has better support for FIR filters, and it can achieve full-precision digital filtering by increasing the word length of the output signal; while digital IIR filters have a recursive structure and are limited by the limited register length, and cannot achieve full-precision operations by increasing the word length. The cumulative truncation error is a defect that cannot be overcome by fixed-point IIR filters. This is also the fundamental reason why today's mainstream FPGA manufacturers have launched a variety of FIR IP cores, but have failed to launch IIR IP cores.

[0005] The existing IIR low-pass filters implemented based on FPGA fixed-point operations all use recursive structures and contain truncation operations. In actual use, it is very easy to cause oscillation. Therefore, how to design a method that can be implemented based on FPGA fixed-point numbers, consume less hardware resources, eliminate truncation errors, and achieve full-precision filtering output has become a key technology. Summary of the invention:

[0006] In order to solve the above technical problems, the present invention proposes a method for realizing a full-precision IIR digital low-pass filter that is achievable based on fixed-point number operations on an FPGA platform and can eliminate truncation errors.

[0007] The present invention provides an FPGA implementation method of a full-precision low-pass IIR filter, comprising:

[0008] (1) Establishment of IIR filter mathematical model

[0009] The unit impulse response of the IIR filter is infinitely long, and the system function conforms to the mathematical form of the Auto Regressive Moving Average (ARMV) filter:

[0010]

[0011] Formula (1-1) can be replaced by the following form:

[0012]

[0013] In the formula, p is the number of poles of the filter (the denominator contains the sum of all orders from 1 to p, a total of p terms); q+1 is the number of zeros of the filter (the numerator contains the sum of all orders from 0 to q, a total of q+1 terms). In practical applications, the number of poles is usually the same as the number of zeros, that is, p = q+1. Perform an inverse z-transform on (1-1) to obtain the time domain difference equation of the system:

[0014]

[0015] x[n] and y[n] are the time domain expressions of the input and output signals of the filter respectively; a1, a2, …, a p are the pole coefficients of each order; b0, b1, …, b q are the zero-point coefficients of each order.

[0016] Taking the third-order IIR filter as an example, equation (1-2) can be written as:

[0017] y[n]=b0x[n]+b1x[n-1]+b2x[n-2]+b3x[n-3]-a1y[n-1]-a2y[n-2]-a3y[n-3]

[0018] (1-3).

[0019] (2) Establishment of the basic structure of direct IIR digital filter

[0020] It can be seen from equation (1-3) that the terms on the right side of the equation are divided into two parts: the product of each order x and each order zero-point coefficient b, and the product of each order y and each order pole coefficient a. These two parts are called zero-point terms and pole terms respectively.

[0021] The direct IIR filter sums the zero-point term and the pole-point term separately and then adds them together. This process is a full-precision operation, and the word length is extended according to the fixed-point multiplication and addition rules. The accumulated sum is then truncated, and the truncated output maintains the same word length as the filter input. Due to the truncation operation, the filter output introduces truncation error, or quantization noise.

[0022] The fixed-point number calculation method can be described by the following formula:

[0023] Xr[n]=b0·x[n]+b1·x[n-1]+…b q ·x[nq] (2-1)

[0024] Yr[n]=a1·y[n-1]+a2·y[n-2]+…a p y[np] (2-2)

[0025] Y out =(Xr[n]+Yr[n])>>N (2-3)

[0026] The “>>” in formula (2-3) is a right shift operation, i.e., a bit truncation operation;

[0027] Xr[n] is the accumulated value of each order sampling of the input signal x multiplied by the response zero coefficient;

[0028] Yr[n] is the accumulated value of each order sampling of the input signal y multiplied by the response pole coefficient;

[0029] N represents the number of bits to be truncated;

[0030] Yout is the filter output including truncation error.

[0031] (3) ΣΔ noise shaping technology eliminates truncation errors

[0032] Since a right shift operation is performed in equation (2-3), a truncation error is generated. Each time the IIR digital filter is recursively performed, a truncation error is accumulated, which is a fundamental defect that cannot be overcome by the traditional structure and can easily cause oscillation. The key idea of ​​the present invention is to regard the truncation error as quantization noise, and then use the "∑Δ noise shaping" technology to modulate the quantization noise to a high frequency band. When the quantization noise modulated to high frequency and the output of the original signal are recursively performed for the next time through the feedback structure, because the function of the filter itself is low-pass filtering, the high-frequency quantization noise is filtered out by the filter itself. Therefore, the final output does not contain quantization noise, that is, the truncation error is overcome, and full-precision filtering output is achieved. The modulation principle is as follows:

[0033] Combining equations (2-1), (2-2), and (2-3), the filter output y[n] is further derived as follows:

[0034] make,

[0035] G[n]=Xr[n]+Yr[n] (3-1)

[0036] ∑[n]=∑[n-1]+Δ[n] (3-2)

[0037] y[n]=(G[n]+∑[n])>>N (3-3)

[0038] Δ[n]=G[n]-(y[n]< <N) (3-4)

[0039] G[n] represents the sum of Xr[n] and Yr[n], which is the ideal full-precision output of the filter without truncation;

[0040] Δ[n] represents the truncation error, which is the deviation between the ideal full-precision output and the actual truncated output;

[0041] ∑[n] represents the accumulation of truncation error Δ[n], that is, digital integration.

[0042] When programming the FPGA, a full-precision arbitrary-order IIR low-pass filter can be realized by performing recursive operations according to equations (3-1) to (3-4) according to the system clock cycle.

[0043] The beneficial effects of the present invention are as follows: the present invention is based on an FPGA platform and combines ∑Δ noise shaping technology to modulate the truncated output of a direct IIR low-pass filter, thereby achieving a full-precision low-pass filter output that cannot be achieved by traditional technology. The present invention meets the needs of electronic measurement, digital communication and other fields for high-speed real-time IIR low-pass filters. Description of the drawings:

[0044] Figure 1 It is a schematic diagram of the structure of a full-precision direct third-order IIR low-pass filter of the present invention;

[0045] Figure 2 This is a Modelsim simulation effect diagram of the full-precision direct third-order IIR low-pass filter of the present invention. Specific implementation method:

[0046] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.

[0047] The present invention provides an FPGA implementation method of a full-precision low-pass IIR filter, comprising:

[0048] (1) Establishment of IIR filter mathematical model

[0049] The unit impulse response of the IIR filter is infinitely long, and the system function conforms to the mathematical form of the Auto Regressive Moving Average (ARMV) filter:

[0050]

[0051] In the formula, p is the number of poles of the filter; q+1 is the number of zeros of the filter. In practical applications, the number of poles is usually the same as the number of zeros, that is, p = q+1. Perform an inverse z-transform on (1-1) to obtain the time domain difference equation of the system:

[0052]

[0053] Taking the third-order IIR filter as an example, equation (1-2) can be written as:

[0054] y[n]=b0x[n]+b1x[n-1]+b2x[n-2]+b3x[n-3]-a1y[n-1]-a2y[n-2]-a3y[n-3]

[0055] (1-3).

[0056] (2) Establishment of the basic structure of direct IIR digital filter

[0057] The direct IIR filter sums the zero-point term and the pole-point term separately and then adds them together. This process is a full-precision operation, and the word length is extended according to the fixed-point multiplication and addition rules. The accumulated sum is then truncated, and the truncated output maintains the same word length as the filter input. Due to the truncation operation, the filter output introduces truncation error, or quantization noise.

[0058] The fixed-point number calculation method can be described by the following formula:

[0059] Xr[n]=b0·x[n]+b1·x[n-1]+…b q ·x[nq] (2-1)

[0060] Yr[n]=a1·y[n-1]+a2·y[n-2]+…a p y[np] (2-2)

[0061] Y out =(Xr[n]+Yr[n])>>N (2-3)

[0062] The “>>” in formula (2-3) is a right shift operation, that is, a truncation operation.

[0063] (3) ∑Δ noise shaping technology eliminates truncation errors

[0064] Since the right shift operation is performed in formula (2-3), a truncation error is generated. Each time the IIR digital filter is recursive, a truncation error is accumulated, which is a fundamental defect that cannot be overcome by the traditional structure and can easily cause oscillation. The key idea of ​​the present invention is to regard the truncation error as quantization noise, and then use the "∑Δ noise shaping" technology to modulate the quantization noise to a high frequency band. When the quantization noise modulated to high frequency and the output of the original signal are recursively fed back to the feedback structure for the next time, the high-frequency quantization noise is filtered out by the filter itself because the function of the filter itself is low-pass filtering. Therefore, the final output does not contain quantization noise, that is, the truncation error is overcome, and full-precision filtering output is achieved.

[0065] Taking the third-order IIR filter described by equation (1-3) as an example, its structure is as follows Figure 1 shown.

[0066] according to Figure 1 Based on the principle, the filter output y[n] is further deduced by combining equations (2-1), (2-2), and (2-3) as follows:

[0067] make

[0068] G[n]=Xr[n]+Yr[n] (3-1)

[0069] ∑[n]=∑[n-1]+Δ[n] (3-2)

[0070] y[n]=(G[n]+∑[n])>>N (3-3)

[0071] Δ[n]=G[n]-(y[n]< <N) (3-4)

[0072] When programming FPGA, recursive calculations are performed according to the system clock cycle according to equations (3-1) to (3-4) to realize a full-precision arbitrary-order IIR low-pass filter. Modelsim code simulation effect Figure 2 As shown in the figure, the input signal din is a DC step signal superimposed with white noise. It can be seen that the output signal dout meets the theoretical expectations and the performance of the low-pass filter is reliable.

[0073] The following is a detailed description Figure 1 The schematic diagram and timing logic of the FPGA implementation of the full-precision 3rd-order IIR low-pass filter shown:

[0074] In FPGA, according to formula (2-2), multiple parallel multipliers are used to calculate the products of zero-point terms of each order, namely b0·x[n], b1·x[n-1], …, b q ·x[nq], a total of q+1 items; at the same time, another set of multi-way parallel multipliers is used to calculate the product of each order pole item according to formula (2-3), that is,

[0075] a1·y[n-1], a2·y[n-2],…,a p y[np], p items in total.

[0076] In FPGA, according to formula (2-2), a serial adder is used to sum the q+1 zero-point coefficients, denoted as x r [n]; At the same time, according to formula (2-3), another set of serial adders is used to sum the p-term pole coefficients, denoted as y r [n].

[0077] In the FPGA, according to formula (3-1), an adder is used to add the x obtained in the previous step. r [n] and y r [n] is summed and recorded as G[n].

[0078] In FPGA, a digital integrator is used according to formula (3-2) to sum the deviation Δ[n] between G[n] and y[n], which is expressed as ∑[n].

[0079] In FPGA, according to formula (3-3), an adder is used to sum G[n] and ∑[n], and then right-shifted by N bits as the filter output, recorded as y[n]. N is equal to the word length of G[n] minus the word length of x[n]. The purpose of the right shift operation is to keep the output signal and the input signal the same word length for recursive operation.

[0080] The filter output y[n] obtained in the previous step is fed back, subtracted from G[n+1] in the next data cycle, and then steps 1 to 5 are repeated.

[0081] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several variations and modifications can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A full-precision low-pass IIR filter FPGA implementation method, It is characterized in that The steps include: (1) Establishment of IIR filter mathematical model The system function of the IIR filter conforms to the mathematical form of the autoregressive moving average filter: Where p is the number of poles of the filter; q+1 is the number of zeros of the filter; Perform an inverse z-transform on equation (1-1) to obtain the time domain difference equation of the system: Formula (1-2) can be written as: y[n]=b 0 x[n]+b 1 x[n-1]+b 2 x[n-2]+b 3 x[n-3]-a 1 y[n-1]-a 2 y[n-2]-a 3 y[n-3] (1-3); (2) Establishment of the basic structure of direct IIR digital filter It can be seen from equation (1-3) that the terms on the right side of the equation are divided into two parts: the product of each order x and each order zero-point coefficient b, and the product of each order y and each order pole coefficient a. These two parts are called zero-point terms and pole terms respectively. The direct IIR digital filter sums the zero-point terms and pole terms separately and then adds them together. The accumulated sum is then truncated. The truncated output maintains the same word length as the filter input. The fixed-point number calculation method is described by the following formula: Xr[n]=b 0 ·x[n]+b 1 ·x[n-1]+…b q ·x[n-q] (2-1) The[n]=a 1 ·y[n-1]+a 2 ·y[n-2]+…a p ·y [np] (2-2) Y out =(Xr[n]+Yr[n])>>N (2-3) In the formula, >> is the truncation operation; (3) ΣΔ noise shaping technology eliminates truncation errors Combining equations (2-1), (2-2), and (2-3), the filter output y[n] is further derived as follows: make G[n]=Xr[n]+Yr[n] (3-1) Δ[n]=∑[n-1]+Δ[n] (3-2) y[n]=(G[n]+∑[n])>>N (3-3) Δ[n]=G[n]-(y[n]<<N) (3-4) When programming the FPGA, a full-precision arbitrary-order IIR low-pass filter can be realized by performing recursive operations according to equations (3-1) to (3-4) according to the system clock cycle.