Let me ask about FFT, i have data sample from sensor, source of frequency from generator is 5 Hz, i want to extract the data with FFT but why i cannot find the 5 Hz frequency from source. This is my list program
Fs = 5; %sampling frequency
T = 1;
L = 250; % Length of signal
t = (0:L-1)*T;
time = VarName1; % sampling time
signal = VarName2; % signal data in Time-Domain
figure(1);
plot(signal);
title('Sensor Signal')
Y = fft(signal);
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;
figure(2);
plot(f,P1);
title('Single-Sided Amplitude Spectrum of X(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')
please your help for solve the problem, thank you very much,
1.6, 1.4, 1.8, 1.8, 1.4, 1.6, 1.4, 1.2, 2, 1.6, 1.8, 1.8, 1.4, 1.2, 1.8, 1.2, 2.2, 2, 1.4, 1.4, 1.4, 1.4, 1.8, 1.8, 1.6, 1.8, 1.4, 1.2, 1.6, 1.2, 1.8, 1.6, 1.2, 1.4, 1.2, 1, 1.6, 1.4, 1.4, 1.2, 0.8, 0.6, 1.2, 0.2, 1, 1, 0.4, 0.2, 0.2, 0, 0.4, 0, 0, 0, -0.4, -0.6, -0.2, -0.2, 0, -0.2, -0.6, -0.8, -0.6, -0.6, -0.2, -0.4, -0.4, -0.2, -1.4, -1, -0.4, -0.6, -0.2, -0.2, -0.8, -0.8, -0.4, -0.6, -0.2, 0, -0.4, 0, -0.4, -0.2, 0, 0.2, 0.6, 0.4, -0.2, 0.4, 0, 0.4, 0.4, 1, 0.6, 1.2, 0.6, 1, 1.4, 1.2, 1.4, 1.8, 1.2, 1.4, 1.4, 1.6, 2, 1.8, 1.6, 1.6, 1.4, 1.8, 1.8, 1.8, 2.2, 2.2, 1.4, 1.6, 1.6, 1.4, 2, 1.8, 1.4, 1.6, 1.2, 1.4, 1.4, 1.6, 1.6, 1.6, 1, 1, 1.2, 0.4, 1.2, 0.8, 0.6, 0.8, 0.4, 0.2, 0.6, 0.2, 0.4, 0.2, -0.2, -0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