Permalink
Browse files

Update host_python/equalizer.py

fix range of autocorrelation
  • Loading branch information...
1 parent 88fcfc0 commit a6e28d711b080ff79948e522cb7284424d8d8135 @pborky pborky committed Dec 22, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 host_python/equalizer.py
View
@@ -157,8 +157,8 @@ def loop( stream ):
#TODO: dynamic attenuation based on average power of input signal over timespan, threshold to cut off noise
x = np.concatenate(history*history_diminish)*window/ATTENUATION
- # compute power spectral desity using autocarelate approach
- psd = np.abs(np.fft.fft(np.correlate(x,x,'full')))[...,np.newaxis]
+ # estimate power spectral desity using autocorelate approach
+ psd = np.abs(np.fft.fft(np.correlate(x,x,'same')))[...,np.newaxis]
# frequencies
freqs = np.fft.fftfreq(psd.shape[0],1./RATE)[...,np.newaxis]
# frequency band vector _orthogonal_ to freqs
@@ -175,7 +175,7 @@ def loop( stream ):
))
for pixel in xrange(EPIXELS):
- c = get_color(energy[pixel])
+ c = get_color(energy[pixel]) # consider using energy**0.5 instead
if SYMMETRIC == 1:
l.set_pixel(PIXELS / 2 + pixel, c[0], c[1], c[2])
l.set_pixel(PIXELS / 2 - (pixel + 1), c[0], c[1], c[2])

0 comments on commit a6e28d7

Please sign in to comment.