Use the examples in the documentation on fft (link) to calculate the Fourier transform. Example Code For Your Signal —
[d,s] = xlsread('1.5V.csv');
t = d(:,1)*1E-3;
v = d(:,2);
L = length(t);
Ts = mean(diff(t));
Fs = 1/Ts;
Fn = Fs/2;
vc = v - mean(v);
FTv = fft(vc)/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:length(Fv);
figure(1)
plot(Fv, abs(FTv(Iv))*2)
grid
xlabel('Frequency (Hz)')
ylabel('Amplitude (V?)')
I did not post the plot, since my code will plot the Fourier transform of your data.
Best Answer