信号与系统实验三___MATLAB

连续时间系统零状态响应的数值计算

在这里插入图片描述
系统函数模型

sys = t( b,a )

输出响应函数

y = lsim( sys, f, t )%sys为系统函数,f为激励函数,t为抽样向量

例3-1零状态响应

在这里插入图片描述

ts = 0; te = 5; dt = 0.01;
sys = tf( [ 1 ], [ 1 2 100 ] );%前者为激励系数后者为响应系数
t = ts : dt : te;
f = 10 * sin( 2 * pi * t );
y = lsim( sys, f, t );
plot( t, y );
xlabel( ‘Time(sec)’ );
ylabel( ‘y(t)’ );

连续时间系统冲激响应和阶跃响应

对于连续系统LTI系统的冲激响应和阶跃响应可分别用impuls和step来求解

冲击响应

y = impuls( sys, t )

阶跃响应

y = step( sys, t )

例3-2冲击、阶跃响应

在这里插入图片描述

ts = 0; te = 5; td = 0.01;
sys = tf( [ 10 ], [ 1, 2, 100 ] );
t = ts : td : te;
h = impulse( sys, t );
figure;
plot( t, h );
grid on;
xlabel( ‘Time(sec)’ );
ylabel( ‘h(t)’ );
g = step( sys, t );
figure;
plot( t, g );
grid on;
xlabel( ‘Time(sec)’ );
ylabel( ‘g(t)’ );

连续时间信号的卷积

在这里插入图片描述
在这里插入图片描述

例3-3连续系统卷积

在这里插入图片描述

dt=0.01; t=-1:dt:2.5;
f1=Heaviside(t)-Heaviside(t-2);
f2=exp(-3*t).*Heaviside(t);
f=conv(f1,f2)*dt; n=length(f); tt=(0:n-1)*dt-2;
subplot(221), plot(t,f1), grid on;
axis([-1,2.5,-0.2,1.2]); title(‘f1(t)’); xlabel(‘t’)
subplot(222), plot(t,f2), grid on;
axis([-1,2.5,-0.2,1.2]); title(‘f2(t)’); xlabel(‘t’)
subplot(212), plot(tt,f), grid on;
title(‘f(t)=f1(t)*f2(t)’); xlabel(‘t’)

课后习题

在这里插入图片描述

2

ts = 0; te = 5; dt = 0.01;
sys = tf( [ 1 3 ], [ 1 4 4 ] );
t = ts : dt : te;
f = exp( -t );
y = lsim( sys, f, t );
plot( t, y );
xlabel( ‘Time(sec)’ );
ylabel( ‘y(t)’ );

3

ts = 0; te = 10; td = 0.01;
sys1 = tf( [ 1 ], [ 1 3 2 ] );
sys2 = tf( [ 1 0 ], [ 1 2 2 ] );
t = ts : td : te;
%**********************************************************
h1 = impulse( sys1, t );
subplot(2,2,1)
plot( t, h1 );
grid on;
xlabel( ‘Time(sec)’ );
ylabel( ‘h1(t)’ );
%**********************************************************
g1 = step( sys1, t );
subplot(2,2,2)
plot( t, g1 );
grid on;
xlabel( ‘Time(sec)’ );
ylabel( ‘g1(t)’ );
%**********************************************************
h2 = impulse( sys2, t );
subplot(2,2,3)
plot( t, h2 );
grid on;
xlabel( ‘Time(sec)’ );
ylabel( ‘h2(t)’ );
%**********************************************************
g2 = step( sys2, t );
subplot(2,2,4)
plot( t, g2 );
grid on;
xlabel( ‘Time(sec)’ );
ylabel( ‘g2(t)’ );

4

Heaviside.m

function f = Heaviside(t)
f = ( t >= 0 );

运行

dt=0.01; t=-1 : dt : 4;
f1=Heaviside(t)-Heaviside(t-2);
f=conv(f1,f1)dt; n=length(f); tt=(0:n-1)dt-2;
%
*******************************************************
subplot( 2, 2, 1 ), plot(t,f1), grid on;
axis([-1,2.5,-0.2,1.2]); title(‘f1(t)’); xlabel(‘t’)
%*********************************************************
subplot( 2, 1, 2 ), plot(tt,f), grid on;
title(‘f(t)=f1(t)*f2(t)’); xlabel(‘t’)

  • 7
    点赞
  • 45
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值