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

Merge pull request #1196 from majkrzak/fix/sdrplayv3-decimation

SDRPlayV3: Take LIF downsampling into account when calculating the final bandwidth
This commit is contained in:
Edouard Griffiths 2022-04-04 09:59:01 +02:00 committed by GitHub
commit 38c1a64b71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,8 +228,23 @@ const QString& SDRPlayV3Input::getDeviceDescription() const
int SDRPlayV3Input::getSampleRate() const
{
int rate = m_settings.m_devSampleRate;
return rate / (1 << m_settings.m_log2Decim);
uint32_t fsHz = m_settings.m_devSampleRate;
sdrplay_api_Bw_MHzT bwType = SDRPlayV3Bandwidths::getBandwidthEnum(m_settings.m_bandwidthIndex);
sdrplay_api_If_kHzT ifType = SDRPlayV3IF::getIFEnum(m_settings.m_ifFrequencyIndex);
if(
((fsHz == 8192000) && (bwType == sdrplay_api_BW_1_536) && (ifType == sdrplay_api_IF_2_048)) ||
((fsHz == 8000000) && (bwType == sdrplay_api_BW_1_536) && (ifType == sdrplay_api_IF_2_048)) ||
((fsHz == 8000000) && (bwType == sdrplay_api_BW_5_000) && (ifType == sdrplay_api_IF_2_048)) ||
((fsHz == 2000000) && (bwType <= sdrplay_api_BW_0_300) && (ifType == sdrplay_api_IF_0_450))) {
fsHz /= 4;
} else if ((fsHz == 2000000) && (bwType == sdrplay_api_BW_0_600) && (ifType == sdrplay_api_IF_0_450)) {
fsHz /= 2;
}else if ((fsHz == 6000000) && (bwType <= sdrplay_api_BW_1_536) && (ifType == sdrplay_api_IF_1_620)) {
fsHz /= 3;
}
return fsHz / (1 << m_settings.m_log2Decim);
}
quint64 SDRPlayV3Input::getCenterFrequency() const