SSB Modulator: interim state (3)

This commit is contained in:
f4exb 2016-12-13 01:33:25 +01:00
parent 915a73e509
commit 604db50b2b
1 changed files with 10 additions and 10 deletions

View File

@ -190,27 +190,27 @@ void SSBMod::pullAF(Complex& sample)
if (m_ifstream.eof()) if (m_ifstream.eof())
{ {
sample.real() = 0.0f; sample.real(0.0f);
sample.imag() = 0.0f; sample.imag(0.0f);
} }
else else
{ {
Real real; Real real;
m_ifstream.read(reinterpret_cast<char*>(&real), sizeof(Real)); m_ifstream.read(reinterpret_cast<char*>(&real), sizeof(Real));
sample.real() = real * m_running.m_volumeFactor; sample.real(real * m_running.m_volumeFactor);
sample.imag() = 0.0f; sample.imag(0.0f);
} }
} }
else else
{ {
sample.real() = 0.0f; sample.real(0.0f);
sample.imag() = 0.0f; sample.imag(0.0f);
} }
break; break;
case SSBModInputAudio: case SSBModInputAudio:
m_audioFifo.read(reinterpret_cast<quint8*>(audioSample), 1, 10); m_audioFifo.read(reinterpret_cast<quint8*>(audioSample), 1, 10);
sample.real() = ((audioSample[0] + audioSample[1]) / 65536.0f) * m_running.m_volumeFactor; sample.real(((audioSample[0] + audioSample[1]) / 65536.0f) * m_running.m_volumeFactor);
sample.imag() = 0.0f; sample.imag(0.0f);
break; break;
case SSBModInputCWTone: case SSBModInputCWTone:
if (m_cwKeyer.getSample()) if (m_cwKeyer.getSample())
@ -219,8 +219,8 @@ void SSBMod::pullAF(Complex& sample)
} }
else else
{ {
sample.real() = 0.0f; sample.real(0.0f);
sample.imag() = 0.0f; sample.imag(0.0f);
m_toneNco.setPhase(0); m_toneNco.setPhase(0);
} }
break; break;