Jul-03-2018, 10:02 PM
Hello, I can only help a bit with signal processing.
Instead of making a fft and throwing the negative frequencies away, you should do a rfft.
Here a corrected version and additional the same with a rfft.
Instead of making a fft and throwing the negative frequencies away, you should do a rfft.
Here a corrected version and additional the same with a rfft.
def getFFT(data, rate): """Given some data and rate, returns FFTfreq and FFT (half).""" window_size = len(data) data *= np.hamming(window_size) fft = np.fft.fft(data).real freq = np.fft.fftfreq(window_size, 1.0 / rate) half_size = slice(None, window_size // 2) return freq[half_size], fft[half_size] def getRFFT(data, rate): """Given some data and rate, returns RFFTfreq and RFFT.""" window_size = len(data) data *= np.hamming(window_size) rfft = np.fft.rfft(data).real freq = np.fft.rfftfreq(window_size, 1.0 / rate) return freq, rfft
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!