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개)

Star Strider
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
shilpa s 2016년 4월 18일
omg i cant see the file.plz can u provide that for me,,if u dont mind
Image Analyst
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
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
shilpa s 2016년 4월 19일
again i am stucked.my ultimate aim is to find the frequency at which peaks occurs in the IR spectrum of water.so i have two bondlengths say 'd1' and 'd2'.I have 7653 frames and time difference between adjacent frame is 30 atomic units (.726fs).when i do fft what should be the value of sampling frequency and after all i dont have any wave function.What i have is some discrete values say .9965,1.006 etc...how can i sort the frequencies using fft
Star Strider
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
shilpa s 2016년 4월 20일
편집: Walter Roberson 2016년 4월 20일
my code is as follows
T=0.075*10^-15;
Fs=1/T;
x=fblAvgs+sblAvgs %first bond length averages+second bond length %averages
L=length(x);
Y=fft(x);
w=Y.*conj(Y)/L;
f=Fs/L*w(0:L/2);
plot(f,w(1:L/2+1))
xlabel(frequency)
ylabel(magnitude)
but i am not getting the desired values. please help me in finding the error related to my code

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Vibration Analysis에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2016년 4월 18일

편집:

2016년 4월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by