finding out phase shift in time domain from FFT result
63 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sridhar
el 3 de Feb. de 2014
Comentada: Shrikant
el 16 de Oct. de 2015
Hallo, I have a signal represented by a sum of sinusoids (each having a different frequency and different phase shifts in the time domain). I do an FFT in matlab and get the amplitude spectrum of the wave. But from the phase spectrum i am not able to correlate the phase angles. (angle(signal) gives a different angle from what I expect.. for example if my 3rd harmonic sinus is 50 degress phase shifted, i get something irrelevant like 90 degress) My application would be, I have a random signal and I need to remove only one frequency component from the signal. If I don't have the time-phase shift of that frequency component, then I cant remove it from the signal. How do I get the phase angle from FFT?
0 comentarios
Respuesta aceptada
Wayne King
el 3 de Feb. de 2014
Editada: Wayne King
el 3 de Feb. de 2014
You can get the phase from the output of fft()
Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*100*t-pi/4)+cos(2*pi*200*t-pi/2);
xdft = fft(x);
angle([xdft(101) xdft(201)])
but you have to keep in mind that:
1.) Phase is only defined modulo 2*pi
2.) Additive noise (if it is white) occurs at all frequencies so it will affect the phase.
You can see from the example above, the phase is correctly identified at 100 and 200 Hz.
Also, I don't understand your statement:
"I have a random signal and I need to remove only one frequency component from the signal. If I don't have the time-phase shift of that frequency component, then I cant remove it from the signal. How do I get the phase angle from FFT?"
If you really are just removing one sinusoidal component, why do you need the phase, you just need to know the DFT bin of the "positive" and "negative" frequency component.
Remove 200 Hz.
N = length(xdft);
conjbin = N-201+2;
ydft = xdft;
ydft([201 conjbin]) = 0;
y = ifft(ydft);
plot(y) % 200 Hz is removed
3 comentarios
Shrikant
el 16 de Oct. de 2015
Hey Wayne, Can you tell me why did you put 101 as your frequency instead of 100? This does not work for sinusoidal...
Más respuestas (2)
Zohaib
el 29 de Ag. de 2014
Hello Wayne king .. need your lil help bro
kidnly tell me how to calculate phase of a signal which is summation of four sinusoidal signal .. thr is phase shift due to mechanical vibrations .. i want to find phase shift of each component of signal .. kindly help ?
0 comentarios
Ver también
Categorías
Más información sobre Spectral Measurements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!