Help with fourier transform properties
Afficher commentaires plus anciens
Hello everyone,
I am trying to remove a phase shift in frequency domain. I simulate a signal (cosine) and I add time delay in it and I try to reverse it in frequency domain. I do it as follows:
Fs = 800;
Time_max = 4; % seconds
t = 0:(1/Fs):Time_max-1/Fs;
delay = pi/3; % One second of delay
f = 5; %Hz
y=exp(1i*2*pi*f*t.^2);
y=real(y);
y1=exp(1i*2*pi*f*(t+pi/3).^2);
y1=real(y1);
SIZE = (length(y));
Y = fft(y,SIZE);
Y2=fft(y1,SIZE);
df = Fs/SIZE;
f1=[(0:1:SIZE/2-1)*df ((SIZE/2:SIZE-1)-SIZE)*df];
for k = 1:SIZE
L(k) = Y2(k)*exp(-(1i*2*pi*f1(k)*delay));
end
yd = real(ifft(L));
In the case that I use a normal cosine function everythig works out perfectly and I get the original yd==y .
But in this particular case of a qudratic cosine it is not working. What am I doing wrong?
I would like to thank you in advance for the suggestions. They would be very helpful.
Regards,
Ida
Réponses (0)
Catégories
En savoir plus sur Discrete Fourier and Cosine Transforms dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!