diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-02-12 18:40:42 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-02-12 18:40:42 +0000 |
commit | fccd7d5103b897959b5f816aebd9613aee111433 (patch) | |
tree | a11fdd81d8f672eb912564127b54cbc581088aeb /libs/ardour/pi_controller.cc | |
parent | a1e0dc13df3cdc7033c940f0f3311a2bd47d3b2e (diff) |
torben's latest fix for the MTC PiC (adjust catch factor)
git-svn-id: svn://localhost/ardour2/branches/3.0@6679 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/pi_controller.cc')
-rw-r--r-- | libs/ardour/pi_controller.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/ardour/pi_controller.cc b/libs/ardour/pi_controller.cc index bdf9c27cee..0d9e5b8c37 100644 --- a/libs/ardour/pi_controller.cc +++ b/libs/ardour/pi_controller.cc @@ -59,7 +59,8 @@ double PIController::get_ratio (int fill_level, int period_size) { double offset = fill_level; - double this_catch_factor = catch_factor * 4096.0/(double)period_size; + double this_catch_factor = catch_factor; + double this_catch_factor2 = catch_factor2 * 4096.0/(double)period_size; // Save offset. @@ -96,7 +97,7 @@ PIController::get_ratio (int fill_level, int period_size) // u(t) = K * (e(t) + 1/T \int e(t') dt') // Kp = 1/catch_factor and T = catch_factor2 Ki = Kp/T current_resample_factor - = static_resample_factor - smooth_offset / this_catch_factor - offset_integral / this_catch_factor / catch_factor2; + = static_resample_factor - smooth_offset / this_catch_factor - offset_integral / this_catch_factor / this_catch_factor2; // Now quantize this value around resample_mean, so that the noise which is in the integral component doesnt hurt. current_resample_factor = floor((current_resample_factor - resample_mean) * controlquant + 0.5) / controlquant + resample_mean; |