Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

equalizer: Fix loss of intensity in higher frequencies due to wider r…

…anges
  • Loading branch information...
commit ca762a30f18289d747f9187fdc51cab899a9d37e 1 parent e05a437
@pasky pasky authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 host_python/equalizer.py
View
6 host_python/equalizer.py
@@ -127,6 +127,7 @@ def get_color(volume):
i += 1
freq += FREQ_STEP
freq_limit *= PIXEL_FREQ_RANGE
+ freq_steps = 1
pixel = 0
count = 0
volumes = []
@@ -136,9 +137,10 @@ def get_color(volume):
total += abs(fft[i])**2
i += 1; count += 1
freq += FREQ_STEP
- volume = (total/count)**0.5/SAMPLE_SIZE
- volumes.append(volume)
+ volume = (total/count)**0.5
+ volumes.append(volume/SAMPLE_SIZE*freq_steps)
freq_limit *= PIXEL_FREQ_RANGE
+ freq_steps += 1
pixel += 1
count = 0
for pixel in xrange(EPIXELS):
Please sign in to comment.
Something went wrong with that request. Please try again.