下面展示了指数函数与正弦函数卷积的理论结果。
当我直接使用Matlab绘制函数时,得到的结果如下:
然而,使用Matlab conv命令得到的结果如下:
这两个图看起来很相似,但并不完全相同,可以看到它们的刻度不同。Matlab的结果是理论结果的十倍。为什么会这样呢?
Matlab代码在此处。
Matlab代码在此处。
clc;
clear all;
close all;
t = 0:0.1:50;
x1 = exp(-t);
x2 = sin(t);
x = conv(x1,x2);
x_theory = 0.5.*(exp(-t) + sin(t) - cos(t));
figure(1)
subplot(313), plot(t, x(1:length(t))); subplot(311), plot(t, x1(1:length(t))); subplot(312), plot(t, x2(1:length(t)))
figure(2)
subplot(313), plot(t, x_theory); subplot(311), plot(t, x1(1:length(t))); subplot(312), plot(t, x2(1:length(t)))