Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/parameters' into feat/param…
Browse files Browse the repository at this point in the history
…eters
  • Loading branch information
SolarLiner committed Feb 7, 2024
2 parents 3a61d46 + fba8a19 commit 9cb58fb
Show file tree
Hide file tree
Showing 36 changed files with 8,231 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/filters/ladder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ impl<T: Scalar, S: Saturator<T>> LadderTopology<T> for Transistor<S> {
ysat[2] - ysat[1],
ysat[3] - ysat[2],
]);
for (i, s) in self.0.iter_mut().enumerate() {
s.update_state(y[i], ysat[i]);
for (s, (y, ysat)) in self.0.iter_mut().zip(y.iter().copied().zip(ysat.iter().copied())) {
s.update_state(y, ysat);
}
self.0[4].update_state(y0, y0sat);
y - yd
Expand Down Expand Up @@ -237,7 +237,9 @@ mod tests {
slice_to_mono_block_mut(&mut output),
);

insta::assert_csv_snapshot!(&output as &[_], { "[]" => insta::rounded_redaction(3) })
let topo = std::any::type_name::<Topo>().replace("::", "__").replace('<', "_").replace('>', "_");
let name = format!("test_ladder_ir_{topo}_c{compensated}_r{resonance}");
insta::assert_csv_snapshot!(name, &output as &[_], { "[]" => insta::rounded_redaction(3) })
}

#[rstest]
Expand All @@ -251,6 +253,7 @@ mod tests {
.map(|f| filter.freq_response(1024.0, f)[0][0].simd_abs())
.map(|x| 20.0 * x.log10());

insta::assert_csv_snapshot!(&response as &[_], { "[]" => insta::rounded_redaction(3) })
let name = format!("test_ladder_hz_c{compensated}_r{resonance}");
insta::assert_csv_snapshot!(name, &response as &[_], { "[]" => insta::rounded_redaction(3) })
}
}
Loading

0 comments on commit 9cb58fb

Please sign in to comment.