时域离散信号/系统(matlab)
发布时间
阅读量:
阅读量
例一
该系统的差分方程与输入信号各自
y(n)+0.5y(n−1)=x(n)+2x(n−1)
x(n)=\{1,2,3,4,5,6\}
采用递推方法计算该系统的零状态响应
clc
close all;
clear all;
xn=[1,2,3,4,5,6,zeros(1,10)];
B=[1,2];
A=[1,0.5];
yn=filter(B,A,xn)
n=0:length(yn)-1;
stem(n,yn,'.');
axis([1,15,-5,13]);
title('System zero-state response');
xlabel('n');
ylabel('y(n)');

例二
例三
系统差分方程
y(n)-0.8y(n-1)+0.6y(n-2)=0.8x(n)
求单位脉冲响应和单位阶跃响应
clc
close all;
clear all;
B=[0.8];
A=[1,-0.8,0.6];
xn=[1,zeros(1,30)];
yn=filter(B,A,xn)
n=0:length(yn)-1;
subplot(2,1,1);
stem(n,yn,'.');
title('system unit impulse response');
xlabel('n');ylabel('yn');
xn=ones(1,50);
yn=filter(B,A,xn);
n=0:length(yn)-1;
subplot(2,1,2);
stem(n,yn,'.');
title('system unit step reponse');
xlabel('n');ylabel('yn');

例四
四组分系统T1,T2,T3,T4中,每个系统都由给定的单位脉冲响应或差分方程来表征,请确定整体系统的单位脉冲响应



单位脉冲x(n)=δ(n)
则v(n)=[h1(n)*h2(n)+h3(n)]
h(n)=T4[v(n)]
clc;
clear all;
close all;
h1=[1,1/2,1/4,1/8,1/16,1/32];
h2=[1,1,1,1,1,1];
h12=conv(h1,h2)
n=0:99;
h12=[h12,zeros(1,89)];
subplot(2,1,1);
stem(n,h12);title('convolution of h1 and h2');
xlabel('n');ylabel('h12');
%unit impulse response, x(n)=δ(n)
y3=[0.25,0.5,0.25,zeros(1,97)];
vn=h12+y3;
A=[1,-0.9,0.81];
B=[1,1];
hn=filter(B,A,vn);
subplot(2,1,2);
stem(n,hn);title('unit impulse response h(n)');
xlabel('n');ylabel('h(n)');

全部评论 (0)
还没有任何评论哟~
