[style](trx-backend-soapysdr): format WFM code
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -677,8 +677,7 @@ impl WfmStereoDecoder {
|
|||||||
+ (STEREO_SEPARATION_GAIN_MAX - STEREO_SEPARATION_GAIN_MIN) * separation_drive;
|
+ (STEREO_SEPARATION_GAIN_MAX - STEREO_SEPARATION_GAIN_MIN) * separation_drive;
|
||||||
self.stereo_separation_gain +=
|
self.stereo_separation_gain +=
|
||||||
0.015 * (separation_target - self.stereo_separation_gain);
|
0.015 * (separation_target - self.stereo_separation_gain);
|
||||||
let diff_i =
|
let diff_i = (diff_i_raw * trim_cos + diff_q * trim_sin) * self.stereo_separation_gain;
|
||||||
(diff_i_raw * trim_cos + diff_q * trim_sin) * self.stereo_separation_gain;
|
|
||||||
let denoised_diff_i = self.denoise.process(sum_i, diff_i, diff_q);
|
let denoised_diff_i = self.denoise.process(sum_i, diff_i, diff_q);
|
||||||
let preserve = DENOISE_STEREO_PRESERVE_MIN
|
let preserve = DENOISE_STEREO_PRESERVE_MIN
|
||||||
+ (DENOISE_STEREO_PRESERVE_MAX - DENOISE_STEREO_PRESERVE_MIN) * separation_drive;
|
+ (DENOISE_STEREO_PRESERVE_MAX - DENOISE_STEREO_PRESERVE_MIN) * separation_drive;
|
||||||
@@ -826,8 +825,14 @@ mod tests {
|
|||||||
iq.push(Complex::from_polar(1.0, phase));
|
iq.push(Complex::from_polar(1.0, phase));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut decoder =
|
let mut decoder = WfmStereoDecoder::new(
|
||||||
WfmStereoDecoder::new(composite_rate, audio_rate, 2, true, 50, WfmDenoiseLevel::Auto);
|
composite_rate,
|
||||||
|
audio_rate,
|
||||||
|
2,
|
||||||
|
true,
|
||||||
|
50,
|
||||||
|
WfmDenoiseLevel::Auto,
|
||||||
|
);
|
||||||
let output = decoder.process_iq(&iq);
|
let output = decoder.process_iq(&iq);
|
||||||
|
|
||||||
let skip_samples = (0.2 * audio_rate as f32) as usize;
|
let skip_samples = (0.2 * audio_rate as f32) as usize;
|
||||||
@@ -966,8 +971,14 @@ mod tests {
|
|||||||
iq.push(Complex::from_polar(1.0, phase));
|
iq.push(Complex::from_polar(1.0, phase));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut decoder =
|
let mut decoder = WfmStereoDecoder::new(
|
||||||
WfmStereoDecoder::new(composite_rate, audio_rate, 2, true, 50, WfmDenoiseLevel::Auto);
|
composite_rate,
|
||||||
|
audio_rate,
|
||||||
|
2,
|
||||||
|
true,
|
||||||
|
50,
|
||||||
|
WfmDenoiseLevel::Auto,
|
||||||
|
);
|
||||||
let output = decoder.process_iq(&iq);
|
let output = decoder.process_iq(&iq);
|
||||||
|
|
||||||
assert!(!decoder.stereo_detected());
|
assert!(!decoder.stereo_detected());
|
||||||
@@ -1155,8 +1166,14 @@ mod tests {
|
|||||||
iq.push(Complex::from_polar(1.0, phase));
|
iq.push(Complex::from_polar(1.0, phase));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut decoder =
|
let mut decoder = WfmStereoDecoder::new(
|
||||||
WfmStereoDecoder::new(composite_rate, audio_rate, 2, true, 50, WfmDenoiseLevel::Auto);
|
composite_rate,
|
||||||
|
audio_rate,
|
||||||
|
2,
|
||||||
|
true,
|
||||||
|
50,
|
||||||
|
WfmDenoiseLevel::Auto,
|
||||||
|
);
|
||||||
let output = decoder.process_iq(&iq);
|
let output = decoder.process_iq(&iq);
|
||||||
|
|
||||||
let skip_samples = (0.2 * audio_rate as f32) as usize;
|
let skip_samples = (0.2 * audio_rate as f32) as usize;
|
||||||
|
|||||||
@@ -333,7 +333,10 @@ impl AudioSource for SoapySdrRig {
|
|||||||
self.subscribe_pcm_channel(self.primary_channel_idx)
|
self.subscribe_pcm_channel(self.primary_channel_idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn subscribe_pcm_channel(&self, channel_idx: usize) -> tokio::sync::broadcast::Receiver<Vec<f32>> {
|
fn subscribe_pcm_channel(
|
||||||
|
&self,
|
||||||
|
channel_idx: usize,
|
||||||
|
) -> tokio::sync::broadcast::Receiver<Vec<f32>> {
|
||||||
if let Some(sender) = self.pipeline.pcm_senders.get(channel_idx) {
|
if let Some(sender) = self.pipeline.pcm_senders.get(channel_idx) {
|
||||||
sender.subscribe()
|
sender.subscribe()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user