pll: rename to just PLL

This commit is contained in:
Robert Jördens 2020-12-05 08:12:07 +01:00
parent 0072cda85f
commit 628845d356
1 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ use serde::{Deserialize, Serialize};
/// The extension to I^3,I^2,I behavior to track chirps phase-accurately or to i64 data to /// The extension to I^3,I^2,I behavior to track chirps phase-accurately or to i64 data to
/// increase resolution for extremely narrowband applications is obvious. /// increase resolution for extremely narrowband applications is obvious.
#[derive(Copy, Clone, Default, Deserialize, Serialize)] #[derive(Copy, Clone, Default, Deserialize, Serialize)]
pub struct PLLState { pub struct PLL {
// last input phase // last input phase
x: i32, x: i32,
// filtered frequency // filtered frequency
@ -38,7 +38,7 @@ pub struct PLLState {
y: i32, y: i32,
} }
impl PLLState { impl PLL {
/// Update the PLL with a new phase sample. /// Update the PLL with a new phase sample.
/// ///
/// Args: /// Args:
@ -69,7 +69,7 @@ mod tests {
use super::*; use super::*;
#[test] #[test]
fn mini() { fn mini() {
let mut p = PLLState::default(); let mut p = PLL::default();
let (y, f) = p.update(0x10000, 10); let (y, f) = p.update(0x10000, 10);
assert_eq!(y, 0xc2); assert_eq!(y, 0xc2);
assert_eq!(f, y); assert_eq!(f, y);
@ -77,7 +77,7 @@ mod tests {
#[test] #[test]
fn converge() { fn converge() {
let mut p = PLLState::default(); let mut p = PLL::default();
let f0 = 0x71f63049_i32; let f0 = 0x71f63049_i32;
let shift = 10; let shift = 10;
let n = 31 << shift + 2; let n = 31 << shift + 2;