1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-04 15:04:38 -04:00

SSB demod: implement compressor based on sndfilter code. Removed previous AGC based compressor

This commit is contained in:
f4exb
2019-07-18 01:48:07 +02:00
parent 6ae81cce71
commit 827fc6cf27
299 changed files with 349 additions and 977 deletions
@@ -59,12 +59,6 @@ void SSBModSettings::resetToDefaults()
m_audioMute = false;
m_playLoop = false;
m_agc = false;
m_agcOrder = 0.2;
m_agcTime = 9600;
m_agcThresholdEnable = true;
m_agcThreshold = -40; // dB
m_agcThresholdGate = 192;
m_agcThresholdDelay = 2400;
m_rgbColor = QColor(0, 255, 0).rgb();
m_title = "SSB Modulator";
m_modAFInput = SSBModInputAF::SSBModInputNone;
@@ -100,11 +94,6 @@ QByteArray SSBModSettings::serialize() const
s.writeBool(10, m_audioFlipChannels);
s.writeBool(11, m_dsb);
s.writeBool(12, m_agc);
s.writeS32(13, getAGCTimeConstantIndex(m_agcTime/48));
s.writeS32(14, m_agcThreshold); // dB
s.writeS32(15, m_agcThresholdGate / 48);
s.writeS32(16, m_agcThresholdDelay / 48);
s.writeS32(17, roundf(m_agcOrder * 100.0));
if (m_channelMarker) {
s.writeBlob(18, m_channelMarker->serialize());
@@ -169,14 +158,6 @@ bool SSBModSettings::deserialize(const QByteArray& data)
d.readBool(11, &m_dsb, false);
d.readBool(12, &m_agc, false);
d.readS32(13, &tmp, 7);
m_agcTime = getAGCTimeConstant(tmp) * 48;
d.readS32(14, &m_agcThreshold, -40);
d.readS32(15, &tmp, 4);
m_agcThresholdGate = tmp * 48;
d.readS32(16, &tmp, 5);
m_agcThresholdDelay = tmp * 48;
d.readS32(17, &tmp, 20);
m_agcOrder = tmp / 100.0;
if (m_channelMarker) {
d.readBlob(18, &bytetmp);
@@ -216,27 +197,3 @@ bool SSBModSettings::deserialize(const QByteArray& data)
return false;
}
}
int SSBModSettings::getAGCTimeConstant(int index)
{
if (index < 0) {
return m_agcTimeConstant[0];
} else if (index < m_nbAGCTimeConstants) {
return m_agcTimeConstant[index];
} else {
return m_agcTimeConstant[m_nbAGCTimeConstants-1];
}
}
int SSBModSettings::getAGCTimeConstantIndex(int agcTimeConstant)
{
for (int i = 0; i < m_nbAGCTimeConstants; i++)
{
if (agcTimeConstant <= m_agcTimeConstant[i])
{
return i;
}
}
return m_nbAGCTimeConstants-1;
}