1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

FreeDV modulator: make modem output scaling depend on mode to optimize modulation module level

This commit is contained in:
f4exb 2019-02-24 11:21:21 +01:00
parent 66284abdb4
commit 951e0243f2
2 changed files with 8 additions and 2 deletions

View File

@ -80,7 +80,8 @@ FreeDVMod::FreeDVMod(DeviceSinkAPI *deviceAPI) :
m_iSpeech(0),
m_iModem(0),
m_speechIn(0),
m_modOut(0)
m_modOut(0),
m_scaleFactor(SDR_TX_SCALEF)
{
setObjectName(m_channelId);
@ -307,7 +308,7 @@ void FreeDVMod::pullAF(Complex& sample)
m_iModem = 0;
}
ci.real(m_modOut[m_iModem++] / (SDR_TX_SCALEF/8.0f));
ci.real(m_modOut[m_iModem++] / m_scaleFactor);
ci.imag(0.0f);
n_out = m_SSBFilter->runSSB(ci, &filtered, true); // USB
@ -595,16 +596,20 @@ void FreeDVMod::applyFreeDVMode(FreeDVModSettings::FreeDVMode mode)
{
case FreeDVModSettings::FreeDVMode700D:
fdv_mode = FREEDV_MODE_700D;
m_scaleFactor = SDR_TX_SCALEF / 3.2f;
break;
case FreeDVModSettings::FreeDVMode800XA:
fdv_mode = FREEDV_MODE_800XA;
m_scaleFactor = SDR_TX_SCALEF / 8.2f;
break;
case FreeDVModSettings::FreeDVMode1600:
fdv_mode = FREEDV_MODE_1600;
m_scaleFactor = SDR_TX_SCALEF / 3.2f;
break;
case FreeDVModSettings::FreeDVMode2400A:
default:
fdv_mode = FREEDV_MODE_2400A;
m_scaleFactor = SDR_TX_SCALEF / 8.2f;
break;
}

View File

@ -324,6 +324,7 @@ private:
int m_iModem;
int16_t *m_speechIn;
int16_t *m_modOut;
float m_scaleFactor; //!< divide by this amount to scale from int16 to float in [-1.0, 1.0] interval
static const int m_levelNbSamples;