how to find fft
이전 댓글 표시
hai frnds,
i have 7653 values for bond length of OH bond in water during spectral analysis.so now the next step is to find the fft of the bond length.value of time varies as (0:.725:5548.425).please generate the code for me.I am stucked
댓글 수: 1
Behind The Sciences
2016년 4월 18일
Have a look to this post to understand what you want to do: http://www.behindthesciences.com/signal-processing/fouriertransformtheory
Then,have a look to this post to get code that you need: http://www.behindthesciences.com/signal-processing/fouriertransformmatlabtutorial
답변 (1개)
Star Strider
2016년 4월 18일
0 개 추천
See this documentation for the fft function. The code between the top two plot figures has everything you need to analyse and plot your Fourier transformed data.
댓글 수: 6
shilpa s
2016년 4월 18일
Image Analyst
2016년 4월 18일
Please use English. Textspeak just slows us down when we try to read and understand what you're trying to say, not to mention that it is doubly hard to understand for non-native English speakers. Try this
theFFT = fft(bondLengths);
where bondLengths is your vector of 7653 values of bond lengths.
Star Strider
2016년 4월 18일
I’ve used versions of this in my other Answers on the fft:
Fs = 1000; % Sampling frequency
T = 1/Fs; % Sample time
L = 1000; % Length of signal
t = (0:L-1)*T; % Time vector
% Sum of a 50 Hz sinusoid and a 120 Hz sinusoid
x = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);
y = x + 2*randn(size(t)); % Sinusoids plus noise
plot(Fs*t(1:50),y(1:50))
title('Signal Corrupted with Zero-Mean Random Noise')
xlabel('time (milliseconds)')
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(y,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1);
% Plot single-sided amplitude spectrum.
plot(f,2*abs(Y(1:NFFT/2+1)))
title('Single-Sided Amplitude Spectrum of y(t)')
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')
The first block of code creates the signal (you don’t need that but it explains many of the constants used in the rest of the code), the second block of code calculates the Fourier transform, and the third block of code plots it. This is all directly from the documentation I linked to.
shilpa s
2016년 4월 19일
Star Strider
2016년 4월 19일
The frequencies sort themselves.
To find the peaks and the associated frequencies, use the findpeaks function on the absolute value of the fft, just as you plotted them here.
shilpa s
2016년 4월 20일
편집: Walter Roberson
2016년 4월 20일
카테고리
도움말 센터 및 File Exchange에서 Vibration Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!