[chore](trx-rs): apply cargo fmt
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -705,7 +705,10 @@ mod tests {
|
||||
assert_eq!(RouteAccess::from_path("/app.js"), RouteAccess::Public);
|
||||
// Static reference data, served to every role: ".json" is not in the
|
||||
// asset suffix list, so this one has to be named.
|
||||
assert_eq!(RouteAccess::from_path("/bandplan.json"), RouteAccess::Public);
|
||||
assert_eq!(
|
||||
RouteAccess::from_path("/bandplan.json"),
|
||||
RouteAccess::Public
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -837,12 +837,6 @@ impl ChannelDsp {
|
||||
}
|
||||
}
|
||||
|
||||
let signal_power = decimated
|
||||
.iter()
|
||||
.map(|s| s.re * s.re + s.im * s.im)
|
||||
.sum::<f32>()
|
||||
/ decimated.len() as f32;
|
||||
let signal_db = 10.0 * signal_power.max(1e-12).log10();
|
||||
const WFM_OUTPUT_GAIN: f32 = 0.50;
|
||||
let mut audio = if let Some(decoder) = self.wfm_decoder.as_mut() {
|
||||
let mut out = decoder.process_iq(decimated);
|
||||
@@ -884,7 +878,14 @@ impl ChannelDsp {
|
||||
raw
|
||||
}
|
||||
};
|
||||
if !self.squelch.update(&self.mode, signal_db) {
|
||||
// Against the meter reading, not the block level after the IQ AGC.
|
||||
// The threshold arrives in the scale the operator sets it from — the
|
||||
// S-meter and the spectrum — while the level measured here had been
|
||||
// through the AGC, whose whole job is to hold it at a setpoint. For
|
||||
// every mode that has one (FM, PKT, AIS, AM, SAM) the squelch was
|
||||
// therefore comparing against a near-constant, and for the rest it was
|
||||
// still off by the decimation correction the meter applies.
|
||||
if !self.squelch.update(&self.mode, self.last_signal_db) {
|
||||
audio.fill(0.0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user