Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

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

1 visualizzazione (ultimi 30 giorni)
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 Commenti
Nina
Nina il 27 Feb 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...)

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by