为什么当我添加我的 heaviside 时振幅会改变
why amplitude changes when i use addition of my heaviside
我已经单独定义了每个函数并绘制了它,然后添加了这些函数,然后使用 subplot 将它们全部绘制在一起。
%with using heaviside
clc;clear
t=-5:1/1000:+5
u1=heaviside(t-2)
u2=heaviside(t+1)
u3=heaviside(t+4)
X=u1+u2+u3
subplot(411)
plot(t,u1,'r');grid on
subplot(412)
plot(t,u2,'r');grid on
subplot(413)
plot(t,u3,'r');grid on
subplot(414)
plot(t,X,'r');grid on
在您的例子中,X
是具有不同时移的 3 个 heaviside
函数的总和,这意味着它的总值为 3*1
(对于 t
到无穷大)。
如果你想让 3 步函数 X
的振幅为 1,你必须除以 3。
clc;clear
t=-5:1/1000:+5;
u1=heaviside(t-2);
u2=heaviside(t+1);
u3=heaviside(t+4);
X=(u1+u2+u3)/3;
我已经单独定义了每个函数并绘制了它,然后添加了这些函数,然后使用 subplot 将它们全部绘制在一起。
%with using heaviside
clc;clear
t=-5:1/1000:+5
u1=heaviside(t-2)
u2=heaviside(t+1)
u3=heaviside(t+4)
X=u1+u2+u3
subplot(411)
plot(t,u1,'r');grid on
subplot(412)
plot(t,u2,'r');grid on
subplot(413)
plot(t,u3,'r');grid on
subplot(414)
plot(t,X,'r');grid on
在您的例子中,X
是具有不同时移的 3 个 heaviside
函数的总和,这意味着它的总值为 3*1
(对于 t
到无穷大)。
如果你想让 3 步函数 X
的振幅为 1,你必须除以 3。
clc;clear
t=-5:1/1000:+5;
u1=heaviside(t-2);
u2=heaviside(t+1);
u3=heaviside(t+4);
X=(u1+u2+u3)/3;