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

5 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

Matt J
Matt J am 22 Feb. 2023
Bearbeitet: Matt J am 22 Feb. 2023
Note that conv() implements linear convolution, not circular convolution.
  5 Kommentare
Tianjia
Tianjia am 22 Feb. 2023
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.
Askic V
Askic V am 22 Feb. 2023
Thank you very much for your answer @Matt J. I also started to investigate this.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by