Using ifft to Recover Cosine from Two Delta Impulses
Show older comments
EDIT: *code removed*
The recovered cosine is different from the original one. The reocvered one is the absolute value of the original one. Where am I going wrong?
Accepted Answer
More Answers (1)
Star Strider
on 6 Mar 2015
One reason the recovered cosine is different from the original one is that it isn’t the original one:
x_2=cos(2*pi*(500+50*S)*t);
x=x_2+exp(-200*abs(t));
After taking the forward and reverse Fourier transforms, you’re comparing ‘x_2’ as your original signal, with ‘z’, a filtered version of ‘x’. If you plot both of these original signals, you will see that they are quite definitely not the same, so you wouldn’t expect their reconstructions to be the same.
The fftshift and ifftshift operations may also be causing problems. When I removed both, I got much more faithful reconstructions than I did with them included.
Categories
Find more on Transforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!