Ifft of dirac function

Hi all,
I have come across a problem where I need to do the ifft of dirac functions to get my cosine function back but it doesn't come out. Can any one help plz. Here is what I did
x = -1:0.1:1; f = cos(2.*pi.*x); plot(x,f);% this gives me plot of cosine
%Now I take the fourier of cosine k = -10:0.1:10; F = (1/2).*(dirac(k - 1) + dirac(k+1)); Fifft = ifft(ifftshift(F)); plot(k,Fifft);
The problem is that what I get back doesn't look anything like cosine. Thanks.

Antworten (0)

Gefragt:

Ali
am 2 Mär. 2012

Community Treasure Hunt

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

Start Hunting!

Translated by