How to find fft for part of my output? I mean after removing the initial transient of my data, I need for only x(4000:5000).

5 vues (au cours des 30 derniers jours)
x and t are vectors of 0:0.1:5000;
n = length(x);
dt = t(end)/(n-1);
Fs=1/dt ;
NFFT = n ;
y=fft(x,NFFT) ;
f=(Fs/2)*linspace(0,1,NFFT/2 +1)*2*pi;
figure(1)
subplot(2,1,1)
plot(t(4000:5000),x(4000:5000))
figure(1)
subplot(2,1,2)
plot(f,y(1:NFFT/2 +1));
figure(3)
plot(abs(f),abs(y(1:NFFT/2+1)));
Pow = abs(y(1:NFFT/2 +1)).^2;
Pow(1) = 0;
figure(4)
plot(f,Pow)

Réponses (0)

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by