Inverse fourier transfer of cos function with time shift
Mostrar comentarios más antiguos
Hi there,
I'm creating a fourier transfer of a simple cos function with a time shift of pi, and then trying to invert it. For some reason, the graph of the inversion has a much smaller amplitude although the magnitude and phase look ok. Here's what I've tried:
dt = .001;
t = 0:dt:50;
x1 = cos(4*pi*t);
Wmax = 2*pi*20;
K = 2000;
w = (0:K-1) * Wmax / K;
X1 = x1 * exp(-j * t' * w) * dt;
Y1 = x1 * exp(-j * t' * (w-pi)) * dt;
y1 = 1/(2*pi) * Y1 * exp(j * w' * t) *dt;
mag_X1 = 2 * abs(X1);
phase_X1 = angle(X1);
mag_Y = 2 * abs(Y1);
phase_Y = angle(Y1);
subplot(3,2,1);
plot(t, x1);
xlabel('time');
ylabel('x(t)');
axis([0 5 -1.5 1.5]);
title('time domain');
grid on;
subplot(3,2,2);
plot(t, y1);
xlabel('time');
ylabel('y(t)');
axis([0 5 -1.5 1.5]);
title('time domain');
grid on;
Not sure what's going on? Can somebody please help?
Respuesta aceptada
Más respuestas (1)
Paul
el 22 de Mzo. de 2025
0 votos
Hi Matt,
Keep in mind that you are inherently dealing with a windowed cosine, x1(t) = cos(4*pi*t)*w(t), where w(t) = 1 for 0 <= t <= 50 and 0 otherwise.
a) The Fourier transform of that windowed cosine has significant content at negative frequencies, but X1 is only computed for positive frequencies.
b) Is Y1 supposed to be the Fourier transform of y1(t) = x1(t-pi)? If so, I don't believe that's the correct expression for Y1.
c) because of (a), essentially half of Y1 is missing (the portion due to negative frequencies) so y1 won't be correct. In addition, as pointed out by @TED MOSBY, the variable of integration for y1 is w, so the sum should be multiplied by dw.
Categorías
Más información sobre Discrete Fourier and Cosine Transforms en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
