Extracting phase information of a signal buried in noise using FFT
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
First Last
am 30 Jun. 2017
Kommentiert: First Last
am 16 Jul. 2017
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
Akzeptierte Antwort
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)
Siehe auch
Kategorien
Mehr zu Spectral Measurements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!