1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00

Channel analyzer NG: fixes

This commit is contained in:
f4exb 2018-05-20 02:24:38 +02:00
parent 524c7fbe7c
commit ed08480226
3 changed files with 31 additions and 8 deletions

View File

@ -106,14 +106,31 @@ void ChannelAnalyzerNGGUI::displaySettings()
blockApplySettings(true);
ui->useRationalDownsampler->setChecked(m_settings.m_downSample);
ui->channelSampleRate->setValue(m_settings.m_downSampleRate);
setNewFinalRate();
ui->BW->setValue(m_settings.m_bandwidth/100);
ui->lowCut->setValue(m_settings.m_lowCutoff/100);
ui->deltaFrequency->setValue(m_settings.m_frequency);
ui->spanLog2->setCurrentIndex(m_settings.m_spanLog2);
displayPLLSettings();
blockApplySettings(false);
}
setNewFinalRate();
void ChannelAnalyzerNGGUI::displayPLLSettings()
{
if (m_settings.m_fll)
{
ui->pllPskOrder->setCurrentIndex(5);
}
else
{
int i = 0;
for(; ((m_settings.m_pllPskOrder>>i) & 1) == 0; i++);
ui->pllPskOrder->setCurrentIndex(i);
}
ui->pll->setChecked(m_settings.m_pll);
}
void ChannelAnalyzerNGGUI::setSpectrumDisplay()
@ -163,6 +180,7 @@ bool ChannelAnalyzerNGGUI::handleMessage(const Message& message)
{
qDebug() << "ChannelAnalyzerNGGUI::handleMessage: MsgReportChannelSampleRateChanged";
ui->channelSampleRate->setValueRange(7, 2000U, m_channelAnalyzer->getInputSampleRate());
ui->channelSampleRate->setValue(m_settings.m_downSampleRate);
setNewFinalRate();
return true;
@ -229,16 +247,18 @@ void ChannelAnalyzerNGGUI::on_pll_toggled(bool checked)
ui->pll->setToolTip(tr("PLL lock"));
}
m_settings.m_pll = checked;
applySettings();
}
void ChannelAnalyzerNGGUI::on_pllPskOrder_currentIndexChanged(int index)
{
if (index < 5)
{
if (index < 5) {
m_settings.m_pllPskOrder = (1<<index);
applySettings();
}
m_settings.m_fll = (index == 5);
applySettings();
}
void ChannelAnalyzerNGGUI::on_useRationalDownsampler_toggled(bool checked)

View File

@ -86,6 +86,7 @@ private:
void blockApplySettings(bool block);
void applySettings(bool force = false);
void displaySettings();
void displayPLLSettings();
void setSpectrumDisplay();
void leaveEvent(QEvent*);

View File

@ -42,6 +42,7 @@ PhaseLockComplex::PhaseLockComplex() :
m_yIm(0.0),
m_freq(0.0),
m_freqPrev(0.0),
m_freqTest(0.0),
m_lockCount(0),
m_lockFreq(0.026f),
m_pskOrder(1),
@ -110,6 +111,7 @@ void PhaseLockComplex::reset()
m_yIm = 0.0f;
m_freq = 0.0f;
m_freqPrev = 0.0f;
m_freqTest = 0.0f;
m_lockCount = 0;
m_lockTimeCount = 0;
}
@ -169,13 +171,13 @@ void PhaseLockComplex::feed(float re, float im)
{
float dF = m_freq - m_freqTest;
if ((dF > -m_lockFreq) && (dF < m_lockFreq))
if ((dF > -m_lockFreq) && (dF < m_lockFreq))
{
if (m_lockCount < 20) {
m_lockCount++;
}
}
else
}
else
{
if (m_lockCount > 0) {
m_lockCount--;
@ -187,7 +189,7 @@ void PhaseLockComplex::feed(float re, float im)
}
m_freqPrev = m_freq;
m_phiHatPrev = m_phiHat;
m_phiHatPrev = m_phiHat;
}
else
{