(Jul-03-2018, 10:02 PM)DeaD_EyE Wrote: 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.
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
When I run the code (I do the changes on FFT inside the SWHear.py into your code)
The result is no error at all it runs perfectly but both of the graph is empty, showing empty data, its like couldn't recognize the data of the input somehow