Application of MATLAB in signal and system

. Signal and system course is an important professional basic course for electronic information and communication majors. Signal and system are abstract concepts, which are described by mathematical models. In daily life, simple signals can be calculated or drawn manually, but complex signals are difficult to be accurately processed. Matlab contains graphics processing and symbol operation functions, which provides us with powerful tools to solve the above problems. This paper will introduce how to use Matlab to express, calculate and process signals, and realize the systematic analysis of signals.


Introduction to matlab
Matlab is the abbreviation of matrix laboratory.MATLAB is a set of high-performance numerical calculation and visualization software launched by MathWorks company in 1984.It integrates numerical analysis, matrix operation, signal processing and graphic display.It can be easily applied to mathematical calculation, algorithm development, data acquisition, system modeling and simulation, data branch and visualization, scientific and engineering drawing Application software development, etc.With its powerful data processing ability and rich toolbox, Matlab makes its programming extremely simple, which can greatly shorten the application development cycle and improve the programming efficiency.At present, MATLAB has developed into the most popular and widely used scientific and engineering computing software in the world.It is widely used in automatic control, mathematical operation, image signal processing and other industries.It is also an important tool for teaching and research in universities and research departments at home and abroad, It is internationally recognized as the best technology application software by IEEE.
Its main features are: (1) Efficient numerical calculation and symbolic calculation functions can free users from complicated mathematical operation and analysis; (2) It has complete graphics processing function to realize the visualization of calculation results and programming; (3) Friendly user interface and natural language close to mathematical expressions make it easy for scholars to learn and master; (4) It has application toolboxes such as signal processing toolbox and communication toolbox with rich functions, providing users with a large number of convenient and practical processing tools.Matlab's powerful numerical analysis and visualization of calculation results, as well as the auxiliary teaching experiment of the function rich toolbox "signals and systems" provide strong support, which can easily realize the visualization teaching of basic theories and conclusions in teaching.

Application examples
Matlab's powerful graphic processing function and symbol operation function provide us with a powerful tool to realize signal visualization and system analysis.Matlab's powerful toolbox function can analyze continuous signals and connections Continuous system can also analyze discrete signals and discrete systems.
In the process of signal and system teaching, Matlab digital simulation of signal and system analysis cases can be added synchronously with the theory, which can change the boring pure principle teaching into vivid teaching closely combined with the actual signal system analysis cases, so that students can broaden their ideas and horizons and improve the teaching effect.
The following is a few specific teaching examples to illustrate that in the teaching of signal and system, the auxiliary teaching experiment using MATLAB word simulation enables students to deepen their understanding of theoretical content in active exploration and creation, and improve students' learning interest and learning efficiency.

Time domain analysis of signal
To analyze the signal in time domain, we first need to express the law of the signal changing with time with a two-dimensional curve.For simple signals, their waveforms can be drawn manually.But for complex signals, it is very difficult to draw the signal waveform manually, and it is difficult to draw accurate lines.Matlab provides a powerful tool for signal visualization and time domain analysis.

Basic operation of signal
In the process of signal transmission and processing, it is often necessary to calculate a limited number of signals.The basic operations of signals include signal addition, multiplication, translation, inversion and scale transformation.

Addition and multiplication of signals The sum of the two signals is equal to the sum of the instantaneous values of the two signals at any time. The mathematical expression is f(t)=f 1 (t)+f 2 (t).
The multiplication of two signals is equal to the sum of the instantaneous values of the two signals multiplied at any time.The mathematical expression is f(t)=f 1 (t)f 2 (t).

Inversion and Translation
The inversion of the signal is to replace the independent variable t in f (t) with -t, and the inverted signal is f (-t).From the graph, f (t) and f (-t) are symmetrical about the Y axis, that is, rotate 180 ° with the Y axis as the rotation axis.
The translation of the signal is to replace the independent variable t in f (t) with t-t 0 .At this time, when t 0 >0, f (t) moves to the right; When t 0 <0, f (t) shifts left.

Scale transformation
The scaling transformation of the signal is to replace the independent variable t in f (t) with at.The signal after scaling transformation is f (at), which is the signal obtained by stretching or compressing the original signal along the X axis.At that time, f (t) was compressed to times of the original; At that time, f (t) was stretched to times the original; Example 1 transforms f (x) =sinx into f (2x) and f (0.5x

Convolution integral
The principle of convolution integration is to decompose the signal into the sum of several impulse signals, so the response of the system is the linear superposition of the impulse responses corresponding to these impulse signals.
If there are two functions f1(t) and f2(t), their convolution integral is: To realize the convolution of continuous signals f1(t) and f1(t) with MATLAB, it is necessary to sample the two signals to obtain the discrete sequences k1 (n) and k2 (n), and call the discrete convolution summation function conv to calculate the convolution of the two discrete sequences.Its calling format is: conv(f,g) This function calculates the convolution of two vectors f and g.If the length of F is m and the length of g is n, the length of convolution is m+n-1. Example

frequency domain analysis
The Fourier transform analysis method of the system is also called the frequency domain analysis method.The frequency domain analysis method is based on the superposition and uniformity of the linear system.The basic unit of signal decomposition is the constant amplitude sine function.The total response of the system is obtained by calculating the response generated by the excitation of each unit, superimposing the response, and then transferring to the time domain.That is to seek the law of the response with frequency under different signal excitation.Generally, the calculation of Fourier transform analysis method can be divided into the following steps: (1) Calculate the Fourier transform of the excitation x (t), that is, F [x (t)] = X (w); (2) Determine the system function H (w) of the system; (3) Calculate the Fourier transform of the response Y (w) =H (w) X(W);

Complex frequency domain analysis
Complex frequency domain analysis is to transform the differential equations of continuous systems and the difference equations of discrete systems into algebraic equations in the transform domain, that is, to transform convolution operations into multiplication operations, which makes the operation more simple.Corresponding to differential equations and difference equations, the complex frequency domain analysis is s-domain and z-domain analysis respectively.

Laplace transform
Laplace transform is defined as . Where, s= σ+ j ω .It is called complex frequency.
The inverse Laplace transform is defined as .
Matlab gives the sentences for calculating the Laplace transform and its inverse transform of symbolic functions, which are respectively: b=[1 0.7]; a=[1 2 2 1]; sys=tf(b,a); zeros=roots(b) % Find zero point poles=roots(a) % Seeking pole pzmap(sys) Program running results: zeros = -0.7000poles = -1.0000-0.5000 + 0.8660i -0.5000 -0.8660iThe system has three poles and one zero.Among them, the three poles are in the left half plane, so the system is stable.

Conclusion
Matlab simulation is introduced to expose students to engineering practice.A user graphical interface LTI system simulation and analysis platform of MATLAB is designed, which can realize the realization of typical continuous time signals, the basic operation of signals, the output waveform of system zero state response, the output waveform of impulse response, etc.The application of this platform in the teaching of signals and systems can effectively improve the teaching efficiency, help students understand abstract definitions, and stimulate students' interest in learning.Introducing Matlab into the teaching of signal and system course can visualize the course content, deepen students' understanding and stimulate their enthusiasm for learning.Programming with MATLAB is relatively simple, which greatly improves the programming efficiency and makes the running image clear and intuitive.And the program compilation and execution speed is far faster than the traditional high-level language.Using Simulink to build the system model, simulate and debug the system is not only of great significance in theory, but also very useful in engineering.In short, applying MATLAB to signals and systems can achieve twice the result with half the effort.
Among them, t is the independent variable, f is the system input signal, and sys is the system model, which is used to represent the difference equation, differential equation and state equation.Sys should be obtained with the help of TF function.TF is the transfer function model, various system models and mutual conversion functions provided by MATLAB.
Then, Y (W) is inversely transformed from the frequency domain to the time domain, so as to obtain the time function principal y (t) of the zero state response.