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: DdsSettingsInput (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: DdsSettingsOutput (modulation) DDS settings
amp: u24Demodulation 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>::ConfigLockin 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: i32Minimum 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: boolClear 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: i16Phase 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: boolAllow 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§
Source§impl ChannelSettings
impl ChannelSettings
pub(crate) fn update_phase_scale(&mut self)
Trait Implementations§
Source§impl Clone for ChannelSettings
impl Clone for ChannelSettings
Source§fn clone(&self) -> ChannelSettings
fn clone(&self) -> ChannelSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChannelSettings
impl Debug for ChannelSettings
Source§impl Default for ChannelSettings
impl Default for ChannelSettings
Source§impl TreeAny for ChannelSettings
impl TreeAny for ChannelSettings
Source§fn ref_any_by_key(&self, keys: impl Keys) -> Result<&dyn Any, ValueError>
fn ref_any_by_key(&self, keys: impl Keys) -> Result<&dyn Any, ValueError>
dyn Any trait object for a leaf node.Source§fn mut_any_by_key(
&mut self,
keys: impl Keys,
) -> Result<&mut dyn Any, ValueError>
fn mut_any_by_key( &mut self, keys: impl Keys, ) -> Result<&mut dyn Any, ValueError>
dyn Any trait object for a leaf node.Source§fn ref_by_key<T>(&self, keys: impl IntoKeys) -> Result<&T, ValueError>where
T: Any,
fn ref_by_key<T>(&self, keys: impl IntoKeys) -> Result<&T, ValueError>where
T: Any,
Source§fn mut_by_key<T>(&mut self, keys: impl IntoKeys) -> Result<&mut T, ValueError>where
T: Any,
fn mut_by_key<T>(&mut self, keys: impl IntoKeys) -> Result<&mut T, ValueError>where
T: Any,
Source§impl<'de> TreeDeserialize<'de> for ChannelSettings
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>>
fn deserialize_by_key<D: Deserializer<'de>>( &mut self, keys: impl Keys, de: D, ) -> Result<(), SerdeError<D::Error>>
Source§fn probe_by_key<D: Deserializer<'de>>(
keys: impl Keys,
de: D,
) -> Result<(), SerdeError<D::Error>>
fn probe_by_key<D: Deserializer<'de>>( keys: impl Keys, de: D, ) -> Result<(), SerdeError<D::Error>>
Source§impl TreeSchema for ChannelSettings
impl TreeSchema for ChannelSettings
Source§impl TreeSerialize for ChannelSettings
impl TreeSerialize for ChannelSettings
Source§fn serialize_by_key<S: Serializer>(
&self,
keys: impl Keys,
ser: S,
) -> Result<S::Ok, SerdeError<S::Error>>
fn serialize_by_key<S: Serializer>( &self, keys: impl Keys, ser: S, ) -> Result<S::Ok, SerdeError<S::Error>>
Auto Trait Implementations§
impl Freeze for ChannelSettings
impl RefUnwindSafe for ChannelSettings
impl Send for ChannelSettings
impl Sync for ChannelSettings
impl Unpin for ChannelSettings
impl UnwindSafe for ChannelSettings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, M> ForwardCompat<T, M> for T
impl<T, M> ForwardCompat<T, M> for T
§impl<T> ReverseCompat<T> for T
impl<T> ReverseCompat<T> for T
§fn reverse(self) -> Reverse<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>>
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)