From 1d2bcf95f51a996dcc75ca33a515f692428adfc4 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 27 Nov 2019 03:20:56 +0100 Subject: [PATCH] ATV modulator: corrected FM modulation --- plugins/channeltx/modatv/atvmodsource.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/channeltx/modatv/atvmodsource.cpp b/plugins/channeltx/modatv/atvmodsource.cpp index b1a9d789f..328fee640 100644 --- a/plugins/channeltx/modatv/atvmodsource.cpp +++ b/plugins/channeltx/modatv/atvmodsource.cpp @@ -178,9 +178,9 @@ void ATVModSource::modulateSample() switch (m_settings.m_atvModulation) { case ATVModSettings::ATVModulationFM: // FM half bandwidth deviation - m_modPhasor += (t - 0.5f) * m_settings.m_fmExcursion * 2.0f * M_PI; - if (m_modPhasor > 2.0f * M_PI) m_modPhasor -= 2.0f * M_PI; // limit growth - if (m_modPhasor < 2.0f * M_PI) m_modPhasor += 2.0f * M_PI; // limit growth + m_modPhasor += (t - 0.5f) * m_settings.m_fmExcursion * M_PI; + if (m_modPhasor > 2.0f * M_PI) m_modPhasor -= 2.0f * M_PI; // limit growth + if (m_modPhasor < 0) m_modPhasor += 2.0f * M_PI; // limit growth m_modSample.real(cos(m_modPhasor) * m_settings.m_rfScalingFactor); // -1 dB m_modSample.imag(sin(m_modPhasor) * m_settings.m_rfScalingFactor); break;