Extracting phase information of a signal buried in noise using FFT
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Jan
le 5 Juil 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)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Spectral Measurements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!