Time-domain convolution doesn't match Frequency-domain multiplication in MATLAB

3 次查看(过去 30 天)
I wonder why these two lines of codes generate very different results:
subplot(1,2,1);
semilogx(abs(X.*HPF));
subplot(1,2,2);
semilogx(abs(fft(conv(ifft(X),ifft(HPF),'same'))));
I mean, regardless of the actual values of X and HPF, spectrum derived from multiplying X and HPF should have the same results as the spectrum derived from convoluting their time-domain impulse responses (which is derived by ifft). But my results show that they are quite different. In my case x is the input signal that have a few sine wave components at different frequencies and HPF is a high-pass filter, but the two expressions should always yield the same results right? I'm confused.

采纳的回答

Matt J
Matt J 2023-2-22
编辑:Matt J 2023-2-22
Note that conv() implements linear convolution, not circular convolution.
  5 个评论
Tianjia
Tianjia 2023-2-22
I just found out another, easier way. Use cconv(x, hpf, N) and the result is correct! Thank you for reminding me of the circular and linear thing! I've been thinking about this for almost a week.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by