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

ATV Demod: effectively implemented interpolator

This commit is contained in:
f4exb 2017-03-18 09:19:51 +01:00
parent 93a45e88f5
commit 4c983abd0b
5 changed files with 33 additions and 23 deletions

View File

@ -193,13 +193,13 @@ void ATVDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
#endif
Complex c(fltI, fltQ);
if (m_objRFRunning.m_intFrequencyOffset != 0)
{
c *= m_nco.nextIQ();
}
if (m_objRFRunning.m_blndecimatorEnable)
{
if (m_objRFRunning.m_intFrequencyOffset != 0)
{
c *= m_nco.nextIQ();
}
if (m_interpolator.decimate(&m_interpolatorDistanceRemain, c, &ci))
{
demod(ci);
@ -595,6 +595,7 @@ void ATVDemod::applySettings()
if ((m_objConfig.m_intSampleRate != m_objRunning.m_intSampleRate)
|| (m_objRFConfig.m_fltRFBandwidth != m_objRFRunning.m_fltRFBandwidth))
{
m_objSettingsMutex.lock();
m_intTVSampleRate = (m_objConfig.m_intSampleRate / 1000000) * 1000000; // make sure working sample rate is a multiple of rate units
if (m_intTVSampleRate > 0)
@ -604,12 +605,12 @@ void ATVDemod::applySettings()
else
{
m_intTVSampleRate = m_objConfig.m_intSampleRate;
m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = 1.0f;
}
m_interpolatorDistanceRemain = 0;
m_interpolator.create(48, m_intTVSampleRate, m_objRFConfig.m_fltRFBandwidth / 2.2, 3.0);
m_objSettingsMutex.unlock();
}
if((m_objConfig.m_fltFramePerS != m_objRunning.m_fltFramePerS)

View File

@ -213,6 +213,7 @@ private:
m_objMsgConfig.m_fltRFBandwidth = fltRFBandwidth;
m_objMsgConfig.m_fltRFOppBandwidth = fltRFOppBandwidth;
m_objMsgConfig.m_blnFFTFiltering = blnFFTFiltering;
m_objMsgConfig.m_blndecimatorEnable = blndecimatorEnable;
}
};

View File

@ -361,7 +361,7 @@ void ATVDemodGUI::applyRFSettings()
ui->rfBW->value() * 100000.0f,
ui->rfOppBW->value() * 100000.0f,
ui->rfFiltering->isChecked(),
ui->decimator->isChecked());
ui->decimatorEnable->isChecked());
}
}
@ -490,6 +490,7 @@ void ATVDemodGUI::on_modulation_currentIndexChanged(int index)
}
else
{
m_objChannelMarker.setBandwidth(ui->rfBW->value()*100000);
m_objChannelMarker.setSidebands(ChannelMarker::dsb);
}
}
@ -565,6 +566,7 @@ void ATVDemodGUI::on_rfFiltering_toggled(bool checked)
}
else
{
m_objChannelMarker.setOppositeBandwidth(ui->rfOppBW->value()*100000);
m_objChannelMarker.setSidebands(ChannelMarker::dsb);
}
}
@ -578,7 +580,7 @@ void ATVDemodGUI::on_rfFiltering_toggled(bool checked)
applyRFSettings();
}
void ATVDemodGUI::on_decimator_toggled(bool checked)
void ATVDemodGUI::on_decimatorEnable_toggled(bool checked)
{
applyRFSettings();
}

View File

@ -75,7 +75,7 @@ private slots:
void on_rfBW_valueChanged(int value);
void on_rfOppBW_valueChanged(int value);
void on_rfFiltering_toggled(bool checked);
void on_decimator_toggled(bool checked);
void on_decimatorEnable_toggled(bool checked);
void on_deltaFrequency_changed(quint64 value);
void on_deltaFrequencyMinus_toggled(bool minus);

View File

@ -52,6 +52,20 @@
</property>
<item>
<layout class="QHBoxLayout" name="rfSettings1Layout">
<item>
<widget class="ButtonSwitch" name="decimatorEnable">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/arrow_down.png</normaloff>:/arrow_down.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="deltaFrequencyLayout">
<item>
@ -65,6 +79,9 @@
<selectedon>:/minus.png</selectedon>
</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -98,20 +115,6 @@
</item>
</layout>
</item>
<item>
<widget class="ButtonSwitch" name="decimator">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/arrow_down.png</normaloff>:/arrow_down.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="channelSampleRateText">
<property name="minimumSize">
@ -195,6 +198,9 @@
<layout class="QHBoxLayout" name="rfSettings2Layout">
<item>
<widget class="ButtonSwitch" name="rfFiltering">
<property name="toolTip">
<string>Engage asymmertical bandpass FFT filter</string>
</property>
<property name="text">
<string/>
</property>