"multiplication in the time domain is convolution in the frequency domain" -- how to perform these operations with discrete data?

8 次查看(过去 30 天)
The code below compares the results of
1. multiplying two signals together, taking the fft, then computing the power
2. taking the fft of each signal, convolving the results, then computing the power
I expected these to be the same, but they are not. Can anyone tell me how to fix the code below so that the final results are identical? Part of this seems to be a scaling issue, but not all.
N=1001;
x=randn(1,N); w=randn(1,N); % random signals
% multiply then take fft
temp1=fftshift(fft(w.*x));
r1=conj(temp1).*temp1;
% take fft then do convolution
X=fftshift(fft(x));
W=fftshift(fft(w));
temp2=conv(X,W,'same');
r2=conj(temp2).*temp2;
% calculate the discrepency
d=sum(abs(r1-r2))
% plots
subplot(211);
plot(pow2db(r1))
subplot(212);
plot(pow2db(r2))
  1 个评论
Peeyush
Peeyush 2015-6-1
The following points are important to remember:
1)FFT is different from continuous time Fourier Transform. However, even the maximum amplitude of the Fourier Transform of a continuous-time cosine function is NOT EQUAL to 1; instead, it is: ∞∗π
2)The signal is truncated and sampled in order to calculate the DFT/ FFT. Thus, the maximum amplitude will be scaled by both the Sampling Frequency (Fs) and the truncated signal length. The below link explains more about it: http://blogs.mathworks.com/seth/2009/01/30/mathworks-conversations-and-the-fft/

请先登录,再进行评论。

回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by