I'm using numpy FFT functions to find the amplitude, frequency and phase of low frequency signals. focusing between 0-10 hz.Part of my project is to vary the time over which the sample is taken and the sample frequency. To test the function im currently using unit amplitudes and set frequencies. At any sample size other then 10,20 sec .. ect the fft becomes rather inaccurate.
Since i am using unit amplitudes of 1, the outputs should all be 1, or at least the same number if my scaling is off. but i am getting aptitude outputs from 1 to 0.66 when not using a sample of a multiple of 10.
i have tried changing both the sample time and frequency to match the total sample size but this doesn't seem to have any effect.
Why does this happen? i can't find anything about why the FFT only works for these discrete time periods.
z = Series(ampl_OR[i] * np.cos(2np.pifreq_OR[i]*t_OR + phase_OR[i]))
Ramp = np.fft.fft(z) #real amplitudes used to find phase
Rfeq = np.fft.fftfreq(z.shape[-1]) #real frequency domain to find phase