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

This commit is contained in:
Petr Baudis 2012-09-14 22:42:32 +02:00
parent e05a43783f
commit ca762a30f1

View file

@ -127,6 +127,7 @@ try:
i += 1 i += 1
freq += FREQ_STEP freq += FREQ_STEP
freq_limit *= PIXEL_FREQ_RANGE freq_limit *= PIXEL_FREQ_RANGE
freq_steps = 1
pixel = 0 pixel = 0
count = 0 count = 0
volumes = [] volumes = []
@ -136,9 +137,10 @@ try:
total += abs(fft[i])**2 total += abs(fft[i])**2
i += 1; count += 1 i += 1; count += 1
freq += FREQ_STEP freq += FREQ_STEP
volume = (total/count)**0.5/SAMPLE_SIZE volume = (total/count)**0.5
volumes.append(volume) volumes.append(volume/SAMPLE_SIZE*freq_steps)
freq_limit *= PIXEL_FREQ_RANGE freq_limit *= PIXEL_FREQ_RANGE
freq_steps += 1
pixel += 1 pixel += 1
count = 0 count = 0
for pixel in xrange(EPIXELS): for pixel in xrange(EPIXELS):