Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
Nina
Nina le 27 Fév 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 commentaires
Nina
Nina le 27 Fév 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...)
Matt J
Matt J le 27 Fév 2013

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by