From 4b267c2e1e98a321733784335d6a1cd4ccdc47c8 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Tue, 28 Apr 2020 22:35:06 +0200 Subject: [PATCH] Move downsampling tap point --- FM.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/FM.cpp b/FM.cpp index 3bc6a3b..2bed736 100644 --- a/FM.cpp +++ b/FM.cpp @@ -78,10 +78,12 @@ void CFM::samples(bool cos, q15_t* samples, uint8_t length) bool validCTCSS = CTCSS_VALID(ctcssState); stateMachine(validCTCSS && cos, i + 1U); } - + // Only let audio through when relaying audio - if (m_state == FS_RELAYING || m_state == FS_KERCHUNK) + if (m_state == FS_RELAYING || m_state == FS_KERCHUNK) { + m_downsampler.addSample(currentSample); currentSample = m_blanking.process(currentSample); + } else currentSample = 0U; @@ -100,9 +102,7 @@ void CFM::samples(bool cos, q15_t* samples, uint8_t length) if (!m_callsign.isRunning() && !m_rfAck.isRunning()) currentSample += m_timeoutTone.getAudio(); - currentSample = q15_t(m_filterStage3.filter(m_filterStage2.filter(m_filterStage1.filter(currentSample)))); - - m_downsampler.addSample(currentSample); + currentSample = m_filterStage3.filter(m_filterStage2.filter(m_filterStage1.filter(currentSample))); currentSample += m_ctcssTX.getAudio();