Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Urgent: How do I perform FFT on a time signal

조회 수: 4 (최근 30일)
Osasu
Osasu 2013년 7월 26일
I have a vibration time signal am working on. I am finding it difficult to write the code to perform fft on it. Could anyone help with it please? The length of the signal is 40000 while the sampling frequency is 20000.
Additionally, how are the length of the signal and sampling frequency arrived at?
  댓글 수: 2
Jan
Jan 2013년 7월 31일
While this question might be "urgent" for you, it is not "urgent" for all readers. Therefore it is recommended toavoid such pushing terms.

답변 (3개)

dpb
dpb 2013년 7월 26일
doc fft
Sampling frequency is set by the hardware, time then determines the length.

Youssef  Khmou
Youssef Khmou 2013년 7월 26일
편집: Youssef Khmou 2013년 7월 26일
hi, given your signal X,
Fs=2e+4;
Resolution=512;
Ts=1/Fs;
N=4e+4;
T=N*Ts;
Fx=abs(fft(X,Resolution));
Frequency=(0:Resolution-1)*Fs/Resolution;
figure, plot(Frequency(1:end/2),Fx(1:end/2)); % two sided to one side

Roule
Roule 2013년 7월 31일
편집: Roule 2013년 7월 31일
Hi, just use the following code:
fs=20000; % sampling frequency
N=40000; % length of signal
dF=Fs/N;
f=-Fs/2:dF:Fs/2-dF; %remember nyquist frequency?
plot(f,abs(fftshift(fft(<your signal>)/N)));
Hope this helps!

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by