斜坡函数有条长长的尾巴

考虑这个信号函数(正半轴)的画图:


很容易以为会是这样的:


这是错的。这样错在没有充分考虑到斜坡函数对正半轴的影响,它是一条射线,只要没有限定,它可以影响无限远。这里无论是第一、二、三个斜坡信号,都会对第四个的走势产生影响,使其不能按照原样描绘。

为了充分展示这一点,这里将信号逐个加上去描绘。






用 Matlab 实现的代码非常简单,首先要创建一个斜坡函数。

function y=r(t)
y=t;

而后根据时移不断相加就可以了。

t=-10:0.001:10;
y=r(t).*heaviside(t);
plot(t,y);
title('y=r(t)');
grid on;
axis([0 5 -1 2]);
y=r(t).*heaviside(t)-r(t-2).*heaviside(t-2) ;
figure(2);
plot(t,y);
grid on;
title('y=r(t)-r(t-2)');
axis([0 5 -1 2]);
y=r(t).*heaviside(t)-r(t-2).*heaviside(t-2)-r(t-1).*heaviside(t-1);
figure(3);
plot(t,y);
title('y=r(t)-r(t-2)-r(t-1)');
grid on;
axis([0 5 -1 2]);
y=r(t).*heaviside(t)-r(t-2).*heaviside(t-2)-r(t-1).*heaviside(t-1)+r(t-3).*heaviside(t-3);
figure(4);
plot(t,y);
title('y=r(t)-r(t-2)-r(t-1)+r(t+3)');
grid on;
axis([0 5 -1 2]);


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章