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).
조회 수: 3 (최근 30일)
이전 댓글 표시
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)
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!