From a6e28d711b080ff79948e522cb7284424d8d8135 Mon Sep 17 00:00:00 2001 From: pborky Date: Sat, 22 Dec 2012 23:16:20 +0100 Subject: [PATCH] Update host_python/equalizer.py fix range of autocorrelation --- host_python/equalizer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/host_python/equalizer.py b/host_python/equalizer.py index dcecf4f..0f256a0 100755 --- a/host_python/equalizer.py +++ b/host_python/equalizer.py @@ -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])