信号与系统复频域分析

  • 利用MATLAB进行部分分式展开
  • 例6-1部分分式展开法求F(s)的反变换
  • 利用MATLAB分析LTI系统的特性
  • 例6-2画出H(s)零极点并判断稳定性
  • 利用MATLAB 进行 Laplace 正、反变换
  • 例6-3Laplace正反变换
  • 离散系统零极点图
  • 例6-4函数零极点图
  • 离散系统的频率特性
  • 例6-5取离散频率点绘制幅频和相频曲线
  • 例6-6几何矢量法画频率响应

  • 课后习题
  • 2
  • 3
  • 4
  • 5


利用MATLAB进行部分分式展开

magnitude response magnitude response MATLAB_MATLAB

例6-1部分分式展开法求F(s)的反变换

magnitude response magnitude response MATLAB_matlab_02

format rat;
num=[1,2];
den=[1,4,3,0];
[r,p]=residue(num,den)

magnitude response magnitude response MATLAB_matlab_03

利用MATLAB分析LTI系统的特性

magnitude response magnitude response MATLAB_坐标轴_04


magnitude response magnitude response MATLAB_多项式_05

例6-2画出H(s)零极点并判断稳定性

magnitude response magnitude response MATLAB_坐标轴_06

num=[1];
den=[1,2,2,1];
sys=tf(num,den);
figure(1);pzmap(sys);
t=0:0.02:10;
h=impulse(num,den,t);
figure(2);plot(t,h)
title(‘Impulse Response’)
[H,w]=freqs(num,den);
figure(3);plot(w,abs(H))
xlabel(’\omega’)
title(‘Magnitude Response’)

利用MATLAB 进行 Laplace 正、反变换

magnitude response magnitude response MATLAB_多项式_07

例6-3Laplace正反变换

magnitude response magnitude response MATLAB_matlab_08

以下两种皆可实现但新版本Matlab只支持(1)-1和(2)-1

(1)-1

syms t
f=exp(-t)sin(at);
F=laplace(f)

(1)-2

f=sym(‘exp(-t)sin(at)’);
F=laplace(f)

(2)-1

syms s
ft= ilaplace(s2/(s2+1))

(2)-2

F=sym(‘s2/(s2+1)’);
ft=ilaplace(F)

离散系统零极点图

magnitude response magnitude response MATLAB_MATLAB_09


编写零极点画图ljdt.m文件

function ljdt(A,B)
% The function to draw the pole-zero diagram for discrete system
p=roots(A); %求系统极点
q=roots(B); %求系统零点
p=p’; %将极点列向量转置为行向量
q=q’; %将零点列向量转置为行向量
x=max(abs([p q 1])); %确定纵坐标范围
x=x+0.1;
y=x; %确定横坐标范围
clf
hold on
axis([-x x -y y]) %确定坐标轴显示范围
w=0:pi/300:2pi;
t=exp(i
w);
plot(t) %画单位园
axis(‘square’)
plot([-x x],[0 0]) %画横坐标轴
plot([0 0],[-y y]) %画纵坐标轴
text(0.1,x,‘jIm[z]’)
text(y,1/10,‘Re[z]’)
plot(real§,imag§,‘x’) %画极点
plot(real(q),imag(q),‘o’) %画零点
title(‘pole-zero diagram for discrete system’) %标注标题
hold off

例6-4函数零极点图

magnitude response magnitude response MATLAB_magnitude response_10

a=[3 -1 0 0 0 1];
b=[1 1];
ljdt(a,b)
p=roots(a)
q=roots(b)
pa=abs§

离散系统的频率特性

magnitude response magnitude response MATLAB_matlab_11

例6-5取离散频率点绘制幅频和相频曲线

magnitude response magnitude response MATLAB_多项式_12

A=[1 0];
B=[1 -0.5];
[H,W]=freqz(B,A,10)

继续运行如下语句,可将 400 个频率点的计算结果用 plot 语句画幅频和相频曲线

B=[1 -0.5];
A=[1 0];
[H,w]=freqz(B,A,400,‘whole’);
Hf=abs(H);
Hx=angle(H);
clf
figure(1)
plot(w,Hf)
title(‘离散系统幅频特性曲线’)
figure(2)
plot(w,Hx)
title(‘离散系统相频特性曲线’)
还可用 freqz 语句直接画图,注意区别
A=[1 0];
B=[1 -0.5];
freqz(B,A,400)

例6-6几何矢量法画频率响应

magnitude response magnitude response MATLAB_matlab_13


magnitude response magnitude response MATLAB_多项式_14


画出指定范围的零极点图调用ljdt.m编写dplxy.m

function dplxy(k,r,A,B)
%The function to draw the frequency response of discrete system
p=roots(A); %求极点
q=roots(B); %求零点
figure(1)
ljdt(A,B) %画零极点图
w=0:1pi/k:rpi;
y=exp(iw); %定义单位圆上的 k 个频率等分点
N=length§; %求极点个数
M=length(q); %求零点个数
yp=ones(N,1)y; %定义行数为极点个数的单位圆向量
yq=ones(M,1)y; %定义行数为零点个数的单位圆向量
vp=yp-p
ones(1,rk+1); %定义极点到单位圆上各点的向量
vq=yq-q
ones(1,r*k+1); %定义零点到单位圆上各点的向量
Ai=abs(vp); %求出极点到单位圆上各点的向量的模
Bj=abs(vq); %求出零点到单位圆上各点的向量的模
Ci=angle(vp); %求出极点到单位圆上各点的向量的相角
Dj=angle(vq); %求出零点到单位圆上各点的向量的相角
fai=sum(Dj,1)-sum(Ci,1); %求系统相频响应
H=prod(Bj,1)./prod(Ai,1); %求系统幅频响应
figure(2)
plot(w,H); %绘制幅频特性曲线
title(‘离散系统幅频特性曲线’)
xlabel(‘角频率’)
ylabel(‘幅度’)
figure(3)
plot(w,fai)
title(‘离散系统的相频特性曲线’)
xlabel(‘角频率’)
ylabel(‘相位’)

magnitude response magnitude response MATLAB_坐标轴_15

A=[ 1, -1/4 ];
B=[ 5/4, -5/4 ];
dplxy(500,2,A,B) %绘制系统 2π频率范围内 500 个频率点的幅频和相频特性图

课后习题

magnitude response magnitude response MATLAB_MATLAB_16

2

syms t
f= t * exp( -3 * t ) * heaviside( t );
F=laplace(f);

3

syms s
ft= ilaplace( ( s^2 + s + 2 ) / ( 3 * s^3 + 5 * s^2 + 4 * s - 6 ) );

4

num=[1, 1, 2];
den=[3, 5, 4, -6];
sys=tf(num,den);
figure(1);pzmap(sys);
t=0:0.02:10;
h=impulse(num,den,t);
figure(2);plot(t,h)
title(‘Impulse Response’)
[H,w]=freqs(num,den);
figure(3);plot(w,abs(H))
xlabel(’\omega’)
title(‘Magnitude Response’)

magnitude response magnitude response MATLAB_MATLAB_17

5

A=[ 1, 0, 0, 0 ];%分母多项式
B=[ 1, 5, 5, 1 ];%分子多项式
[H,W]=freqz(B,A,50)