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

PlutoSDR input: restored FIR filter controls

This commit is contained in:
f4exb 2017-09-10 18:35:38 +02:00
parent cec24b8078
commit d5d769d8d7
3 changed files with 10 additions and 7 deletions

View File

@ -469,7 +469,7 @@ void DevicePlutoSDRBox::setSampleRate(uint32_t sampleRate)
m_devSampleRate = sampleRate; m_devSampleRate = sampleRate;
} }
void DevicePlutoSDRBox::setFIR(uint32_t log2IntDec, uint32_t bw, int gain) void DevicePlutoSDRBox::setFIR(uint32_t sampleRate, uint32_t log2IntDec, uint32_t bw, int gain)
{ {
SampleRates sampleRates; SampleRates sampleRates;
std::ostringstream ostr; std::ostringstream ostr;
@ -488,6 +488,7 @@ void DevicePlutoSDRBox::setFIR(uint32_t log2IntDec, uint32_t bw, int gain)
ostr.str(""); // reset string stream ostr.str(""); // reset string stream
setFIREnable(true); // re-enable setFIREnable(true); // re-enable
setSampleRate(sampleRate); // set to new sample rate
if (!getRxSampleRates(sampleRates)) { if (!getRxSampleRates(sampleRates)) {
return; return;
@ -518,6 +519,8 @@ void DevicePlutoSDRBox::setFIR(uint32_t log2IntDec, uint32_t bw, int gain)
m_lpfFIRlog2Decim = log2IntDec; m_lpfFIRlog2Decim = log2IntDec;
m_lpfFIRBW = bw; m_lpfFIRBW = bw;
m_lpfFIRGain = gain; m_lpfFIRGain = gain;
// enable and set sample rate will be done by the caller
} }
void DevicePlutoSDRBox::setFIREnable(bool enable) void DevicePlutoSDRBox::setFIREnable(bool enable)

View File

@ -88,7 +88,7 @@ public:
bool getRxSampleRates(SampleRates& sampleRates); bool getRxSampleRates(SampleRates& sampleRates);
bool getTxSampleRates(SampleRates& sampleRates); bool getTxSampleRates(SampleRates& sampleRates);
void setSampleRate(uint32_t sampleRate); void setSampleRate(uint32_t sampleRate);
void setFIR(uint32_t intdec, uint32_t bw, int gain); void setFIR(uint32_t sampleRate, uint32_t intdec, uint32_t bw, int gain);
void setFIREnable(bool enable); void setFIREnable(bool enable);
void setLOPPMTenths(int ppmTenths); void setLOPPMTenths(int ppmTenths);
bool getRSSI(std::string& rssiStr, unsigned int chan); bool getRSSI(std::string& rssiStr, unsigned int chan);

View File

@ -307,7 +307,7 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
} }
} }
// TODO: apply settings (all cases) // apply settings
if ((m_settings.m_dcBlock != settings.m_dcBlock) || if ((m_settings.m_dcBlock != settings.m_dcBlock) ||
(m_settings.m_iqCorrection != settings.m_iqCorrection) || force) (m_settings.m_iqCorrection != settings.m_iqCorrection) || force)
@ -322,9 +322,9 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
(settings.m_lpfFIRBW != m_settings.m_lpfFIRBW) || (settings.m_lpfFIRBW != m_settings.m_lpfFIRBW) ||
(settings.m_lpfFIRGain != m_settings.m_lpfFIRGain) || force) (settings.m_lpfFIRGain != m_settings.m_lpfFIRGain) || force)
{ {
plutoBox->setSampleRate(settings.m_devSampleRate); // set end point frequency first plutoBox->setFIR(settings.m_devSampleRate, settings.m_lpfFIRlog2Decim, settings.m_lpfFIRBW, settings.m_lpfFIRGain); // don't bother with the FIR at this point
//plutoBox->setFIR(settings.m_lpfFIRlog2Decim, settings.m_lpfFIRBW, settings.m_lpfFIRGain); // don't bother with the FIR at this point plutoBox->setFIREnable(settings.m_lpfFIREnable); // eventually enable/disable FIR
//plutoBox->setFIREnable(settings.m_lpfFIREnable); // eventually enable/disable FIR plutoBox->setSampleRate(settings.m_devSampleRate); // and set end point sample rate
plutoBox->getRxSampleRates(m_deviceSampleRates); // pick up possible new rates plutoBox->getRxSampleRates(m_deviceSampleRates); // pick up possible new rates
qDebug() << "PlutoSDRInput::applySettings: BBPLL(Hz): " << m_deviceSampleRates.m_bbRateHz qDebug() << "PlutoSDRInput::applySettings: BBPLL(Hz): " << m_deviceSampleRates.m_bbRateHz