Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…anges
  • Loading branch information...
commit ca762a30f18289d747f9187fdc51cab899a9d37e 1 parent e05a437
Petr Baudis authored September 14, 2012

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  host_python/equalizer.py
6  host_python/equalizer.py
@@ -127,6 +127,7 @@ def get_color(volume):
127 127
             i += 1
128 128
             freq += FREQ_STEP
129 129
         freq_limit *= PIXEL_FREQ_RANGE
  130
+        freq_steps = 1
130 131
         pixel = 0
131 132
         count = 0
132 133
         volumes = []
@@ -136,9 +137,10 @@ def get_color(volume):
136 137
                 total += abs(fft[i])**2
137 138
                 i += 1; count += 1
138 139
                 freq += FREQ_STEP
139  
-            volume = (total/count)**0.5/SAMPLE_SIZE
140  
-            volumes.append(volume)
  140
+            volume = (total/count)**0.5
  141
+            volumes.append(volume/SAMPLE_SIZE*freq_steps)
141 142
             freq_limit *= PIXEL_FREQ_RANGE
  143
+            freq_steps += 1
142 144
             pixel += 1
143 145
             count = 0
144 146
         for pixel in xrange(EPIXELS):

0 notes on commit ca762a3

Please sign in to comment.
Something went wrong with that request. Please try again.