mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-12-04 19:45:02 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user