mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 17:28:50 -05:00
Frequency Tracker: init sequence fix. Tracking low correction threshold. GUI updates
This commit is contained in:
parent
1a5f643705
commit
30725b9651
@ -80,18 +80,17 @@ FreqTracker::FreqTracker(DeviceSourceAPI *deviceAPI) :
|
||||
#endif
|
||||
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_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
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();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
|
||||
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
|
||||
}
|
||||
|
||||
FreqTracker::~FreqTracker()
|
||||
@ -760,19 +759,22 @@ void FreqTracker::tick()
|
||||
{
|
||||
uint32_t decayDivider = 1000.0 * m_settings.m_alphaEMA;
|
||||
int decayAmount = m_channelSampleRate < decayDivider ? 1 : m_channelSampleRate / decayDivider;
|
||||
int trim = m_channelSampleRate / 1000;
|
||||
|
||||
if (m_lastCorrAbs < decayAmount)
|
||||
{
|
||||
FreqTrackerSettings settings = m_settings;
|
||||
settings.m_inputFrequencyOffset += m_avgDeltaFreq;
|
||||
m_lastCorrAbs = m_avgDeltaFreq < 0 ? m_avgDeltaFreq : m_avgDeltaFreq;
|
||||
applySettings(settings);
|
||||
m_lastCorrAbs = m_avgDeltaFreq < 0 ? -m_avgDeltaFreq : m_avgDeltaFreq;
|
||||
|
||||
if (m_lastCorrAbs > trim)
|
||||
{
|
||||
FreqTrackerSettings settings = m_settings;
|
||||
settings.m_inputFrequencyOffset += m_avgDeltaFreq;
|
||||
applySettings(settings);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_lastCorrAbs >= decayAmount) {
|
||||
m_lastCorrAbs -= decayAmount;
|
||||
}
|
||||
m_lastCorrAbs -= decayAmount;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -581,6 +581,9 @@
|
||||
<layout class="QHBoxLayout" name="squelchLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="squelchLabel">
|
||||
<property name="toolTip">
|
||||
<string>Squelch indicator</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sq</string>
|
||||
</property>
|
||||
@ -616,6 +619,9 @@
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Squelch level (dB)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-40dB</string>
|
||||
</property>
|
||||
@ -639,7 +645,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Squelch gate (ms)</string>
|
||||
<string>Squelch gate</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
|
Loading…
Reference in New Issue
Block a user