当前位置:网站首页>Integrated design of signal processing systems - Design of solver functions (continuous and discrete time systems)
Integrated design of signal processing systems - Design of solver functions (continuous and discrete time systems)
2022-07-26 06:36:00 【Chloroplasts don't forget to breathe】
WeChat official account : Chuangxiang diary
send out : solver
Get full report ( Including source code + result + analysis )
One 、 stay s The method of domain analysis of continuous time systems
A linear time invariant continuous time system can be described by linear constant coefficient differential equations , The time-domain analysis of the system can be reduced to the use of mathematical methods to solve the equation . stay s The method of domain analysis of continuous time systems is a computational method of indirectly solving differential equations , That is, Laplace transform is used as a mathematical tool , First, the time-domain differential equation is transformed into s Algebraic equations of fields , And then s The domain solves the image function of the response , Finally, the response image function is inversely transformed into the original time-domain function .
set up LTI The general formula of the differential equation of causal system is :
Carry out unilateral Laplace transform on both sides of the differential equation , Using the differential properties of Laplace transform , have to :
According to the differential equation of the system , Available A(s) and B(s), It can be calculated from the initial state of the system C(s), Laplace transform the system input to obtain F(s). take C(s)/A(s) The zero input response is obtained by inverse Laplace transform y_zi(t); take B(s)F(s)/A(s) The zero state response is obtained by inverse Laplace transform y_zs(t); Zero input response y_zi(t) And zero state response y_zs(t) The sum of is full response y(t).
Two 、 stay z Domain analysis of discrete-time systems
A linear time invariant discrete-time system can be described by a linear constant coefficient difference equation , The time-domain analysis of the system can be reduced to the use of mathematical methods to solve the equation . stay z The method of domain analysis of discrete-time systems is a calculation method of indirectly solving difference equations , That is to z Transform into mathematical tools , First, the time-domain difference equation is transformed into z Algebraic equations of fields , And then z The domain solves the image function of the response , Finally, the response image function is inversely transformed into the original time-domain function .
set up LTI The general formula of the difference equation of causal system is :
Take one side on both sides of the difference equation z Transformation , And make use of z Displacement formula of transformation , have to 
According to the differential equation of the system , Available A(z) and B(z), It can be calculated from the initial state of the system C(z), Input the system to z Transform to get F(z). take -C(z)/A(z) Go against z Transform to zero input response y_zi(n); take B(z)F(z)/A(z) Go against z Change to zero state response y_zs(n); Zero input response y_zi(n) And zero state response y_zs(n) The sum of is full response y(n).
3、 ... and 、MATLAB Laplace transform and z Transformation support
1、MATLAB Support for Laplace transform
Laplace transform is Laplace transform , A real number with parameters The function of is converted to a complex number of arguments s Function of , It's a linear transformation . Laplace transform is widely used in engineering technology and scientific research .
MATLAB It provides the relevant function instructions for Laplace transform and pull inverse transform laplace and ilaplace, Its specific functions and functions are as follows :
laplace(f) % return f Laplace transform of , The default argument is t, The transformation variable is s
laplace(f,transVar) % Use conversion variables transVar Instead of s
laplace(f,var,transVar) % Use independent variables var And transform variables transVar Instead of t and s
ilaplace(F) % return F Inverse Laplace transform , The default argument is s, The transformation variable is t
% If F It doesn't contain s,ilaplace Using functions symvar
ilaplace(F,transVar) % Use conversion variables transVar Instead of t
ilaplace(F,var,transVar) % Use independent variables var And transform variables transVar Instead of s and t
2、MATLAB Yes z Transformation support
z Transformation is a mathematical transformation of discrete sequences , It is often used to solve linear time invariant difference equations . Its position in discrete system is the same as that of Laplace transform in continuous system .z Transformation has become an important tool for the analysis of linear time invariant discrete systems , And in digital signal processing 、 Computer control system and other fields have a wide range of applications .
MATLAB Provided to carry out z Transformation and inversion z Transform related function instructions ztrans and iztrans, Its specific functions and functions are as follows :
ztrans(f) % return f Of z Transformation , The default argument is n, The transformation variable is z
% If f It doesn't contain n,,ztrans Using functions symvar
ztrans(f,transVar) % Use conversion variables transVar Instead of z
ztrans(f,var,transVar) % Use independent variables var And transform variables transVar Instead of n and z
iztrans(F) % return F The inverse of z Transformation , The default argument is z, Convert the variable to n
% If F It doesn't contain z,iztrans Using functions symvar
iztrans(F,transVar) % Use conversion variables transVar Instead of n
iztrans(F,var,transVar) % Use independent variables var And transform variables transVar Instead of z and n
Four 、 Design of solver function
1、 Solver for continuous time systems
1.1 The design requirements
The mathematical model of continuous time system is the following differential equation :
Please design one MATLAB function , Implement the following functions .
The input of the function is :
The output of the function is :
1.2 Design thinking 
1.3 function code ( See report for details )
2、 Solver for discrete-time systems
2.1 The design requirements
The mathematical model of the discrete-time system is the following difference equation :
Please design one MATLAB function , Implement the following functions .
The input of the function is :
The output of the function is :
2.2 Design thinking 
2.3 function code ( See report for details )
5、 ... and 、 Case solving
After many experiments , The continuous time system solver and discrete time system solver designed above can correctly solve the initial state of the excitation signal as 0 System differential equation and difference equation .
The following are several examples of verification .
Now we use the designed continuous time system solver to solve this problem , The program code is as follows :
syms s t
a=[1,5,6];b=[2,8];
ft=exp(-t)heaviside(t);
y0=[3,2];
continuous(a,b,y0,ft)
The operation results are as follows , It is consistent with the above calculation results .
Visualize the solution results ( See Appendix... For the code 3)( See report for details ):

Now we use the designed discrete-time system solver to solve this problem , The program code is as follows :
syms z n
sympref(‘HeavisideAtOrigin’,1)
a=[1,3,2];b=[1];
y0=[0,1/2];
fn= heaviside(n);
discrete(a,b,y0,fn)
The operation results are as follows , It is consistent with the above calculation results .

( Because the solution process is more complex , And the focus of the report is not on the classical method , Therefore, the solution process is not repeated here )
Now we use the designed continuous time system solver to solve this problem , The program code is as follows :
syms s t
a=[1,6,11,6];b=[1,7,8];
ft=-1exp(2t)heaviside(-t)+2exp(-4t)*heaviside(t);
y0=[1,13,-61];
continuous(a,b,y0,ft)
The operation results are as follows :
The solution result of the solver is inconsistent with the calculation result , The analysis shows that the design of this solver does not consider the initial state of the excitation signal , Therefore, such differential equations cannot be solved correctly . But I think , In practice, the excitation signal is usually causal , Therefore, it can be considered that the solver is still universal .
6、 ... and 、 Conclusion
take MATLAB Numerical calculation of 、 The organic combination of symbolic operation and Laplace transform analysis of continuous system can design the solver of differential equations of continuous time system ; take MATLAB Numerical calculation of 、 Symbolic operations and discrete systems z The organic combination of transformation analysis method can design the solver of the difference equation of discrete-time system .
Verified by examples , The solver designed above can correctly solve the initial state of the excitation signal as 0 System differential equation and difference equation , In practical applications, the initial state of the excitation signal is usually 0, Therefore, it can be basically considered that the solver designed in this course is universal . The designed solver not only simplifies a large number of manual calculations , The analytical solution of system analysis can also be obtained , Make the system analysis more simple and efficient .
in addition , For continuous time systems , When the sample points are dense enough , The data of each sample point can approximately represent the continuous signal , So use MATLAB The drawing function of , The analysis results can also be visualized , It is conducive to in-depth understanding of the analysis content .
( See the appendix in the report )
边栏推荐
- Advanced C language - archived address book (file)
- English sentence pattern reference exclusive Edition - attributive clause
- 【Day_02 0419】排序子序列
- "Harmonyos" explore harmonyos applications
- [day06_0423] C language multiple choice questions
- [specified interval inversion in BM2 linked list]
- 堆排序(heap-sort)
- [day_010418] delete public string
- 【Day05_0422】C语言选择题
- [day05_0422] C language multiple choice questions
猜你喜欢
![[1]数学建模基础入门知识](/img/29/90b1c7533e9443852758d10080e239.png)
[1]数学建模基础入门知识

输入5个学生的记录(每条记录包括学号和成绩), 组成记录数组, 然后按照成绩由高到低的次序输出. 排序方法采用选择排序

归并排序(merge_sort)

SQL optimization scheme

"Harmonyos" explore harmonyos applications

【C语言】文件操作

The "darkest hour" has not come yet. Cherish every bullet 2020-03-22

【Web3 系列开发教程——创建你的第一个 NFT(4)】NFTs 可以给你带来什么

白盒测试的概念、目的是什么?及主要方法有哪些?
![[untitled]](/img/42/5e8b62edc0aa289098425b26df2453.jpg)
[untitled]
随机推荐
Do you think you are a reliable test / development programmer? "Back to the pot"? Surface and reality
数据库中varchar和Nvarchar区别与联系
Vision Transformer 必读系列之图像分类综述
PG Vacuum 杂谈之 auto vacuum
Go channel
JVM class loading and GC garbage collection mechanism
【Day_05 0422】统计回文
Database and the future of open source
[nanny level] package volume optimization tutorial
Advanced C language - archived address book (file)
The "darkest hour" has not come yet. Cherish every bullet 2020-03-22
【图像去噪】基于双立方插值和稀疏表示实现图像去噪matlab源码
[day04_0421] C language multiple choice questions
Should we test the Dao layer?
Upgrade appium automation framework to the latest 2.0
Show you the principle of IO multiplexing (select, poll and epoll)
堆排序(heap-sort)
Force deduction 5: Longest palindrome substring
Force buckle - 4. Find the median of two positive arrays
【图像隐藏】基于混合 DWT-HD-SVD 的数字图像水印方法技术附matlab代码