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

Properly fixed frequency shift when there is no decimation

This commit is contained in:
f4exb 2015-05-09 19:03:17 +02:00
parent 7ea41283e8
commit b2e78e1411

View File

@ -201,14 +201,7 @@ int RTLSDRInput::getSampleRate() const
quint64 RTLSDRInput::getCenterFrequency() const
{
if (m_settings.m_log2Decim == 0) // Little wooby-doop if no decimation
{
return m_generalSettings.m_centerFrequency + (m_settings.m_samplerate / 4);
}
else
{
return m_generalSettings.m_centerFrequency;
}
return m_generalSettings.m_centerFrequency;
}
bool RTLSDRInput::handleMessage(Message* message)
@ -267,8 +260,15 @@ bool RTLSDRInput::applySettings(const GeneralSettings& generalSettings, const Se
m_generalSettings.m_centerFrequency = generalSettings.m_centerFrequency;
if(m_dev != NULL) {
if(rtlsdr_set_center_freq( m_dev, m_generalSettings.m_centerFrequency
+ (m_settings.m_samplerate / 4) ) != 0)
qint64 centerFrequency = m_generalSettings.m_centerFrequency + (m_settings.m_samplerate / 4);
if (m_settings.m_log2Decim == 0) { // Little wooby-doop if no decimation
centerFrequency = m_generalSettings.m_centerFrequency;
} else {
centerFrequency = m_generalSettings.m_centerFrequency + (m_settings.m_samplerate / 4);
}
if(rtlsdr_set_center_freq( m_dev, centerFrequency ) != 0)
qDebug("osmosdr_set_center_freq(%lld) failed", m_generalSettings.m_centerFrequency);
}