1
0
Fork 0

Fix updated exponential smoothing

This commit is contained in:
Robbert van der Helm 2022-05-12 13:44:01 +02:00
parent 1fea9f94df
commit f3d02f6210

View file

@ -177,7 +177,7 @@ impl<T: Smoothable> Smoother<T> {
// multiplied by, while the target value is multipled by one minus the coefficient. This // multiplied by, while the target value is multipled by one minus the coefficient. This
// reaches 99.99% of the target value after `steps_left`. The smoother will snap to the // reaches 99.99% of the target value after `steps_left`. The smoother will snap to the
// target value after that point. // target value after that point.
SmoothingStyle::Exponential(_) => 0.0001f32.powf(-1.0 / steps_left as f32), SmoothingStyle::Exponential(_) => nih_dbg!(0.0001f32.powf(1.0 / steps_left as f32)),
}; };
} }
@ -421,4 +421,6 @@ mod tests {
assert_ne!(smoother.next(), 20); assert_ne!(smoother.next(), 20);
assert_eq!(smoother.next(), 20); assert_eq!(smoother.next(), 20);
} }
// TODO: Tests for the exponential smoothing
} }