ATV modulator: corrected FM modulation

pull/480/head
f4exb 2019-11-27 03:20:56 +01:00
rodzic a5c5790b6f
commit 1d2bcf95f5
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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;