Skip to content

Commit

Permalink
NFM modulator: applied suggested fixes. Fixes f4exb#1899
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Nov 26, 2023
1 parent 7a71968 commit 003a04e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/channeltx/modnfm/nfmmodsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 003a04e

Please sign in to comment.