def getDftBins(data=None, sampleRate=None, low=100, high=8000, chunk=64):
 if (data is None):
  data = []
 bins = []
 i = chunk
 if sampleRate:
  (_junk, freq) = getDft(data[:chunk], sampleRate)
  band = ((freq > low) & (freq < high))
 while (i <= len(data)):
  magn = getDft(data[(i - chunk):i])
  if sampleRate:
   bins.append(np.std(magn[band]))
  else:
   bins.append(np.std(magn))
  i += chunk
 return np.array(bins)

def getDftBins ( data = None , sampleRate = None , low = 100 , high = 8000 , chunk = 64 ) : if ( data is None ) : data = [ ] bins = [ ] i = chunk if sampleRate : ( _junk , freq ) = getDft ( data [ : chunk ] , sampleRate ) band = ( ( freq > low ) & ( freq < high ) ) while ( i <= len ( data ) ) : magn = getDft ( data [ ( i - chunk ) : i ] ) if sampleRate : bins . append ( np . std ( magn [ band ] ) ) else : bins . append ( np . std ( magn ) ) i += chunk return np . array ( bins )
return dft of data .