From 003a04ed70d40ff3797d26ed49f70dca1e67b8f5 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 26 Nov 2023 11:37:55 +0100 Subject: [PATCH] NFM modulator: applied suggested fixes. Fixes #1899 --- plugins/channeltx/modnfm/nfmmodsource.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/channeltx/modnfm/nfmmodsource.cpp b/plugins/channeltx/modnfm/nfmmodsource.cpp index 84476a172f..c6016e33d5 100644 --- a/plugins/channeltx/modnfm/nfmmodsource.cpp +++ b/plugins/channeltx/modnfm/nfmmodsource.cpp @@ -168,16 +168,16 @@ void NFMModSource::modulateSample() calculateLevel(t); if (m_settings.m_ctcssOn) { - t1 = (0.85f * m_bandpass.filter(t) + 0.15f * 0.625f * m_ctcssNco.next()) * 1.2f; + t1 = 0.85f * m_bandpass.filter(t) + 0.15f * 0.625f * m_ctcssNco.next(); } else if (m_settings.m_dcsOn) { - t1 = (0.9f * m_bandpass.filter(t) + 0.1f * 0.625f * m_dcsMod.next()) * 1.2f; + t1 = 0.9f * m_bandpass.filter(t) + 0.1f * 0.625f * m_dcsMod.next(); } else if (m_settings.m_bpfOn) { - t1 = m_bandpass.filter(t) * 1.2f; + t1 = m_bandpass.filter(t); } else { - t1 = m_lowpass.filter(t) * 1.2f; + t1 = m_lowpass.filter(t); } - m_modPhasor += (m_settings.m_fmDeviation / (float) m_audioSampleRate) * t1; + m_modPhasor += (M_PI * m_settings.m_fmDeviation / (float) m_audioSampleRate) * t1; // limit phasor range to ]-pi,pi] if (m_modPhasor > M_PI) {