Matlab中的多个卷积

时间:2016-06-22 04:37:55

标签: matlab plot convolution

我想用数字计算几个卷积,比如

以下代码中给出了Properties properties = PropertiesLoaderUtils.loadAllProperties("user.properties"); xyz函数:

w

这是计算和绘制多个卷积的最有效方法吗?通常在数值上整合每个卷积的函数更好吗?

修改

这是我的卷积的真实部分的情节,t = linspace(-100,100,10000); x = t.*exp(-t.^2); y = exp(-4*t.^2).*cos(t); z = (t-2)/((t-2).^2+3^2); w = exp(-3*t.^2).*exp(2i*t); u = conv(conv(conv(x,y),z),w); plot(t,u) % ??? - if we want to convolute N functions, what range should t span? vs u

而下面的海报建议的方法(使用FFT)给了我:

enter image description here

导致这种差异的原因是什么?

1 个答案:

答案 0 :(得分:2)

如果信号长度很长,fft方法会更好。

以下是一个例子。

t = linspace(-100,100,10000);

x = t.*exp(-t.^2);
y = exp(-4*t.^2).*cos(t);
z = (t-2)/((t-2).^2+3^2);
w = exp(-3*t.^2).*exp(2i*t);

L_x=fft(x);
L_y=fft(y);
L_z=fft(z);
L_w=fft(w);

L_u=L_x.*L_y.*L_z.*L_w; %convolution on frequency domain

u=ifft(L_u); 

figure(1)
plot(t,abs(u))
figure(2)
plot(t,real(u))
figure(3)
plot(t,imag(u))
相关问题