FFT_FREQS = numpy.fft.nfftfreq(CHUNCK, DT)
FFT_FREQS_INDS = -numpy.ones_like(FFT_FREQS)
bands_bounds = [[20, 60], [60, 250], [250, 500], [500, 2000], [2000, 3000],
    [3000, 4000], [4000, 6000], [6000, 20000]]
for f_ind, freq in enumerate(FFT_FREQS):
    for led_ind, bounds in enumerate(bands_bounds):
        if freq < bounds[1] and freq >= bounds[0]:
            FFT_FREQS_INDS[ind] = led_ind

def pitch(signal):
    signal = numpy.fromstring(signal, 'Int16')
amplitude = numpy.fft.rfft(signal.astype(numpy.float))
power = [np.sum(np.abs(amplitude[FFT_FREQS_INDS == led_ind]) ** 2) for
    led_ind in range(len(bands_bounds))]
return power
Не знаете, как использовать данные БПФ для анализатора спектра