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

Frequency Tracker: init sequence fix. Tracking low correction threshold. GUI updates

This commit is contained in:
f4exb 2019-05-06 01:57:41 +02:00
parent 1a5f643705
commit 30725b9651
2 changed files with 21 additions and 13 deletions

View File

@ -80,18 +80,17 @@ FreqTracker::FreqTracker(DeviceSourceAPI *deviceAPI) :
#endif #endif
m_magsq = 0.0; m_magsq = 0.0;
m_rrcFilter = new fftfilt(m_settings.m_rfBandwidth / m_channelSampleRate, 2*1024);
m_pll.computeCoefficients(0.002f, 0.5f, 10.0f); // bandwidth, damping factor, loop gain
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
m_channelizer = new DownChannelizer(this); m_channelizer = new DownChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer); m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this); m_deviceAPI->addChannelAPI(this);
m_pll.computeCoefficients(0.002f, 0.5f, 10.0f); // bandwidth, damping factor, loop gain
m_rrcFilter = new fftfilt(m_settings.m_rfBandwidth / m_channelSampleRate, 2*1024);
m_networkManager = new QNetworkAccessManager(); m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
} }
FreqTracker::~FreqTracker() FreqTracker::~FreqTracker()
@ -760,19 +759,22 @@ void FreqTracker::tick()
{ {
uint32_t decayDivider = 1000.0 * m_settings.m_alphaEMA; uint32_t decayDivider = 1000.0 * m_settings.m_alphaEMA;
int decayAmount = m_channelSampleRate < decayDivider ? 1 : m_channelSampleRate / decayDivider; int decayAmount = m_channelSampleRate < decayDivider ? 1 : m_channelSampleRate / decayDivider;
int trim = m_channelSampleRate / 1000;
if (m_lastCorrAbs < decayAmount) if (m_lastCorrAbs < decayAmount)
{ {
FreqTrackerSettings settings = m_settings; m_lastCorrAbs = m_avgDeltaFreq < 0 ? -m_avgDeltaFreq : m_avgDeltaFreq;
settings.m_inputFrequencyOffset += m_avgDeltaFreq;
m_lastCorrAbs = m_avgDeltaFreq < 0 ? m_avgDeltaFreq : m_avgDeltaFreq; if (m_lastCorrAbs > trim)
applySettings(settings); {
FreqTrackerSettings settings = m_settings;
settings.m_inputFrequencyOffset += m_avgDeltaFreq;
applySettings(settings);
}
} }
else else
{ {
if (m_lastCorrAbs >= decayAmount) { m_lastCorrAbs -= decayAmount;
m_lastCorrAbs -= decayAmount;
}
} }
} }

View File

@ -581,6 +581,9 @@
<layout class="QHBoxLayout" name="squelchLayout"> <layout class="QHBoxLayout" name="squelchLayout">
<item> <item>
<widget class="QLabel" name="squelchLabel"> <widget class="QLabel" name="squelchLabel">
<property name="toolTip">
<string>Squelch indicator</string>
</property>
<property name="text"> <property name="text">
<string>Sq</string> <string>Sq</string>
</property> </property>
@ -616,6 +619,9 @@
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Squelch level (dB)</string>
</property>
<property name="text"> <property name="text">
<string>-40dB</string> <string>-40dB</string>
</property> </property>
@ -639,7 +645,7 @@
</size> </size>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Squelch gate (ms)</string> <string>Squelch gate</string>
</property> </property>
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>