Inconsistency when using IFFT with a real signal
2 views (last 30 days)
Show older comments
Hi,
I am having a strange problem with a small snippet of code that takes the fft of a real input signal, and using one half of its spectrum, recreates the signal by exploiting conjugate symmetry. The problem I'm facing is that I'm not getting a result identical to the input.
len = length(pi);
%Nyquist point for a signal of even length
halfLen = length(pi)/2 + 1;
PI = fft(pi);
PO(1:halfLen) = PI(1:halfLen);
%Exploit conjugate symmetry of the real input signal
PO(halfLen+1:len) = fliplr(conj(PO(2:halfLen-1)));
%Taking IFFT should give same signal as pi
po = ifft(PO);
Both po and pi should be identical, but they are within 1e-10 of each other which is causing colossal errors at high frequencies.
A simple bit of code but I have not been able to figure out why po ≠ pi. Any input is appreciated!
Thanks.
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Transforms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!