summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-05-17 12:05:44 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-05-17 12:05:44 +0200
commitf35591647d0c67fafda439f961d9c47f7a62a346 (patch)
treefbcce8c16b5788e0520aba08b6a244a70a4730b8
parentb79a14e33ade7285d7309ef544d89c60f3d5b3ec (diff)
Adjust MIN_SAMPLE_SET_SIZE to match empirical value found by muldjord.
-rw-r--r--src/powerlist.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/powerlist.cc b/src/powerlist.cc
index 96f2c9b..6fc77ad 100644
--- a/src/powerlist.cc
+++ b/src/powerlist.cc
@@ -38,7 +38,7 @@
* Limited by sample set size, ie. only kicks in if sample set size is smaller
* than this number.
*/
-#define MIN_SAMPLE_SET_SIZE 10
+#define MIN_SAMPLE_SET_SIZE 26
// Enable to calculate power on old samples without power attribute
//#define AUTO_CALCULATE_POWER
@@ -225,8 +225,9 @@ Sample *PowerList::get(level_t level)
// sample set smaller than MIN_SAMPLE_SET_SIZE.
float width = fmax(samples.size(), MIN_SAMPLE_SET_SIZE);
- // Spread out at most 1.5 samples away from center
- float stddev = power_span / width * 1.5;
+ // Spread out at most ~2 samples away from center if all samples have a
+ // uniform distribution over the power spectrum (which they probably don't).
+ float stddev = power_span / width;
// Cut off mean value with stddev/2 in both ends in order to make room for
// downwards expansion on velocity 0 and upwards expansion on velocity 1.