pub struct RPLL { /* private fields */ }
Expand description
Reciprocal PLL.
Consumes noisy, quantized timestamps of a reference signal and reconstructs
the phase and frequency of the update() invocations with respect to (and in units of
1 << 32 of) that reference.
In other words, update()
rate ralative to reference frequency,
u32::MAX
corresponding to both being equal.
Implementations§
source§impl RPLL
impl RPLL
sourcepub fn new(dt2: u32) -> Self
pub fn new(dt2: u32) -> Self
Create a new RPLL instance.
Args:
- dt2: inverse update() rate. 1 << dt2 is the counter rate to update() rate ratio.
Returns: Initialized RPLL instance.
sourcepub fn update(
&mut self,
input: Option<i32>,
shift_frequency: u32,
shift_phase: u32,
) -> (i32, u32)
pub fn update( &mut self, input: Option<i32>, shift_frequency: u32, shift_phase: u32, ) -> (i32, u32)
Advance the RPLL and optionally supply a new timestamp.
Args:
- input: Optional new timestamp (wrapping around at the i32 boundary).
There can be at most one timestamp per
update()
cycle (1 << dt2 counter cycles). - shift_frequency: Frequency lock settling time. 1 << shift_frequency is frequency lock settling time in counter periods. The settling time must be larger than the signal period to lock to.
- shift_phase: Phase lock settling time. Usually one less than
shift_frequency
(see there).
Returns: A tuple containing the current phase (wrapping at the i32 boundary, pi) and frequency.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RPLL
impl RefUnwindSafe for RPLL
impl Send for RPLL
impl Sync for RPLL
impl Unpin for RPLL
impl UnwindSafe for RPLL
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)