连续时间LTI系统的时域分析
连续时间系统零状态响应的数值计算
系统函数模型
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’)