Computer Design and FPGA Implementation of High-Order FIR Filters

Publisher:qpb1234Latest update time:2011-04-01 Source: 现代电子技术 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: Based on the principle of finite impulse response (FIR) digital filter, a FIR filter design method using parameterized macro function module (LPM) in QuartusⅡ is proposed by combining Matlab and QuartusⅡ of FPGA. First, the filter coefficients are designed by Matlab, and then the multipliers and adders constructed by LPM of QuartusⅡ are used to obtain the filtering results. Compared with the distributed algorithm, this method can achieve the filtering effect more simply when the signal processing rate is not high and the filter order is high. Finally, based on Matlab and QuartusⅡ, the design and simulation of 64-order high-order FIR digital filter circuit are realized.
Keywords: FIR filter; Matlab QuartusⅡ; parameterized function module library

Compared with infinite impulse response (IIR) filter, finite impulse response (FIR) can obtain strict linear phase characteristics while satisfying the amplitude-frequency response of the filter. Data communication, voice signal processing and other fields often require that the signal should not have obvious phase distortion during transmission, so FIR filter has been more widely used. There are many methods for designing and implementing FIR filters. The most commonly used one is the FIR filter design based on distributed algorithm. This method uses the construction of a lookup table and pipeline operation to complete the filtering process, which greatly improves the processing efficiency of the system. However, the system memory capacity required by the lookup table increases exponentially with the order of the filter. Based on engineering practice, this paper proposes a FIR filter design method based on LPM parameterized macro function module when the signal processing rate requirement is not high and the filter order is high. It has certain engineering practical value.

1 Principle and design method of FIR filter
1.1 Principle of FIR filter

The mathematical expression of FIR filter is:
1.JPG
Where: N is the number of taps of FIR filter; x(n) is the input sample at the nth moment; h(k) is the tap coefficient of the kth stage of FIR filter.
The structure of direct FIR filter is shown in Figure 1.

2.JPG


As shown in Figure 1, the FIR filtering process is a process of signal delay at each level. The delayed outputs of each level are weighted and accumulated to obtain the FIR output. The most important algorithm is the multiplication-accumulation operation. Since each FIR filtering process requires N multiplications and N-1 additions, the amount of FIR filtering operations depends entirely on the size of N.
1.2 Distributed FIR filter design
The distributed algorithm (DA) was proposed by Croisier as early as 1973. It was not until the appearance of the lookup table (LUT) structure of the field programmable gate array (FPGA) that this algorithm was re-emphasized. Its main principle is as follows.
For the sake of simplicity of analysis, the expression (1) of the FIR filter is rewritten as:
3.JPG
It can be seen that the distributed algorithm is an optimization solution for the purpose of realizing the "multiplication-addition" unit. A lookup table (LUT) is used to implement the mapping, that is, a 2k word width (i.e., 2k rows) is used to pre-program the mapping of a K-bit input vector Xb=[X0b, X1b, …, X(k-1)b] received by the LUT in the program, and the partial product is directly output after the lookup in the lookup table 4.JPG . However, as can be seen from the above, the word width of the lookup table is 2k. If the tap coefficients of the filter are too many, the scale of the lookup table will increase exponentially with the increase of the tap coefficients, which will make the scale of the LUT very large. In order to reduce the scale, the partial table calculation method can be used, that is, a large lookup table can be divided into several small lookup tables, and then the results are added.
1.3 FIR filter design based on LPM parameterized macro function module
As can be seen from Section 1.2, the distributed algorithm greatly reduces the scale of the hardware circuit and is easy to implement pipeline technology, which not only improves the execution speed of the circuit, but also greatly improves the signal processing efficiency. However, when the processing speed required by the system is not high, the LPM parameterized macro function module in QuartusⅡ can be used to design FIR filters; when the filter coefficient is large, this method does not need to construct a huge lookup table or multiple small lookup tables like the distributed algorithm.
1.3.1 Brief description of LPM parameterized function module
LPM is the abbreviation of the library of parameterized modules. Designers can select appropriate modules in the LPM library according to the needs of the actual circuit and set appropriate parameters for them to meet the design requirements. Commonly used LPM macro function modules include arithmetic components such as accumulators, adders and multipliers; multiplexers and LPM gate functions also have gate circuits such as I/O components, memory compilers, etc. Users can refer to relevant information according to their own needs. This article uses the multiplier and accumulator to complete the design of FIR filters. 1.3.2
Design of FIR filter
In QuartusⅡ, the "Megawizard" wizard is used to generate the required modules, and its interface is shown in Figure 2.

5.JPG


Select LPM_MULT in Arithmetic on the left side of the figure to get the interface of Figure 3. Select appropriate parameters according to the technical indicators to generate the multiplier module. Follow the wizard to complete the setting of the multiplier parameters (such as the number of bits of the multiplier, whether to multiply signed numbers, etc.). The structure of the adder module is similar and will not be described in detail.

6.JPG


Taking the FIR filter designed in this paper as an example (described in detail later), the input signal rate is 2 MHz (period is 500 ns), and the filter order is 64. Therefore, 8 multipliers are constructed (up to 25 can be constructed) to complete all multiplications in 8 times. Compared with the pipeline speed of the distributed algorithm, the constructed multiplier takes 20 ns to complete a multiplication, which is relatively longer, but it only takes 8×20=160 ns to complete 8 multiplications, which is less than the time of one cycle of the input signal, so it meets the design requirements. Divide one cycle of the input data into 8 time blocks on average, and the block diagram of the FIR filter design module in each time is shown in Figure 4.

8.JPG


The FIR filter modules in the other 7 time blocks are the same as those in Figure 4, except that the signal input data and filter tap coefficients involved in the multiplication operation are different, from x(n-8) to x(n-63) and h(8) to h(63) respectively. After the results of the 8 multiplication and addition modules are sent to the register, the accumulation is completed in the last time block to obtain the final output (relative to the multiplication operation, the time to complete the accumulation can be ignored). The implementation block diagram is shown in Figure 5.
Combining Figures 4 and 5, the FIR filter design based on the LPM parameterized macro function module can be completed. It can be found from the two figures that there are multiple full adders, and the number of bits (bits) of the input data is different. The design can be easily completed by adjusting the parameters of the LPM macro function module. The number of bits of the output data y(n) is based on the high 12 bits of the final accumulation result according to the project needs. The error caused by taking the high 12 bits is 7.JPG (the highest bit is the sign bit, which is not considered numerically), which is an acceptable error.

2 FIR filter design based on Matlab and QuartusⅡ
2.1 Design of filter coefficients using Matlab Design

indicators: sampling frequency is 2 MHz, f1=200 kHz, f2=330 kHz, passband attenuation is 1 dB, stopband attenuation is 70 dB. The required order and parameter values ​​are determined by parameter indicators. Part of the procedure is as follows:
9.JPG


The design indicators are verified by Figure 6.

10.JPG


If the design index is not met, the filter parameters can be adjusted until the design requirements are met.
2.2 Design and simulation using QuartusⅡ
The FIR filter tap coefficients generated by Matlab are simulated using QuartusⅡ. QuartusⅡ software is the main FGPA design software promoted by Altera. It is a design software that integrates design input, compilation, synthesis, simulation, wiring, and downloading. Since the filter tap coefficients generated by Matlab are decimals, they are converted into 18-bit binary coefficients for use according to engineering needs. The process is as follows:
The FIR digital filter coefficients generated by Matlab are as follows:
11.JPG
The design of the FIR filter is completed in QuartusⅡ according to the method proposed in Section 2.3, and the design file is compiled and synthesized through the compilation and synthesis function, and then the top-level module is generated, as shown in Figure 7.

12.JPG


Through the waveform simulation function of QuartusⅡ, the waveform is simulated and quantitatively analyzed. The waveform simulation is shown in Figure 8. Among them, cp50 is the system clock, which controls the input rate of the input signal xin_data (2 MHz in this case). data_result is the multiplication and addition result of the filter without high-order processing; data_result_out is the final filter output result. It has been verified that data_result is consistent with the calculation result of Matlab, and data_result can meet the requirements of engineering accuracy.

13.JPG



3 Conclusion

This paper has completed a FIR filter design based on LPM parameterized macro function module based on Matlab and FPGA software QuartusⅡ. This method is proposed based on practical engineering applications. It does not require high signal processing rate, but has a high order of filter. When the design index changes, only the parameters of each module need to be adjusted to complete the new design. This method has been applied in practical engineering.

Reference address:Computer Design and FPGA Implementation of High-Order FIR Filters

Previous article:DDS Design Based on Improved CORDIC Algorithm
Next article:FPGA mezzanine card I/O design based on FMC standard

Recommended ReadingLatest update time:2024-11-16 21:36

Temperature detection wireless transmitting and receiving system based on FPGA control
Abstract: This article introduces a temperature detection wireless transmitting and receiving system based on FPGA control. This system uses EPlKl000C208-3 as the control core. The system compares whether the temperature exceeds the optimal temperature range of the human body. If it is too high, a cooling signal i
[Test Measurement]
Temperature detection wireless transmitting and receiving system based on FPGA control
Implementation of baseband transmission in WCDMA system based on DSP+FPGA
Introduction With the rapid development of the Internet and the increasing demand for various wireless services, the current wireless communication network that mainly carries single voice services has become less and less suitable for people's needs. Therefore, the third-generation mobile communication system (IMT-2
[Embedded]
Implementation of baseband transmission in WCDMA system based on DSP+FPGA
FPGA-based LCD display remote update
  1 Project Background   1.1 Research Background   The application of LCD display screens is becoming more and more widespread, and the number is increasing. LCD display screens are widely used and are everywhere. From various household electrical appliances to military equipment. More commonly, they are used in v
[Power Management]
FPGA-based LCD display remote update
Design and implementation of pseudo-code ranging circuit based on FPGA
1 Introduction Field Programmable Gate Array (FPGA) uses hardware circuits to complete the algorithm process. On the one hand, it solves the system overhead problem and provides conditions for improving the overall performance of the system. On the other hand, due to the reconfigurable characteristics of static RAM-
[Embedded]
Design and implementation of pseudo-code ranging circuit based on FPGA
Design of Power Fiber Signal Analyzer Based on ARM and FPGA
With the expansion and complication of power networks and the advent of regional interconnection trends, the behavior of power systems will become more and more complex. The applicability of some original assumptions and simplified models will be further challenged and tested. In this case, rich and detailed field mea
[Test Measurement]
Design of Power Fiber Signal Analyzer Based on ARM and FPGA
Mid-range FPGA process drops to 28nm FD-SOI technology for Lattice's new platform
The high-end FPGA market is dominated by two giants, Xilinx and Intel, and Lattice has hardly ever set foot on this mountain. So how did it become the world's third largest FPGA manufacturer? This year, Xilinx and Intel competed for the title of "World's Largest FPGA", and released two 16nm and 14nm FPGA chips respe
[Mobile phone portable]
Mid-range FPGA process drops to 28nm FD-SOI technology for Lattice's new platform
Technical characteristics and differences of ARM, DSP and FPGA
ARM (Advanced RISC Machines) is a well-known company in the microprocessor industry. It has designed a large number of high-performance, low-cost, low-energy RISC processors, related technologies and software. The ARM architecture is the first RISC microprocessor designed for the low-budget market. It is basically t
[Microcontroller]
Research on circuit-level protection technology against DPA attacks based on FPGA platform
0 Introduction In recent years, Field Programmable Gate Array (FPGA) has been widely used due to its high performance, low price, high development speed, convenient programming, etc. However, DPA (Differential Power Analysis) attacks on FPGA have become one of the main threats to information security in
[Security Electronics]
Research on circuit-level protection technology against DPA attacks based on FPGA platform
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号