Skip to content

Commit

Permalink
Merge #346
Browse files Browse the repository at this point in the history
346: dual-iir: add some mqtt parameter docs r=jordens a=jordens



Co-authored-by: Robert Jördens <[email protected]>
  • Loading branch information
bors[bot] and jordens authored Apr 28, 2021
2 parents f5eb418 + 61dc6e3 commit 738fc52
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/bin/dual-iir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,17 @@ pub struct Settings {
impl Default for Settings {
fn default() -> Self {
Self {
// Analog frontend programmable gain amplifier gains (G1, G2, G5, G10)
afe: [AfeGain::G1, AfeGain::G1],
// IIR filter tap gains are an array `[b0, b1, b2, a1, a2]` such that the
// new output is computed as `y0 = a1*y1 + a2*y2 + b0*x0 + b1*x1 + b2*x2`.
// The array is `iir_state[channel-index][cascade-index][coeff-index]`.
// The IIR coefficients can be mapped to other transfer function
// representations, for example as described in https://arxiv.org/abs/1508.06319
iir_ch: [[iir::IIR::new(1., -SCALE, SCALE); IIR_CASCADE_LENGTH]; 2],
// Permit the DI1 digital input to suppress filter output updates.
allow_hold: false,
// Force suppress filter output updates.
force_hold: false,
}
}
Expand All @@ -48,7 +56,6 @@ const APP: () = {
dacs: (Dac0Output, Dac1Output),
mqtt_config: MiniconfInterface<Settings>,

// Format: iir_state[ch][cascade-no][coeff]
#[init([[[0.; 5]; IIR_CASCADE_LENGTH]; 2])]
iir_state: [[iir::Vec5; IIR_CASCADE_LENGTH]; 2],
settings: Settings,
Expand Down

0 comments on commit 738fc52

Please sign in to comment.