Opt-in channel-power squelch for AM audio RX (#3315)

* AM: add opt-in channel-power squelch for AM audio RX

Add an SDR++-style power squelch on the complex channel signal for the
Analog Audio RX app in AM modes (DSB/SSB/CW). The squelch measures the
mean channel power, converts it to dBFS, and mutes the demodulated audio
when the signal is below a user-set threshold. Being carrier-based it
keys on the AM carrier (e.g. airband/ATC) rather than on audio-band
noise, which the existing FM squelch could not do for AM.

A new 'SQ' field (0-99, 0 = off) is added to the AM options view and is
persisted per app via app_settings. Default is 0, so existing AM
behaviour is unchanged unless the user enables it. Threshold maps 1..99
to -80..-20 dBFS.

Touches: message (AMConfigureMessage.squelch_level), baseband_api
(AMConfig::apply), receiver_model (am_squelch_level get/set),
app_settings (persistence), proc_am_audio (DSP), analog_audio_app (UI).

* Refactor audio power calculation to use magnitude squared

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Mo
2026-09-14 20:54:54 +02:00
committed by GitHub
parent d72b5ed0b1
commit b8ad44c431
11 changed files with 78 additions and 10 deletions
+3
View File
@@ -203,6 +203,7 @@ void copy_to_radio_model(const AppSettings& settings) {
settings.wfm_config_index,
settings.wfmam_config_index,
settings.squelch);
receiver_model.set_am_squelch_level(settings.am_squelch);
}
receiver_model.set_frequency_step(settings.step);
@@ -227,6 +228,7 @@ void copy_from_radio_model(AppSettings& settings) {
settings.vga = receiver_model.vga();
settings.rx_amp = receiver_model.rf_amp();
settings.squelch = receiver_model.squelch_level();
settings.am_squelch = receiver_model.am_squelch_level();
settings.modulation = static_cast<uint8_t>(receiver_model.modulation());
settings.am_config_index = receiver_model.am_configuration();
@@ -288,6 +290,7 @@ SettingsManager::SettingsManager(
bindings_.emplace_back("wfm_config_index"sv, &settings_.wfm_config_index);
bindings_.emplace_back("wfmam_config_index"sv, &settings_.wfmam_config_index);
bindings_.emplace_back("squelch"sv, &settings_.squelch);
bindings_.emplace_back("am_squelch"sv, &settings_.am_squelch);
}
// Common model settings.