Filter löschen
Filter löschen

Extracting phase information of a signal buried in noise using FFT

11 Ansichten (letzte 30 Tage)
I am trying to extract the phase information of a noisy signal using fft, but unable to understand the plot obtained using 'angle' command.
fs=5000;
dt=1/fs;
StopTime =0.25; % seconds
t = (0:dt:StopTime-dt)'; % seconds
Fc = 60; % hertz
ph=30*pi/180;
x = 4*sin(2*pi*Fc*t+ph);
for i=1:length(t)
xn(i)=x(i)+randn;
end
X=fft(xn);
xx=(angle(fftshift(X)));
plot(xx)
I am unable to understand this plot. How can I get a phase spectrum showing peak with only 'ph' value?
  3 Kommentare
First Last
First Last am 30 Jun. 2017
Any signal! Can you please show me an example?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Jan
Jan am 5 Jul. 2017
See the many examples in the net to interprete the output of FFT, e.g. http://www.gaussianwaves.com/2015/11/interpreting-fft-results-obtaining-magnitude-and-phase-information/:
fs = 5000;
dt = 1/fs;
StopTime = 0.25; % seconds
t = (0:dt:StopTime-dt)'; % seconds
Fc = 60; % hertz
ph = 30*pi/180;
xn = 4*sin(2*pi*Fc*t+ph) + randn(size(t));
N = length(t);
X = 1/N * fftshift(fft(xn));
df = fs/N; % frequency resolution
f = (-N/2:N/2-1) *df; % ordered frequencies
P = atan2(imag(X), real(X)) * 180/pi; % Too noisy to see the peaks
figure;
plot(f, P);
Y = X;
Y(abs(Y) < 0.1) = 0; % Reduce noise
P2 = atan2(imag(Y), real(Y)) * 180/pi;
figure;
plot(f, P2)

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by