NFM demod: optimized feed routine. Fixed channel power calculation

pull/6/head
f4exb 2015-10-11 06:34:12 +02:00
rodzic 23f773c111
commit e9f122fac1
3 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -122,7 +122,8 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
for (SampleVector::const_iterator it = begin; it != end; ++it)
{
Complex c(it->real() / 32768.0f, it->imag() / 32768.0f);
//Complex c(it->real() / 32768.0f, it->imag() / 32768.0f);
Complex c(it->real(), it->imag());
c *= m_nco.nextIQ();
{
@ -135,7 +136,7 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
//ci *= (m_agcLevel / m_AGC.getValue());
m_AGC.feed(ci);
m_magsq = m_AGC.getMagSq();
//m_magsq = m_AGC.getMagSq() / (1<<30);
// demod
/*
@ -172,7 +173,7 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
// AF processing
squelchOpen = (getMagSq() > m_squelchLevel);
squelchOpen = (getMag() > m_squelchLevel);
/*
if (m_afSquelch.analyze(demod))
@ -355,7 +356,7 @@ void NFMDemod::apply()
if (m_config.m_squelch != m_running.m_squelch)
{
// input is a value in tenths of dB
m_squelchLevel = pow(10.0, m_config.m_squelch / 100.0);
m_squelchLevel = pow(10.0, m_config.m_squelch / 200.0);
//m_squelchLevel *= m_squelchLevel;
m_afSquelch.setThreshold(m_squelchLevel);
}

Wyświetl plik

@ -64,7 +64,7 @@ public:
m_ctcssIndexSelected = selectedCtcssIndex;
}
Real getMagSq() { return m_AGC.getAverage() / 4534.0; }
Real getMag() { return m_AGC.getAverage() / (1<<15); }
private:
class MsgConfigureNFMDemod : public Message {

Wyświetl plik

@ -341,7 +341,7 @@ void NFMDemodGUI::blockApplySettings(bool block)
void NFMDemodGUI::tick()
{
Real powDb = CalcDb::dbPower(m_nfmDemod->getMagSq());
Real powDb = CalcDb::dbPower(m_nfmDemod->getMag()) * 2;
m_channelPowerDbAvg.feed(powDb);
ui->channelPower->setText(QString::number(m_channelPowerDbAvg.average(), 'f', 1));
}