Catch #61 with tests and fix
[EVA-2020-02-2.git] / library / enviroplus / noise.py
index 6830bd0dd7dc0ca04e5eb7e28ef4a8dcfc1f6d9f..7b6d5e283d2990b345149d6f01369fbd8d88f4b6 100644 (file)
@@ -76,7 +76,7 @@ class Noise():
         amp_low = numpy.mean(magnitude[noise_floor:mid_start])
         amp_mid = numpy.mean(magnitude[mid_start:high_start])
         amp_high = numpy.mean(magnitude[high_start:noise_ceiling])
         amp_low = numpy.mean(magnitude[noise_floor:mid_start])
         amp_mid = numpy.mean(magnitude[mid_start:high_start])
         amp_high = numpy.mean(magnitude[high_start:noise_ceiling])
-        amp_total = (low + mid + high) / 3.0
+        amp_total = (amp_low + amp_mid + amp_high) / 3.0
 
         return amp_low, amp_mid, amp_high, amp_total
 
 
         return amp_low, amp_mid, amp_high, amp_total