MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / calc_fft

Function calc_fft

python_package/examples/enophone/enotools.py:149–163  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

147
148
149def calc_fft(data):
150 local_data = data[(1, 2, 3, 4), :].copy()
151
152 ### FFT ###
153 samplerate = 250
154 nsamples = local_data.shape[1]
155 win = {'none': 1,
156 'hanning': np.hanning(nsamples),
157 'hamming': np.hamming(nsamples)}['hanning']
158 win = np.array([win]).T
159
160 fft = np.abs(np.fft.rfft(local_data.T * win, axis=0, norm=None)) * 2 / nsamples
161 freqs = np.fft.rfftfreq(nsamples, 1. / samplerate)
162
163 return fft, freqs

Callers 2

detect_mainsFunction · 0.85
qualityFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected