0 Introduction
FIR digital filter plays a very important role in various applications of digital signal processing. It can provide ideal linear phase response, obtain constant group delay over the entire frequency band, and thus obtain zero distortion output signal. At the same time, it can be implemented with a very simple algorithm. These advantages make FIR filter the first choice for design engineers. When using hardware description languages such as VHDL or VerilogHDL to design digital filters. Since the program writing often cannot achieve good optimization, the filter performance is average, and the use of debugged IP Core needs to be purchased from Al-tera. Here, a FPGA design method based on DSP Builder is used to make the FIR filter design relatively simple and easy, and can meet the design requirements.
1 Introduction to FIR Filter
1.1 FIR filter principle
For a FIR filter system, its impulse response is always of finite length. The most specific FIR filter can be expressed as follows:
Where r is the number of taps of the FIR filter; x(nr) is the delayed, r-tap input signal; b(r) is the number of taps of the rth level (unit impulse response); M is the order of the filter; y(n) represents the output sequence of the filter. The filter is to seek an achievable system function H(z) so that its frequency response H(ejω) satisfies the desired frequency domain signal, which can also be expressed in the form of convolution:
y(n)=z(n)*h(n)
A typical direct type I FIR filter is shown in Figure 1, and its output sequence y(n) satisfies the following equation:
1.2 Design requirements
The digital filter is actually a linear non-time-varying discrete system implemented by finite precision algorithm. Its design steps are to first determine its performance indicators according to the needs, design a system function h(n) to approximate the required performance indicators, and the coefficient calculation of the filter can be completed with the help of Matlab's powerful computing function and ready-made filter design tools, and finally implemented by finite precision algorithm. The design indicators of this system are: design a 16-order low-pass filter, select the sampling frequency Fs of the analog signal as 5 kHz, require the cutoff frequency Fc=1 kHz of the signal, and the bit width of the input sequence is 9 bits (the widest bit is the sign bit). The excitation source is a mixed signal of two signals with an amplitude of 27 and a frequency of 800 Hz and 1 600 Hz.
2 Design of FIR filter based on DSP Builder
2.1 Introduction to DSP Builder
DSP Builder is a system-level design tool for DSP development launched by Altera Corporation of the United States. It integrates Matlab and Simulink DSP development software in the QuartusⅡ design environment. The Matlab tool used in the past was only used for modeling DSP algorithms and simulation based on pure mathematics. Its mathematical model could not directly generate practical program code for the hardware DSP application system, and the results of simulation tests were often based on mathematical algorithm results. The traditional hardware description language-based design required by the previous FPGA was quite cumbersome because it took into account the connection between the delay of FPGA hardware and the VHDL recursive algorithm, as well as the complement operation and product result interception. As for DSP Builder, as a Simulink toolbox of Matlab, it enables the DSP system designed with FPGA to be modeled and simulated at the system level through the graphical interface of Simulink. The design model can be directly converted to VHDL hardware description language, and automatically call QuartusⅡ and other EDA design software to complete synthesis, netlist generation, device adaptation and even FPGA configuration download, so that the system description and hardware are organically integrated, fully reflecting the characteristics and advantages of modern electronic technology automation development. [page]
2.2 Design of FIR filter
2.2.1 FIR filter parameter selection
The filter designed by simulation using FDAtool, a filter design tool provided by Matlab, can meet the required FIR filter amplitude-frequency characteristics. Since floating-point decimals are difficult to implement in FPGA and the cost is too high, the filter coefficients and input data need to be converted into integers. The quantized system can be directly converted in the Matlab main window. For the input data, the gain multiplied by 28 is converted into integer input using the Altbus control bit width.
2.2.2 Establishment of FIR filter model
According to the principle of FIR filter, FPGA can be used to implement FIR filter circuit. The first step of DSP Builder design process is to input the design in Matlab/Simulink, that is, to create an MDL model file in Matlab's Simulink environment, and to call the graphic modules in DSP Builder and other Simulink libraries in a graphical way to form a system-level or algorithm-level design block diagram, as shown in Figure 2.
2.2.3 Simulation in Simulink and Generation of VHDL Code
After completing the model design, you can simulate the model in Simulink first, and you can view the intermediate results of each step through the oscilloscope module in Simulink. The input signal uses the superposition of two sinusoidal signals with the same amplitude of 800 Hz and 1 600 Hz. The simulation results are shown in Figure 3. It can be seen from the simulation waveform that after passing through the filter, the 1 600 Hz signal can be well filtered out.
Double-click SignalCompiler to analyze the above design model, select the corresponding chip, and "translate" the above design module diagram file into VHDL language.
2.2.4 RTL simulation with Modelsim
The simulation in Simulink is of the nature of system verification, which is a simulation of the mdl file, and does not simulate the generated VHDL code. In fact, the generated VHDL describes the RTL level, which is for the specific hardware structure, while the model simulation in Matlab's Simulink is at the algorithm level. There may be differences in software understanding between the two, and the converted VHDL code implementation may not be completely consistent with the situation described by the mdl model. This requires functional simulation of the generated RTL-level VHDL code, and the simulation results are shown in Figure 4.
The simulation results show that the simulation results in Modelsim are basically consistent with those in Simulink, and the filter has a good filtering effect. It can be seen that after the input sine wave is digitized, the analog waveform can be restored in Modelsim. It meets the design requirements and can be used for hardware design in the QLtortusⅡ environment.
2.2.5 Implementation of filter on FPGA
In the QuartusⅡ environment, open the QuartusⅡ project file created by DSP Builder, and simulate again in QuartusⅡ, so that you can see the timing waveform that meets the requirements. Then specify the device pins, compile, and finally download to the FPGA device, you can test the hardware, add the clok signal and enable signal, use the signal generator to generate the required two sine signals of different frequencies, and you can see the filtered results on the oscilloscope. If you need to design different filter circuits, you only need to modify the FIR filter model file to achieve it. This not only avoids the tedious VHDL language programming, but also facilitates adjustment.
3 Conclusion
When developing digital filters using FPGA, using DSPBuilder as a design tool can speed up the process. Of course, in actual applications, the converted VHDL may be further optimized due to the influence of accuracy, speed and device selection.
Previous article:AM Broadcast Signal Monitoring System Based on DSP and FPGA
Next article:IIR Digital Filter Design - Implementing Arbitrary Order IIR Digital Filters on FPGA
Recommended ReadingLatest update time:2024-11-16 17:42
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- How should the chassis ground of a high-speed interface connector be designed?
- SX1278LORA Module FAQ
- What effect does it have if a transistor is connected in parallel behind the differential line and a 10 ohm resistor is connected in series?
- Analysis of the characteristics of nrf24l01 wireless module
- A classic analog circuit worth collecting
- LM3644 Application Guide for Industrial Scanning
- [GD32E503 Review]——06. Detecting PT100 sensor temperature value through differential ADC
- A creative design of an electronic paper display clock by a foreign netizen
- LLC circuit to achieve ZVS
- TI's DSP OS running problem