MATLAB: FFT for the given data to find the dominant frequency

dominant frequencyfftlift coefficient

hello everyone,
I have a data file containing a variable called "Lift coefficient" collected over a period of 1.25 seconds with time steps of 1e-5. I am performing the FFT but i'm not getting the desirable result. I am using the following code. Please find the data file also. Thankyou in advance
x=Cl;
plot(t,x)
t=VarName1;
y=fft(x);
f = (0:length(y)-1)*(10000)/length(y);
plot(f,abs(y))

Best Answer

Try this:
[D,S] = xlsread('forcecoefficients1.xlsx');
t = D(:,1);
Cl = D(:,2);
Ts = mean(diff(t));
Fs = 1/Ts;
Fn = Fs/2;
L = numel(t);
Clm = Cl-mean(Cl); % Subtract Mean (Mean = 0 Hz)
FCl = fft(Clm)/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:numel(Fv);
[pks,locs] = findpeaks(abs(FCl(Iv))*2, 'MinPeakHeight',0.01);
figure
plot(Fv, abs(FCl(Iv))*2)
grid
xlim([0 1E3])
text(Fv(locs), pks, sprintf('\\leftarrow Dominant Frequency = %.2f', Fv(locs)), 'HorizontalAlignment','left')
The dominant frequency appears to be 226.4.
EDIT —
Added plot image:
FFT for the given data to find the dominant frequency- 2019 05 03.png