diff options
author | ghostop14 <ghostop14@gmail.com> | 2020-02-14 11:47:37 -0500 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2020-02-15 14:25:57 +0100 |
commit | 504ab76d9e4fc3e9f497b9fd34f01c1bad346a5d (patch) | |
tree | c64edca089a87217e56d8840a38382d7e2b4ec56 /gr-digital/lib/clock_tracking_loop.cc | |
parent | a56c3a7f4908133dc6ceb93ffd3b2f9e1dda8e0e (diff) |
gr-digital: Improve PLL Loops and Clock Recovery
These updates incorporate the same inlining of loop functions and
the newly pushed fast_cc_multiply function to ensure
consistent performance improvements across systems that do not
support the cx-limited-range compiler parameter (Macs and Windows).
Diffstat (limited to 'gr-digital/lib/clock_tracking_loop.cc')
-rw-r--r-- | gr-digital/lib/clock_tracking_loop.cc | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/gr-digital/lib/clock_tracking_loop.cc b/gr-digital/lib/clock_tracking_loop.cc index 6c04d2d87e..2cb7c996c9 100644 --- a/gr-digital/lib/clock_tracking_loop.cc +++ b/gr-digital/lib/clock_tracking_loop.cc @@ -101,60 +101,6 @@ void clock_tracking_loop::update_gains() set_beta(beta); } -void clock_tracking_loop::advance_loop(float error) -{ - // So the loop can be reverted one step, if needed. - d_prev_avg_period = d_avg_period; - d_prev_inst_period = d_inst_period; - d_prev_phase = d_phase; - - // Integral arm of PI filter - d_avg_period = d_avg_period + d_beta * error; - // Limit the integral arm output here, as a large negative - // error input can lead to a negative d_avg_period, which - // will cause an infitine loop in the phase wrap method. - period_limit(); - - // Proportional arm of PI filter and final sum of PI filter arms - d_inst_period = d_avg_period + d_alpha * error; - // Limit the filter output here, for the errant case of a large - // negative error input, that can lead to a negative d_inst_period, - // which results in an incorrect phase increment, as it is assumed - // to be moving forward to the next symbol. - if (d_inst_period <= 0.f) - d_inst_period = d_avg_period; - - // Compute the new, unwrapped clock phase - d_phase = d_phase + d_inst_period; -} - -void clock_tracking_loop::revert_loop() -{ - d_avg_period = d_prev_avg_period; - d_inst_period = d_prev_inst_period; - d_phase = d_prev_phase; -} - -void clock_tracking_loop::phase_wrap() -{ - float period = d_avg_period; // One could argue d_inst_period instead - float limit = period / 2.0f; - - while (d_phase > limit) - d_phase -= period; - - while (d_phase <= -limit) - d_phase += period; -} - -void clock_tracking_loop::period_limit() -{ - if (d_avg_period > d_max_avg_period) - d_avg_period = d_max_avg_period; - else if (d_avg_period < d_min_avg_period) - d_avg_period = d_min_avg_period; -} - /******************************************************************* * SET FUNCTIONS *******************************************************************/ |