MATLAB: Signal power in Matlab

MATLABsignal power

hi all I'm using the functions(fft,ifft) in a matlab code,theoretically signal power must not be changed before and after transformation according to Parsaval theorem. But when calculating the signal power before and after using E{X^2},the power of the 2 signals aren't the same. please can any body helping solving this issue. Thanks

Best Answer

I'm surprised that you have a signal where you take the DFT, then you take the inverse DFT and the l2 norms are different, can you show this?
If you mean that the l2 norms are different in the time and Fourier domains, then that is expected.The way the DFT and inverse DFT are implemented in MATLAB and many other software packages, the DFT is NOT a unitary operator. You are missing a factor
x = randn(32,1);
% now compute the l2 norm in time
norm(x,2)^2
% take the Fourier transform
xdft = fft(x);
% divide by the appropriate factor
norm(xdft./sqrt(length(x)),2)^2
But again, if you are saying that the following results in a difference, I'm very surprised
x = randn(32,1);
norm(x,2)^2
xdft = fft(x);
xhat = ifft(xdft);
norm(xhat,2)^2
Related Question