mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 17:58:43 -05:00
SSB demod: implement audio mute button squelch light indicator
This commit is contained in:
parent
52eb869b7c
commit
8452985061
@ -38,6 +38,7 @@ SSBDemod::SSBDemod(BasebandSampleSink* sampleSink) :
|
|||||||
m_agcNbSamples(12000),
|
m_agcNbSamples(12000),
|
||||||
m_agcPowerThreshold(1e-2),
|
m_agcPowerThreshold(1e-2),
|
||||||
m_agcThresholdGate(0),
|
m_agcThresholdGate(0),
|
||||||
|
m_audioActive(false),
|
||||||
m_sampleSink(sampleSink),
|
m_sampleSink(sampleSink),
|
||||||
m_audioFifo(4, 24000),
|
m_audioFifo(4, 24000),
|
||||||
m_settingsMutex(QMutex::Recursive)
|
m_settingsMutex(QMutex::Recursive)
|
||||||
@ -181,6 +182,9 @@ void SSBDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
m_sum.imag(0.0);
|
m_sum.imag(0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double agcVal = m_agcActive ? m_agc.feedAndGetValue(sideband[i]) : 1.0;
|
||||||
|
m_audioActive = agcVal != 0.0;
|
||||||
|
|
||||||
if (m_audioMute)
|
if (m_audioMute)
|
||||||
{
|
{
|
||||||
m_audioBuffer[m_audioBufferFill].r = 0;
|
m_audioBuffer[m_audioBufferFill].r = 0;
|
||||||
@ -188,8 +192,6 @@ void SSBDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double agcVal = m_agcActive ? m_agc.feedAndGetValue(sideband[i]) : 1.0;
|
|
||||||
|
|
||||||
if (m_audioBinaual)
|
if (m_audioBinaual)
|
||||||
{
|
{
|
||||||
if (m_audioFlipChannels)
|
if (m_audioFlipChannels)
|
||||||
|
@ -56,6 +56,7 @@ public:
|
|||||||
virtual bool handleMessage(const Message& cmd);
|
virtual bool handleMessage(const Message& cmd);
|
||||||
|
|
||||||
double getMagSq() const { return m_magsq; }
|
double getMagSq() const { return m_magsq; }
|
||||||
|
bool getAudioActive() const { return m_audioActive; }
|
||||||
|
|
||||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
|
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
|
||||||
{
|
{
|
||||||
@ -185,6 +186,7 @@ private:
|
|||||||
int m_agcNbSamples; //!< number of audio (48 kHz) samples for AGC averaging
|
int m_agcNbSamples; //!< number of audio (48 kHz) samples for AGC averaging
|
||||||
double m_agcPowerThreshold; //!< AGC power threshold (linear)
|
double m_agcPowerThreshold; //!< AGC power threshold (linear)
|
||||||
int m_agcThresholdGate; //!< Gate length in number of samples befor threshold triggers
|
int m_agcThresholdGate; //!< Gate length in number of samples befor threshold triggers
|
||||||
|
bool m_audioActive; //!< True if an audio signal is produced (no AGC or AGC and above threshold)
|
||||||
|
|
||||||
NCOF m_nco;
|
NCOF m_nco;
|
||||||
Interpolator m_interpolator;
|
Interpolator m_interpolator;
|
||||||
|
@ -357,7 +357,8 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
|
|||||||
m_audioFlipChannels(false),
|
m_audioFlipChannels(false),
|
||||||
m_dsb(false),
|
m_dsb(false),
|
||||||
m_audioMute(false),
|
m_audioMute(false),
|
||||||
m_channelPowerDbAvg(20,0)
|
m_channelPowerDbAvg(20,0),
|
||||||
|
m_squelchOpen(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
@ -549,4 +550,17 @@ void SSBDemodGUI::tick()
|
|||||||
nbMagsqSamples);
|
nbMagsqSamples);
|
||||||
|
|
||||||
ui->channelPower->setText(tr("%1 dB").arg(powDbAvg, 0, 'f', 1));
|
ui->channelPower->setText(tr("%1 dB").arg(powDbAvg, 0, 'f', 1));
|
||||||
|
|
||||||
|
bool squelchOpen = m_ssbDemod->getAudioActive();
|
||||||
|
|
||||||
|
if (squelchOpen != m_squelchOpen)
|
||||||
|
{
|
||||||
|
if (squelchOpen) {
|
||||||
|
ui->audioMute->setStyleSheet("QToolButton { background-color : green; }");
|
||||||
|
} else {
|
||||||
|
ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||||
|
}
|
||||||
|
|
||||||
|
m_squelchOpen = squelchOpen;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,7 @@ private:
|
|||||||
bool m_dsb;
|
bool m_dsb;
|
||||||
bool m_audioMute;
|
bool m_audioMute;
|
||||||
MovingAverage<double> m_channelPowerDbAvg;
|
MovingAverage<double> m_channelPowerDbAvg;
|
||||||
|
bool m_squelchOpen;
|
||||||
|
|
||||||
ThreadedBasebandSampleSink* m_threadedChannelizer;
|
ThreadedBasebandSampleSink* m_threadedChannelizer;
|
||||||
DownChannelizer* m_channelizer;
|
DownChannelizer* m_channelizer;
|
||||||
|
@ -521,7 +521,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>AGC power threshold (dB)</string>
|
<string>Power threshold (dB)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-99</number>
|
<number>-99</number>
|
||||||
@ -546,7 +546,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>AGC power threshold (dB)</string>
|
<string>Power threshold (dB)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>-00</string>
|
<string>-00</string>
|
||||||
@ -565,7 +565,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Set threshiold gate (ms)</string>
|
<string>Power threshiold gate (ms)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>20</number>
|
<number>20</number>
|
||||||
@ -587,7 +587,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Threshiold gate (ms)</string>
|
<string>Power threshiold gate (ms)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>00</string>
|
<string>00</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user