INNER CODE UNIT · Rust
test_remove_dc_offset
EricLBuehler/mistral.rs · mistralrs-audio/src/lib.rs:226
fn test_remove_dc_offset() {
let mut input = AudioInput {
samples: vec![1.0, 1.0, 1.0, 1.0],
sample_rate: 16000,
channels: 1,
};
input.remove_dc_offset();
for s in input.samples {
assert!((s - 0.0).abs() < 1e-6);
}
}
}