Extracting phase information of a signal buried in noise using FFT

조회 수: 3 (최근 30일)
First Last
First Last 2017년 6월 30일
댓글: First Last 2017년 7월 16일
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
First Last
First Last 2017년 6월 30일
Any signal! Can you please show me an example?

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2017년 7월 5일
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)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by