The design scheme of FIR digital filter is proposed , and the filter simulation is realized based on Matlab. By using the functions provided by Matlab signal processing toolbox, the appropriate window function is selected to write the program, in which the window function is selected according to the processing requirements of the actual signal and the parameters are compromised. The experiment obtains relatively ideal filter characteristics and can achieve better filtering effect. Moreover, in practical applications, only the filter parameters need to be modified according to the requirements, and combined with the corresponding changes in the program, filters with different functions can be realized. In addition, the method of designing filters using FDATool is introduced, and a variety of filters can be realized by simply modifying the parameters.
1 Digital filter and design scheme
When applying digital filters to process analog signals, the input analog signals must first be band-limited, sampled, and converted to analog/digital. The sampling rate of the digital filter input signal should be greater than twice the bandwidth of the processed signal. Its frequency response has a periodic repetition characteristic with the sampling frequency as the interval, and is mirror-symmetric at the folding frequency, i.e., 1/2 sampling frequency. The output signal of the filter must be converted to digital/analog and smoothed.
The relationship between the output value u(Kt) of the FIR digital filter and the past value u(Kt-kt) of the output is as follows:
This is a process of continuous multiplication and accumulation, which solves the problem of the filter coefficient α. The filter design can be realized by adding multiplication and addition calculations. Since the unit impulse response h(n) of the FIR filter is a finite length sequence, the filter has no instability problem. The FIR filter is generally a non-recursive structure. Therefore, when using Matlab to design, finite precision calculation is used to avoid unstable phenomena such as polarity oscillation in the recursive structure. The two common FIR filter design methods are the window function method and the frequency sampling method. Although the frequency sampling method can accurately control the frequency response of the sampling point, the transition point must be inserted in the design to improve the ripple, and the cutoff frequency is not easy to control. The transition point also needs further optimization. In contrast, the window function rule is a basic design concept and the design method is relatively mature. In addition, the functions provided in Matlab can easily realize the design of windowed linear phase FIR filters, including the more common low-pass, band-pass, high-pass and band-stop digital filters. This paper adopts the design method of combining window function with programming.
The basic idea of the window function method is to first give the ideal filter frequency response as
,
Where: ωc is the cut-off frequency; α is the sampling delay.
The required frequency response is
, the next task is to make
Approach
The windowed w(n) is truncated to the unit sampling response hd(n) (see equation (3)) of the ideal filter to obtain the h(n) to be designed.
For the FDATool design method, this paper uses Matlab to complete it by selecting appropriate parameters.
2 FIR digital filter design
2.1 Window function method to design FIR filter solution
In Matlab, window functions can be directly generated: Rectangle Window, Triangular Window, Hanging Window, Kaiser Window, etc. The window can be loaded by calling the system function. The specific calling method is as follows: calling format: w=function name (n), a rectangular window w is generated according to the length n. Generally, the normal ECG signal frequency range is within 0.05~100 Hz, which is itself a relatively weak electrical signal. When it is interfered by other organs of the body, the ECG signal will be seriously distorted. In addition, the existence of electronic device noise and 50 Hz power frequency signal must be considered. This requires to eliminate the influence of noise and interference as much as possible. The design indicators of the low-pass filter selected here are: passband cutoff frequency ωp=0.2π, stopband cutoff frequency ωs=0.3π, and minimum stopband attenuation As≥50 dB. Therefore, the transition bandwidth tr_width=ωs-ωp and the column length N=10 π/tr_width are obtained. When selecting a window function, it is generally recommended to choose a wider main lobe, which can increase the attenuation of the stopband and ensure the stability of the passband. In addition, while ensuring the minimum attenuation index of the stopband, the column length N value is appropriately increased to narrow the transition band. According to the characteristics of the minimum stopband attenuation of the window function. Only the Hamming window and the Kaiser window can provide an attenuation greater than 50 dB. In practical applications, the selection of window functions is mostly a compromise between them. The Kaiser window can compromise the main lobe width and sidelobe attenuation by changing the parameter value. The filter based on this has strong adaptability and is relatively flexible. This article adopts the Kaiser window programming design. The window function design method is to use a certain width window function to intercept an infinite pulse response sequence to obtain a finite length pulse response sequence. The design steps are:
(1) The unit impulse response hd(n) of the ideal filter is obtained by inverse Fourier transform.
(2) Determine the window function W(n) and window length N based on performance indicators.
(3) Obtain the unit impulse response h(n) of the actual filter, where h(n) is the designed FIR filter coefficient vector a(n).
The Matlab signal processing toolbox provides various window functions, filter design functions, and filter implementation functions. The design uses the function firl provided by Matlab, and programming is to directly call these functions to complete the design simply and intuitively. The calling format is: firl(n, Wn, 'ftype', Window), where n is the order, Wn is the cutoff frequency, ftype is the type of filter, and Window is the window function. The code for applying the Kaiser window is as follows:
The results of program execution are shown in Figure 1 and Figure 2.
From the filter effect diagram, the designed filter basically eliminates the influence of noise and interference, and objectively obtains the real signal. According to the filter indicators in the design scheme, the function operation can be obtained: N=68, As=59. Then increase the parameter N value. In this design, the Kaiser window function is used to perform a variety of N value changes. With the increase of N value, the transition band becomes narrower, but the minimum attenuation of the stop band does not change.
2.2 FDATool design
FDATool (Filter Design & Analysis Tool1) is a filter design and analysis tool dedicated to the Matlab signal processing toolbox. It is simple and flexible to operate, and can use a variety of methods to design FIR filters. The digital filter designed by this method can adjust the filter characteristics at any time, and the filtering results are displayed in real time in the graphics area, which reduces the workload and is conducive to further optimization of the filter design. After entering FDATool in the Matlab command window and pressing Enter, the FDATool interface will pop up. You can also select "start" → "toolbox" → "filterdesign" below the Matlab main interface. The specific parameter selection is:
(1) The filter type is lowpass;
(2) The design method is FIR, using a window;
(3) The filter order is 15;
(4) The window type is Kaiser and beta is 0.5;
(5)fs is 48 000 Hz, fc is 10 800 Hz.
Click "design filter". It is worth noting that the filter order here is 15th order, not the designed 16th order filter. This is because the constant coefficient term h(0)=0. Select "magnitude" and "phase response" from the "analysis" menu to get the characteristic display of Figure 3 and Figure 4. Select "step response" and "im-pulse" from "analysis" to get the response display of Figure 5 and Figure 6. It can be seen that the step response and impulse response of the designed FIR filter are close to the ideal state.
3 Conclusion
From the characteristic curves of Figures 1 to 4, it can be seen that the performance of the filter has basically met the requirements, and the filtering effect is quite obvious. The curve is relatively stable and can meet the design technical indicators of the weak signal filter. In particular, from the phase-frequency characteristic curve in Scheme 2, the curve passes through the origin and is a smooth straight line, indicating that it has good linear phase characteristics, which is also an important reason for choosing FIR digital filters in applications, but its actual effect still needs to be tested in practice. The accuracy of FIR amplitude-frequency characteristics is lower than that of IIR, and the order required by the filter is relatively high, but it has a good linear phase, that is, the time difference of signals with different frequency components remains unchanged after passing through the FIR filter. In addition, the shortcomings of FIR should be improved, such as the large delay of the signal. This takes into account the use of high-performance DSP devices, which can be improved to a certain extent due to their fast processing speed.
4 Conclusion
Since Matl-ah has powerful interface functions, the simulation results can be easily transplanted to DSP, CPLD or FPGA devices. In practical applications, different filters can be realized by simply modifying the filter parameters as required and making minor changes to the program, which is very practical.
Previous article:Analysis of display effects of handheld mobile devices
Next article:Touch screen operation tips
Recommended ReadingLatest update time:2024-11-16 21:45
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- 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
- Today at 10:00 am TI Award Live: Low-power wireless technology for building automation sensor applications
- EEWORLD University Hall----Live Replay: TI Sitara? Latest AM64X Platform Introduction
- [Project source code] FPGA-based digital tube font, used to display numbers on the LCD screen
- MSP430g2553 hardware UART (modification based on official routines)
- Antenna transmission line standing wave conversion conjugate matching
- Getting Started with the ST SensorTile.box Sensor Kit (5) Bluetooth Connection
- RF-Radio Frequency Understanding
- DSP28335-ePWM
- National Technology N32G430 Development Board Review Unboxing
- 【LSM6DSOX's MLC machine learning understanding】--Sharing machine learning tutorial