Commit Graph

486 Commits

Author SHA1 Message Date
sjg 8f6a5af4ec [fix](trx-backend-soapysdr): hard-limit iq magnitude before wfm discriminator
Normalize IQ samples exceeding unit magnitude before the FM
discriminator. The discriminator only uses phase, so clamping
amplitude prevents overdeviated signals from producing clipped
composite baseband without losing frequency information.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:58:16 +01:00
sjg 13de90d664 [fix](trx-backend-soapysdr): increase wfm resampler taps from 16 to 32
Doubles the polyphase FIR length for the composite-to-audio rate
converter, improving stopband rejection from ~25 dB to ~50 dB.
This reduces treble distortion from imaging artifacts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:55:59 +01:00
sjg 8d0dc17317 [chore](trx-backend-soapysdr): remove unused smoothstep01
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:49:27 +01:00
sjg 815efdb1ae [fix](trx-backend-soapysdr): match sum/diff filters and simplify stereo blend
- Set STEREO_DIFF_BW_HZ = AUDIO_BW_HZ so both filter paths have
  identical group delay (improves multitone separation by ~10 dB).
- Zero out STEREO_SEPARATION_PHASE_TRIM (unnecessary with matched filters).
- Replace gradual blend ramp with binary blend: full stereo at pilot
  lock, mono when unlocked. The hysteresis thresholds already handle
  noisy signals.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:48:16 +01:00
sjg 13576f73aa [test](trx-backend-soapysdr): add multi-tone wfm stereo separation test
Test L-only and R-only signals with tones at 400, 2000, 8000 and
14000 Hz to catch frequency-dependent group delay and phase trim
issues that the single 1 kHz test misses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:42:39 +01:00
sjg 33b218fce3 [perf](trx-backend-soapysdr): reduce frame emission overhead
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:41:34 +01:00
sjg 2ed4aaf46d [fix](trx-backend-soapysdr): tune wfm stereo filter bw and matrix gain
Restore AUDIO_BW_HZ to 15.8 kHz for cleaner mono path, widen
STEREO_DIFF_BW_HZ to 18 kHz for better high-frequency stereo detail,
and raise STEREO_MATRIX_GAIN from 0.30 to 0.50 (mathematically correct
unity gain for the L=(S+D)/2 stereo matrix).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:37:15 +01:00
sjg e7997f8492 [perf](trx-backend-soapysdr): use ring history for wfm resampler
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:34:50 +01:00
sjg a6c3a85c8d [fix](trx-backend-soapysdr): match wfm sum/diff filter cutoffs at 18 kHz
Raise both AUDIO_BW_HZ and STEREO_DIFF_BW_HZ to 18 kHz so the L+R and
L-R filter paths have identical group delay across the full audio band.
The previous mismatch (15.8 vs 14.5 kHz) caused frequency-dependent
phase errors in the stereo matrix that degraded real-world separation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:31:34 +01:00
sjg f9691fee1e [perf](trx-backend-soapysdr): vectorize wfm discriminator angle
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:30:41 +01:00
sjg 72219956d9 [perf](trx-backend-soapysdr): trim wfm resampler taps
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:21:50 +01:00
sjg b2ce62646c [fix](trx-backend-soapysdr): improve wfm stereo blend threshold
Raise the stereo blend floor from 0.55 to 0.75 at pilot lock and lower
the full-blend ceiling from stereo_detect_level 0.92 to 0.70.  This
gives real-world signals with moderate pilot strength much better L/R
separation (~17 dB immediately at lock vs ~5 dB before) and reaches
full unity blend sooner.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:20:38 +01:00
sjg 926a02e043 [perf](trx-backend-soapysdr): streamline wfm decode loop
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:19:47 +01:00
sjg b42e557a25 [perf](trx-backend-soapysdr): pack iq fir filtering
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:17:16 +01:00
sjg 198efa2092 [perf](trx-backend-soapysdr): update fir overlap in place
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:13:10 +01:00
sjg 7a6467320b [perf](trx-backend-soapysdr): reuse fir scratch buffers
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:10:34 +01:00
sjg ca0f236f4a [perf](trx-backend-soapysdr): reduce mixer and buffer overhead
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:07:19 +01:00
sjg bec3fc72d3 [fix](trx-backend-soapysdr): widen wfm stereo image
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 01:03:05 +01:00
sjg 6f37f9c66b [fix](trx-backend-soapysdr): refine wfm stereo tracking
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:58:20 +01:00
sjg e84a0599fa [feat](trx-backend-soapysdr): add avx2 wfm hot paths
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:52:53 +01:00
sjg 3e88c3f5d9 [feat](trx-backend-soapysdr): speed up fir and widen wfm resampler
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:50:04 +01:00
sjg 5411607b63 [fix](trx-backend-soapysdr): honor frontend wfm bandwidth
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:46:08 +01:00
sjg 17c70f89e5 [fix](trx-backend-soapysdr): fully reset wfm decoder on tune
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:41:28 +01:00
sjg fdcc732c83 [fix](trx-backend-soapysdr): retune wfm fir window
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:38:44 +01:00
sjg b0d8ce8e29 [fix](trx-backend-soapysdr): restore wfm agc and cutoffs
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:35:19 +01:00
sjg a6847742d9 [fix](trx-backend-soapysdr): keep wfm discriminator state across blocks
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:31:41 +01:00
sjg a8ed9e8fa4 [fix](trx-backend-soapysdr): lower wfm internal rate ceiling
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:24:33 +01:00
sjg a25182ea3f [fix](trx-backend-soapysdr): drop wfm limiter and widen cutoffs
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:20:41 +01:00
sjg 3b277da243 [fix](trx-backend-soapysdr): make wfm limiter bass-insensitive
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:10:54 +01:00
sjg 206696acc5 [feat](trx-backend-soapysdr): add adaptive wfm stereo blend
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:07:13 +01:00
sjg 5060522541 [fix](trx-backend-soapysdr): add wfm limiter and restore cutoffs
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:02:19 +01:00
sjg b6f0a9967d [fix](trx-backend-soapysdr): improve wfm stereo separation trim
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-01 00:00:31 +01:00
sjg 32822effda [fix](trx-backend-soapysdr): retune wfm sum and diff cutoffs
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:55:17 +01:00
sjg 635d2b39bb [fix](trx-backend-soapysdr): add stereo diff high-pass and headroom
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:51:26 +01:00
sjg 420e98de31 [feat](trx-client,trx-frontend-http): add default rig and hideable rf gain
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:45:17 +01:00
sjg 9453c90dac [fix](trx-backend-soapysdr): retune wfm stereo difference path
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:41:07 +01:00
sjg 0dd91a952b [fix](trx-backend-soapysdr): add headroom to wfm stereo matrix
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:38:18 +01:00
sjg 6d466f44d2 [fix](trx-backend-soapysdr): narrow wfm stereo difference band
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:37:08 +01:00
sjg 9e49bfbcc8 [fix](trx-backend-soapysdr): latch full stereo blend after lock
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:34:43 +01:00
sjg 617255cd32 [feat](trx-rs): expose live sdr gain control
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:30:08 +01:00
sjg 93e507606e [feat](trx-server,trx-backend-soapysdr): add sdr gain ceiling
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:23:41 +01:00
sjg dbeec9fb39 [feat](trx-backend-soapysdr): use fir resampler for wfm audio
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:17:15 +01:00
sjg 96da7ca471 [style](trx-frontend-http): lower rds overlay badge
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:12:38 +01:00
sjg 5a6ff1427a [fix](trx-client,trx-backend-soapysdr): improve rig switching and fm agc
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 23:06:53 +01:00
sjg 8440fe164b [fix](trx-backend-soapysdr): reduce wfm audio cutoff
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 22:54:03 +01:00
sjg 735c9a7f07 [fix](trx-backend-soapysdr): bypass agc for wfm audio
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 22:38:54 +01:00
sjg 3ccda5fb5a [fix](trx-backend-soapysdr,trx-frontend-http): reset stereo state and soften wfm top end
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 22:34:54 +01:00
sjg 3a75b7ac5b [fix](trx-frontend-http): satisfy audio copyTo arguments
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 22:28:35 +01:00
sjg 85ad204974 [fix](trx-frontend-http): handle stereo audio frame layouts
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 22:26:56 +01:00
sjg f06dbc921a [fix](trx-frontend-http): reconfigure audio stream on rig change
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 22:23:03 +01:00