X=exported.y(:,3); L=length(X); time_end=exported.t(end)-exported.t(1); Fs = L/time_end; % Sampling frequency T = 1/Fs; % Sampling period t = (0:L-1)*T; Y = fft(X); figure P2 = abs(Y/L); P1 = P2(1:L/2+1); P1(2:end-1) = 2*P1(2:end-1); f = Fs*(0:(L/2))/L; plot(1000*f(2:50),P1(2:50)) title("Single-Sided Amplitude Spectrum of X(t)") xlabel("f (Hz)") ylabel("|P1(f)|")