Add WFM (broadcast FM) demodulator support

Wires the new wdsp WFM API into the engine and adds a WFM preset to the
FM filter row (200 kHz BW / 75 kHz deviation). Also fixes WDSP_SAM
constant which was 12 — that slot is now RXA_WFM in the updated enum.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 22:40:24 +03:00
co-authored by Claude Opus 4.7
parent 83ec28f997
commit e52e32dc20
3 changed files with 82 additions and 25 deletions
+14
View File
@@ -495,6 +495,20 @@ procedure SetRXAFMLimRun(channel: Integer; run: Integer); cdecl; external WDSP_L
procedure SetRXAFMLimGain(channel: Integer; gaindB: Double); cdecl; external WDSP_LIB;
procedure SetRXAFMAFFilter(channel: Integer; low: Double; high: Double); cdecl; external WDSP_LIB;
// ---------------------------------------------------------------------------
// wfm.c / rds.c (Broadcast WFM demodulator with stereo MPX + RDS)
// Requires channel dsp_rate >= ~192 kHz for RDS, >= ~120 kHz for stereo only.
// ---------------------------------------------------------------------------
procedure SetRXAWFMStereo(channel: Integer; stereo_run: Integer); cdecl; external WDSP_LIB;
procedure SetRXAWFMRDS(channel: Integer; rds_run: Integer); cdecl; external WDSP_LIB;
procedure SetRXAWFMDeemphTau(channel: Integer; tau: Double); cdecl; external WDSP_LIB; // 50e-6 EU, 75e-6 US
procedure SetRXAWFMDeviation(channel: Integer; deviation: Double); cdecl; external WDSP_LIB;
function GetRXAWFMStereoLocked(channel: Integer): Integer; cdecl; external WDSP_LIB;
function GetRXAWFMRDSSynced(channel: Integer): Integer; cdecl; external WDSP_LIB;
// offset_type: 0=A, 1=B, 2=C, 3=C', 4=D. errors: 0 if syndrome matched cleanly.
function GetRXAWFMRDSBlock(channel: Integer; data: PWord; offset_type: PByte;
errors: PByte): Integer; cdecl; external WDSP_LIB;
// ---------------------------------------------------------------------------
// fmmod.c (FM Modulator)
// ---------------------------------------------------------------------------