From f30b049546fba14859a7a04193ab397079ee3aa0 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 12 Sep 2017 18:49:12 +0200 Subject: [PATCH] PlutoSDR: FIR filter calculation: allow normalized BW down to 0.05 and use Hamming window below 0.2 --- devices/plutosdr/deviceplutosdr.cpp | 2 +- devices/plutosdr/deviceplutosdrbox.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/devices/plutosdr/deviceplutosdr.cpp b/devices/plutosdr/deviceplutosdr.cpp index 7ac37317f..bc2c6cb01 100644 --- a/devices/plutosdr/deviceplutosdr.cpp +++ b/devices/plutosdr/deviceplutosdr.cpp @@ -27,7 +27,7 @@ const uint32_t DevicePlutoSDR::bbLPRxHighLimitFreq = 14000000U; // 14 MHz const uint32_t DevicePlutoSDR::bbLPTxLowLimitFreq = 625000U; // 625 kHz const uint32_t DevicePlutoSDR::bbLPTxHighLimitFreq = 16000000U; // 16 MHz -const float DevicePlutoSDR::firBWLowLimitFactor = 0.1f; +const float DevicePlutoSDR::firBWLowLimitFactor = 0.05f; const float DevicePlutoSDR::firBWHighLimitFactor = 0.9f; DevicePlutoSDR::DevicePlutoSDR() diff --git a/devices/plutosdr/deviceplutosdrbox.cpp b/devices/plutosdr/deviceplutosdrbox.cpp index 7532bab57..4232132cc 100644 --- a/devices/plutosdr/deviceplutosdrbox.cpp +++ b/devices/plutosdr/deviceplutosdrbox.cpp @@ -572,7 +572,7 @@ void DevicePlutoSDRBox::formatFIRHeader(std::ostringstream& ostr,uint32_t intdec void DevicePlutoSDRBox::formatFIRCoefficients(std::ostringstream& ostr, uint32_t nbTaps, double normalizedBW) { double *fcoeffs = new double[nbTaps]; - WFIR::BasicFIR(fcoeffs, nbTaps, WFIR::LPF, normalizedBW, 0.0, WFIR::wtBLACKMAN_HARRIS, 0.0); + WFIR::BasicFIR(fcoeffs, nbTaps, WFIR::LPF, normalizedBW, 0.0, normalizedBW < 0.2 ? WFIR::wtHAMMING : WFIR::wtBLACKMAN_HARRIS, 0.0); for (unsigned int i = 0; i < nbTaps; i++) { ostr << (int16_t) (fcoeffs[i] * 32768.0) << ", " << (int16_t) (fcoeffs[i] * 32768.0) << std::endl;