Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Why do I get the wrong phase after I apply FFT to my sinusoidal?

1 visualización (últimos 30 días)
Nina
Nina el 27 de Feb. de 2013
I have a function x = A0*(1+sin(w*t + phi)); all the variable are known. The time vector is provided also. When I take a vector of the solution x do an fft on it, I get the wrong phi that I started with. For example, my phi = 45, I get back 180. Here is what i have so far:
x=[.....];
t=[.....];
m=ceil(log2(length(x)));
fft_A=fft(x,2^m);
fft_A = 2*fft_A/length(x);
%Find the phase angle
FT_power2 = abs(fft_A).^2;
FT_phase2= ((unwrap(angle(fft_A))))*(180/pi);
[c2,i2] = max(FT_power2);
phase = (FT_phase2(i2))
What am I doing wrong? thank you.
PS: I understand that I have a DC offset of A0 but I am not sure how to deal with it and what to expect.
  2 comentarios
Nina
Nina el 27 de Feb. de 2013
I believe my issue is finding the correct bin where the amplitude and phase would fall into, is there a general way to do that if you supposidly do not know the information before hand ?(i.e frequency,amplitude...)

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by