Fast Fourier Transform component detection issue
Afficher commentaires plus anciens
I want to detect the different components in a signal.
Here is an example of a signal:
Fs = 1000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 100; % Length of signal
t = (0:L-1)*T; % Time vector
X = 0;
for i = 50:50:500
X = X + sin(2*pi*i*t);
end

Then when I run the FFT:
Y = fft(X);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(L/2))/L;
subplot(4,1,2)
plot(f,P1)
title('Single-Sided Amplitude Spectrum of X(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')

This make sesne becasue my signal includes the summation of sin(2*pi*i*t) where i is frome 50 to 500
However, when I make a new signal from 50 to 600 and run the same FFT code
X = 0;
for i = 50:50:600
X = X + sin(2*pi*i*t);
end

How come I dont get the peaks at 400 and 450 anymore, even though they are still components when I add sin(2*pi*i*t) from 50 to 600?
Additionally, is there a limit to the number of components I can detect from the FFT, if I keep the Length of signal constant?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Fourier Analysis and Filtering dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!