Adaptive filtering algorithm implemented by matlab

Introduction to MATLAB language

MATLAB is a large-scale mathematical computing application system developed by MathWorks, Inc., which provides powerful matrix processing and drawing functions. It is easy to use, highly reliable, and flexible, so it is used by scientists and engineers worldwide. Widely used by college students and graduate students, it has become the leading software for scientific research and engineering applications in the international market. Mastering MATLAB and using it to solve theoretical and applied problems has become a skill that every scientific research and engineering technician should possess.

MATLAB is the abbreviation of Matrix Laboratory, one of the most popular and powerful technology applications and programming languages. The MATLAB language has the following features:

1, powerful: numerical calculation and symbolic calculation, calculation and programming visualization, unified processing of numbers and text, offline and online calculation;

2, the interface is friendly, the language is concise: the complex matrix is ​​used as the calculation unit, and the instruction expression is similar to the mathematical expression, which is a calculus language;

3, open: more than 70 powerful toolbox, covering a wide range, can complete digital image processing, system simulation, system identification, fuzzy control, neural network modeling, signal processing, robust control, nonlinear control , optimization theory, statistical analysis, etc.

MATLAB has become an essential software for computer-aided analysis, design, simulation and teaching of applied disciplines. Toolbox functions provide a powerful tool for research and engineering applications in a variety of fields.

The basic function library of MATLAB system has elementary functions, elementary matrix and matrix transformation, numerical linear algebra including algebraic equations and matrix eigenvalue problems, polynomial operations and root finding, data analysis and Fourier transform, and some special matrix functions. Mathematical functions and many other things.

MATLAB also includes a series of professional solving tools called TOOLBOX. The toolbox is actually a special function library developed by MATLAB for different disciplines and different professions to solve numerical calculation problems in various fields, including data acquisition toolbox, signal processing toolbox, image processing toolbox, wavelet analysis toolbox, Control toolbox, etc. With the continuous upgrading of MATLAB, the functions of the included toolbox are more and more abundant, and the scale is getting larger and larger. Therefore, the application is more and more extensive, and it has become a powerful tool for various professional researchers and engineering technicians.

The completion of a graphical interface is ultimately accomplished through the operation of various control objects in the graphical interface, and these operations must be performed through the execution of function code in Matlab. The function code can be compiled by writing a callback function, and when the instruction required to be executed is relatively simple, the code of the control can be directly written in the "CallBack" attribute; when the instruction required to execute is relatively long, the function code can be used. Put it in a custom M file, write its file name directly in "CallBack", or write it directly in the master file. When the control is operated, the system will automatically execute the required execution in "CallBack". content.

In this design, the method is directly written in the master file. Click the control that needs to write the program in the GUI interface, then right click and a right-click menu will appear, then select the Callback option to enter the master directly. M file, and the system will automatically generate the statement.

At present, MATLAB has become one of the most popular softwares in the world. In addition to traditional interactive programming, it also provides rich and reliable matrix computing, graphics rendering, data processing, graphics processing, convenient windows programming and other convenient tools. Various practical toolboxes based on MATLAB have appeared, which are widely used in the fields of automatic control, image signal processing, biomedical engineering, language processing, radar engineering, signal analysis, vibration theory, time series analysis, modeling, optimization design, etc. .

Algorithm implementation design

The main content of this topic is to implement adaptive filter design on MATLAB. Specific content of the topic

In order to utilize the GUI interface, a filter selection interface, a parameter input interface, a result analysis diagram, and the like are designed. The filter design will implement both the LMS algorithm and the RLS algorithm using two algorithms. The basic design block diagram of the algorithm implementation is shown in Figure 4.
Adaptive filtering algorithm implemented by matlab

GUI interface design

Since this paper is to implement two different algorithms, the GUI interface design can give people a better and more intuitive effect. At the same time, the two algorithms will have different values ​​in the parameters. Therefore, in the software design, I receive the filter design index value input by the user through the text edit box control, which makes it easier for us to adjust different parameters. The value is observed experimentally to ensure the best state of the filter. In addition, Matlab provides a framework for GUI control programs by creating application M files. All the code is included in the application M file, that is, after the design of the graphical interface is completed, the main work of the application design is the design of the control callback function. The main interface of the adaptive filtering algorithm is shown in Figure 5.

Adaptive filtering algorithm implemented by matlab

Implementation of LMS algorithm

The flow chart of the LMS algorithm implementation is shown in Figure 6.

Adaptive filtering algorithm implemented by matlab

In the figure, w(k) is the filter filter coefficient vector estimate, w(k+1)=w(k)-u, u is a control factor, which is used to control the convergence speed and stability, u is too large Unstable, u is too small and the convergence speed is very slow. Usually 0 "u"1/max, max is the largest eigenvalue in R. (k) is the error gradient. It is very complicated to directly calculate (k)=J(w)/w. Generally, the square of the error is directly used as the mean square error E|e(k)2 estimated value (k). Since E{(k)}=k indicates that (k) is an unbiased estimate.

Adaptive filtering algorithm implemented by matlab

Until it is calculated that the expected value of (e)k is reached, or (w)k is stable.

According to the value of u, the LMS algorithm can be divided into the following three types:

Adaptive filtering algorithm implemented by matlab

Small household appliances

tcl , https://www.tclgroupss.com

Posted on