lockin: 2nd order lowpass
This commit is contained in:
parent
b49f0a2eb9
commit
32b7058b47
@ -1,9 +1,9 @@
|
|||||||
use super::{lowpass::Lowpass, Complex};
|
use super::{lowpass::Lowpass, Complex};
|
||||||
use generic_array::typenum::U4;
|
use generic_array::typenum::U2;
|
||||||
|
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
pub struct Lockin {
|
pub struct Lockin {
|
||||||
state: [Lowpass<U4>; 2],
|
state: [Lowpass<U2>; 2],
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Lockin {
|
impl Lockin {
|
||||||
|
@ -126,7 +126,7 @@ const APP: () = {
|
|||||||
let conf = "frequency_discriminator";
|
let conf = "frequency_discriminator";
|
||||||
let output = match conf {
|
let output = match conf {
|
||||||
// Convert from IQ to power and phase.
|
// Convert from IQ to power and phase.
|
||||||
"power_phase" => [(output.log2() << 10) as _, output.arg()],
|
"power_phase" => [(output.log2() << 24) as _, output.arg()],
|
||||||
"frequency_discriminator" => [pll_frequency as _, output.arg()],
|
"frequency_discriminator" => [pll_frequency as _, output.arg()],
|
||||||
_ => [output.0 << 16, output.1 << 16],
|
_ => [output.0 << 16, output.1 << 16],
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user