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

PlutoSDR: FIR filter calculation: allow normalized BW down to 0.05 and use Hamming window below 0.2

This commit is contained in:
f4exb 2017-09-12 18:49:12 +02:00
parent c59b04a68f
commit f30b049546
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ const uint32_t DevicePlutoSDR::bbLPRxHighLimitFreq = 14000000U; // 14 MHz
const uint32_t DevicePlutoSDR::bbLPTxLowLimitFreq = 625000U; // 625 kHz const uint32_t DevicePlutoSDR::bbLPTxLowLimitFreq = 625000U; // 625 kHz
const uint32_t DevicePlutoSDR::bbLPTxHighLimitFreq = 16000000U; // 16 MHz 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; const float DevicePlutoSDR::firBWHighLimitFactor = 0.9f;
DevicePlutoSDR::DevicePlutoSDR() DevicePlutoSDR::DevicePlutoSDR()

View File

@ -572,7 +572,7 @@ void DevicePlutoSDRBox::formatFIRHeader(std::ostringstream& ostr,uint32_t intdec
void DevicePlutoSDRBox::formatFIRCoefficients(std::ostringstream& ostr, uint32_t nbTaps, double normalizedBW) void DevicePlutoSDRBox::formatFIRCoefficients(std::ostringstream& ostr, uint32_t nbTaps, double normalizedBW)
{ {
double *fcoeffs = new double[nbTaps]; 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++) { for (unsigned int i = 0; i < nbTaps; i++) {
ostr << (int16_t) (fcoeffs[i] * 32768.0) << ", " << (int16_t) (fcoeffs[i] * 32768.0) << std::endl; ostr << (int16_t) (fcoeffs[i] * 32768.0) << ", " << (int16_t) (fcoeffs[i] * 32768.0) << std::endl;