Struct ChannelSettings

Source
pub(crate) struct ChannelSettings {
    pub(crate) input: DdsSettings,
    pub(crate) output: DdsSettings,
    pub(crate) amp: u24,
    pub(crate) lockin_k: <Lowpass<2> as Filter>::Config,
    pub(crate) min_power: i32,
    pub(crate) clear: bool,
    pub(crate) phase_scale: [[i32; 2]; 2],
    pub(crate) iir: BiquadRepr<i32>,
    pub(crate) pow_gain: i16,
    pub(crate) hold_en: bool,
    pub(crate) iir_amp: BiquadRepr<f32>,
}

Fields§

§input: DdsSettings

Input (demodulation) DDS settings Feedback to stabilize the RF input phase is applied to the RF output on top of the output frequency and phase.

For the demodulation this is the total (DDS minus Lockin, i.e. lower sideband) demodulation frequency. If the modulation AOM is passed twice at +1 order, input/freq should be twice output/freq.

§output: DdsSettings

Output (modulation) DDS settings

§amp: u24

Demodulation amplitude control register.

§Value

AD9959 amplitude control register (24 bits, see datasheet)

§Default

0 for full scale amplitude and multiplier disable

§lockin_k: <Lowpass<2> as Filter>::Config

Lockin lowpass time constant. The lowpass is a cascade of one second order IIR filters, 12 dB/octave. This needs to be high enough to suppress the unwanted demodulation components and harmonics but as low as possible to maximize bandwidth. Many demodulation components and harmonics are also suppressed by the zeros of the batch size moving average FIR filter and judicious choice of lockin_freq.

TODO: settle pll and lockin settings into design after confirming optimal choice

§Default

lockin_k = [0x200_0000, -0x2000_0000]

§min_power: i32

Minimum demodulated signal power to enable feedback. Note that this is RMS and that the signal peak must not clip.

§Value

log2 of the signal power relative to full scale. Range: [-63..0]

§Default

min_power = -24 corresponding to about -69 dBFS.

§clear: bool

Clear the phase unwrap tracking counters once. To make this setting edge-sensitive, after setting it to true, it must be reset to false by the user before setting any other settings.

§phase_scale: [[i32; 2]; 2]

Scaling factor of the unwrapped phase and fine rational offset. The phase scaling is located after the phase unwrapping before the feedback IIR filter.

FIXME: doc rational offset

§Value

[[phase_factor, phase_shr], [time_factor, time_shr]]

§Default

phase_scale = [[1, 16], [0, 0]]: clamped range: ±33 k turn (tracked range is ±2 G turn) quantization: 1.5 µ turn, 0.1 Hz

§iir: BiquadRepr<i32>

Feedback IIR filter settings. The filter input is phase, the output is frequency.

§Default

A proportional gain=-1 filter.

§pow_gain: i16

Phase offset feedback gain. Phase feedback is a proportional bypass of the unwrapper, the IIR (including its input and output scaling) and the frequency feedback path. The phase offset gain is pow_gain/(1 << 13) rad/rad.

§Value

Integer scaled phase feedback gain. Range: [-0x2000, 0x2000]

§Default

0 for no phase feedback

§hold_en: bool

Allow digital input to hold

§iir_amp: BiquadRepr<f32>

Amplitude IIR filter. The filter input is squared magnitude, the output is DDS amplitude.

§Default

No feedback

Implementations§

Trait Implementations§

Source§

impl Clone for ChannelSettings

Source§

fn clone(&self) -> ChannelSettings

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ChannelSettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ChannelSettings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl TreeAny for ChannelSettings

Source§

fn ref_any_by_key(&self, keys: impl Keys) -> Result<&dyn Any, ValueError>

Obtain a reference to a dyn Any trait object for a leaf node.
Source§

fn mut_any_by_key( &mut self, keys: impl Keys, ) -> Result<&mut dyn Any, ValueError>

Obtain a mutable reference to a dyn Any trait object for a leaf node.
Source§

fn ref_by_key<T>(&self, keys: impl IntoKeys) -> Result<&T, ValueError>
where T: Any,

Obtain a reference to a leaf of known type by key.
Source§

fn mut_by_key<T>(&mut self, keys: impl IntoKeys) -> Result<&mut T, ValueError>
where T: Any,

Obtain a mutable reference to a leaf of known type by key.
Source§

impl<'de> TreeDeserialize<'de> for ChannelSettings

Source§

fn deserialize_by_key<D: Deserializer<'de>>( &mut self, keys: impl Keys, de: D, ) -> Result<(), SerdeError<D::Error>>

Deserialize a leaf node by its keys. Read more
Source§

fn probe_by_key<D: Deserializer<'de>>( keys: impl Keys, de: D, ) -> Result<(), SerdeError<D::Error>>

Blind deserialize a leaf node by its keys. Read more
Source§

impl TreeSchema for ChannelSettings

Source§

const SCHEMA: &'static Schema

Schema for this tree level
Source§

impl TreeSerialize for ChannelSettings

Source§

fn serialize_by_key<S: Serializer>( &self, keys: impl Keys, ser: S, ) -> Result<S::Ok, SerdeError<S::Error>>

Serialize a node by keys. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T, M> ForwardCompat<T, M> for T

§

fn forward(self) -> Forward<T, M>

Create an e-h-c forward compatibility wrapper around and e-h object Available methods depend on the wrapped type
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ReverseCompat<T> for T

§

fn reverse(self) -> Reverse<T>

Create an e-h-c wrapper around and e-h object Available methods depend on the wrapped type

§

fn reverse_cell(self) -> Reverse<RefCell<T>>

Create an e-h-c reverse compatibility wrapper using a ref-cell for interior mutability (required for InputPin types)

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TreeDeserializeOwned for T
where T: for<'de> TreeDeserialize<'de>,