Anti-alias filter before RF->network downsampling in FM mode

The 24kHz->8kHz decimation in CFMDownSampler had no lowpass ahead of
it, aliasing everything above 4kHz back into the audio band. Reuse
the existing 300-2700Hz filter design (separate instance/state) ahead
of all three addSample() call sites in FM.cpp.

Also: reset() wasn't clearing the ring buffer or in-progress sample
pack, so stale audio could bleed into the next transmission. And
addSample() packed samples into 12 bits with no saturation, so an
out-of-range value corrupted the neighbouring sample.
This commit is contained in:
Cort Buffington
2026-08-11 09:57:47 -05:00
parent 894ba76432
commit 4c7e8fbe46
3 changed files with 23 additions and 6 deletions
+3
View File
@@ -80,6 +80,9 @@ private:
CFMDirectFormI m_filterStage1;
CFMDirectFormI m_filterStage2;
CFMDirectFormI m_filterStage3;
CFMDirectFormI m_dsFilterStage1; // anti-alias filter for the downsampler, own state
CFMDirectFormI m_dsFilterStage2;
CFMDirectFormI m_dsFilterStage3;
CFMBlanking m_blanking;
uint8_t m_accessMode;
bool m_linkMode;