In digital signal processing, filtering plays an extremely important role. Digital filters are basic processing algorithms in spectrum analysis, radar signal processing, and communication signal processing applications. Currently, commonly used filter design methods generally use Matlab simulation and DSP implementation. However, this traditional design method requires a long development cycle and the design process is repeated, which is very inconvenient.
In response to this problem, the idea of a system-level design method emerged to integrate Matlab algorithm simulation and DSP implementation. In this article, Matlab Link For CCS Development Tools is used for system-level design to complete the design of the FIR filter.
1 Basic steps of FIR digital filter design
Digital filters can be divided into two types according to the time domain characteristics of their impulse response functions, namely infinite impulse response (IIR) filters and finite impulse response (FIR) filters. The FIR system is not as easy to obtain better passband and stopband attenuation characteristics as the IIR system. To obtain better attenuation characteristics, the H(z) order is generally required to be high, that is, M must be large. The FIR system has its own outstanding advantages: the system is always stable; it is easy to realize linear phase; it allows the design of multi-passband (or multi-stopband) filters. The latter two are not easy to implement in the IIR system. There are many design methods for FIR digital filters, such as window function design method, frequency sampling method and Chebyshev approximation method. With the continuous improvement of Matlab software, especially Matlab's signal processing workbox, not only is the computer-aided design of digital filters possible, but the design can also be optimized.
The basic steps of FIR digital filter design are as follows [1]:
(1) Determine technical indicators
Before designing a filter, the technical specifications of the filter must first be determined based on the actual needs of the project. In many practical applications, digital filters are often used to implement frequency selection operations. Therefore, the form of the indicator generally gives the amplitude and phase response in the frequency domain. Amplitude indicators are mainly given in 2 ways. The first is an absolute indicator. It provides requirements for the amplitude response function and is generally used in the design of FIR filters. The second type of indicator is a relative indicator. He gives the requirements in terms of decibel values. The filter design in this article takes the design of a linear phase FIR filter as an example.
(2) Approximation
After the technical indicators are determined, a target digital filter model can be established (usually an ideal digital filter model is used). Afterwards, use digital filter design methods (window function method, frequency sampling method, etc.) to design an actual filter model to approximate the given target.
(3) Performance analysis and computer simulation
The result of the previous two steps is a filter described by a differential or system function or impulse response. Based on this description, you can analyze its frequency characteristics and phase characteristics to verify whether the design results meet the index requirements; or use computer simulation to implement the designed filter, and then analyze the filtering results to judge.
2 Traditional design methods of FIR digital filters
The traditional FIR digital filter design process is divided into two parts: development design and product implementation. In the development and design part, the solution design and algorithm design and verification are completed. Matlab language is generally used for simulation. When the simulation results are satisfactory, the product implementation stage is entered. In the implementation stage, the algorithm in the development and design stage is implemented in C/C++ or assembly language, and implemented on the hardware microcontroller or DSP target board.
The following takes the low-pass filter used to filter out high-order harmonics in the power system as an example to introduce the traditional design method of designing a linear phase FIR low-pass digital filter.
2.1 Matlab simulation of FIR filter[2]
In the power analysis experiment instrument, only the harmonics below the 20th order are required to be analyzed, the harmonics above the 30th order are filtered by the anti-aliasing filter, and the 20-30th harmonics are filtered out by the digital filter. Therefore, the technical specifications of the low-pass filter of the power system are as follows: passband cutoff frequency is 1000Hz, stopband cutoff frequency is 1500Hz, passband ripple is 0.001, stopband ripple is 0.001, sampling frequency is 4000Hz, stopband attenuation Less than 50 dB, so it is more appropriate to use the Hamming window in the design.
It is very convenient to directly obtain the design of FIR filter using the special function provided by the Matlab digital signal processing software package.
First find the order N of the filter: N=ceil(n)+1, and N=28 can be calculated through simulation of related programs.
The coefficients of filter h(n) and its amplitude-frequency characteristics:
The calling format is: b=fir1 (N, wc, 'ftype', window) or b = fir2 (N, wc, m, window); compile the program and run it. Table 1 shows the calculated filter coefficients, as shown in Figure 1 The frequency response curve of the designed low-pass filter. It can be seen that the performance indicators are basically met. The coefficients of h(n) are shown in Table 1.
Input an aliasing signal to test the function of the designed filter: the input signal is a sinusoidal AC signal with frequencies f1=400Hz and f2=1800Hz.
S1=sin(400×2πt);
S2=sin(1800×2πt);
S=S1+S2
Figure 2 shows the aliasing signal waveform S=S1+S2.
Figure 3 Waveform after filtering. It can be seen that the simulation results are basically satisfactory. Then use DSP to implement the system.
Save the above system to disk and create a data file fir01.txt. The fir01.txt file generated in Matlab will be automatically converted into the Firdata.inc filter coefficient file by executing the conversion command. The conversion command is (under Matlab):! firdatafic01.txt
2.2 C54 implementation of FIR digital filter
TMS320C5416 has a strong data processing function [3]. When the addition instruction MACD with data shift is executed in a loop, once the pipeline is started, the instruction becomes a single-cycle instruction. Filter design and calculation can be completed quickly.
The design of the FIR filter obtained through the above simulation is discussed below [4]. The program flow chart is shown in Figure 4.
Prepare a symmetrical FIR low-pass filter program based on the above operations and flow chart. The source program list is omitted. Perform simulation debugging on CCS5000, use the observation window to see the following graphics, and analyze the spectrum of the input signal and output signal. The results are shown in Figure 5 and Figure 6.
The input signal is the superposition of sinusoidal AC signals with frequencies f1=400Hz and f2=1800Hz. By observing the frequency domain and time domain diagrams, we know that the low-frequency waveform in the input waveform passes the filter, while the high-frequency part is filtered out. The filter achieves the target requirements.
Although this method can design better filters. However, CCS needs to be used to save the intermediate results of the target DSP program to the hard disk of the PC, and then transfer it to the Matlab work space. Compare it with the intermediate results of the Matlab algorithm to find the result deviation in the DSP program due to design or accuracy. Repeating this process is very inconvenient.
An improved design method is proposed below.
3 Improvement methods for filter design
The idea of a system-level design method is currently proposed [5]. The core of the system-level design method is to conduct algorithm design and system-level design simulation in a unified environment, thereby effectively combining the two parts of the development process. System-level design requires a unified development environment, in which the system structure and algorithms can be described, and different levels, components, and data types of the system can be modeled. Matlab Link for CCS Development Tools appeared to complete system-level design.
3.1 Introduction to Matlab Link for CCS Development Tools
Matlab Link for CCS Development Tools (CCS Link) jointly developed by Mathworks and TI provides an interface between Matlab and CCS, that is, connecting Matlab with TI CCS and the target DSP. This tool can be used to operate the memory or register of TI DSP in the same way as Matlab variables. That is, the entire target DSP seems to be transparent to Matlab, and developers can complete the operation of CCS in the Matlab environment. Matlab Link for CCS Development Tools can support any target board that CCS can recognize, including TI's DSP, EVM boards and user-developed target DSP (C2000, C5000, C6000) boards.
3.2 System-level design discussion
The three interfaces provided by CCS Link to users are shown in Figure 7, which can complete system-level design.
3.3 System-level design method of digital filter
Use the Link for CCS IDE interface to realize the connection between CCSIDE and Matlab to design FIR digital filters. Use this connection to operate DSP applications under the control of Matlab, and use the powerful calculation analysis and visualization tools in Matlab to analyze and compare the target program. The running results greatly shorten the cycle of debugging and developing the system.
The specific design steps are as follows [6]:
(1) Select the DSP model: TMS320C5416DSP was used in the experiment;
(2) Create CCS IDE connection object;
(3) Use Matlab to load the file into CCS IDE;
(4) Operate the CCS IDE connection object in the Matlab environment;
(5) Close the CCS IDE connection object.
It can be seen from this design step that it is very convenient to operate variables or registers in DSP in the Matlab environment. In this way, the simulation debugging of the DSP program can be completed in the Matlab environment. There is no need to transfer the DSP running results back to the PC for verification like traditional development, which facilitates development and design and shortens the development cycle.
The results of the filter designed using this method are basically the same as above, except that the design process is greatly simplified, which facilitates development and design.
4. Conclusion
Applying Matlab to system-level design of DSP has greatly improved the traditional design method. Matlab's system-level design environment helps to detect errors in the early stages of design and cope with the challenges of increasing system complexity, and facilitates the design of complex DSP application systems. Compared with the traditional designed filter, the designed digital filter has a much faster speed, and the design process has been greatly simplified, which facilitates development and design.
Source: Modern Electronic Technology
Previous article:A DSP processor design based on power consumption management
Next article:Integrate motor control and power factor correction with DSP controller
- Popular Resources
- Popular amplifiers
- A review of learning-based camera and lidar simulation methods for autonomous driving systems
- Mission-oriented wireless communications for cooperative sensing in intelligent unmanned systems
- Monocular semantic map localization for autonomous vehicles
- Simulation and Modeling of Chemical Sensors Volume 5 Electro-Optical Sensors Part 1 Photocopy
- 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
- DIY a server for 5 dollars?
- [Project source code] AHT10 temperature and humidity sensor experiment based on FPGA
- Transformer and Inductor Design Handbook (4th Edition)
- Based on PSOC6 development board simulation I2C solution X-NUCLEO-IKS01A3 LSM6DSO
- Ripple test
- Top 5 most popular blog posts in 2019 - Helping 5G development
- DDS signal source based on FPGA
- Integer square root algorithm
- Combining the new 6-axis IMU with DSP to achieve high-performance motion tracking accuracy
- Six design issues for I2C isolators