MATLAB: FFT of a damping signal

dampedfft

Hello, I have got a damping time dependent signal(attached data) and I wish to get the FFT of the signal. Unfortunately right now I am not able to get the peak frequency. Can someone help me in finding the FFT please.

Best Answer

Try this:
D = load('FFT.txt');
t = D(:,1);
s = D(:,2);
Ts = mean(diff(t)); % Sampling Time
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
L = length(t);
FTs = fft(s)/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector
[pks,locs] = findpeaks(abs(FTs(Iv))*2, 'MinPeakHeight',1E-3);
figure(1)
loglog(Fv, abs(FTs(Iv))*2)
hold on
plot(Fv(locs), pks, '^r')
grid
text(Fv(locs)*1.1, pks, sprintf('\\leftarrow Peak = %.5f at %.3E Hz', pks, Fv(locs)), 'HorizontalAlignment','left')