From 9799874c17ab82a5f2f860a9bcca9c17b69aee91 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 18 Oct 2023 06:29:18 +0200 Subject: [PATCH] up/down channelizers: set guard interfal to 12.5% and optimize debug messages --- sdrbase/dsp/downchannelizer.cpp | 10 +++------- sdrbase/dsp/upchannelizer.cpp | 21 +++------------------ 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/sdrbase/dsp/downchannelizer.cpp b/sdrbase/dsp/downchannelizer.cpp index c9ea12c8ec..b38b6f70a8 100644 --- a/sdrbase/dsp/downchannelizer.cpp +++ b/sdrbase/dsp/downchannelizer.cpp @@ -233,7 +233,6 @@ Real DownChannelizer::createFilterChain(Real sigStart, Real sigEnd, Real chanSta Real chanBw = chanEnd - chanStart; Real rot = sigBw / 4; - qDebug("DownChannelizer::createFilterChain: Signal [%.1f, %.1f] (BW %.1f), Channel [%.1f, %.1f], Rot %.1f", sigStart, sigEnd, sigBw, chanStart, chanEnd, rot); std::array filterMinSpaces; // Array of left, center and right filter min spaces respectively filterMinSpaces[0] = channelMinSpace(sigStart, sigStart + sigBw / 2.0, chanStart, chanEnd); @@ -243,28 +242,25 @@ Real DownChannelizer::createFilterChain(Real sigStart, Real sigEnd, Real chanSta int maxIndex = maxIt - filterMinSpaces.begin(); Real maxValue = *maxIt; - qDebug("DownChannelizer::createFilterChain: best index: %d best value: %.1f sigBW: %.1f chanBW: %.1f", - maxIndex, maxValue, sigBw, chanBw); + qDebug("DownChannelizer::createFilterChain: Signal [%.1f, %.1f] (BW %.1f) Channel [%.1f, %.1f] (BW %.1f) Selected: %d (fit %.1f)", + sigStart, sigEnd, sigBw, chanStart, chanEnd, chanBw, maxIndex, maxValue); - if ((sigStart < sigEnd) && (chanStart < chanEnd) && (maxValue >= chanBw/10.0)) + if ((sigStart < sigEnd) && (chanStart < chanEnd) && (maxValue >= chanBw/8.0)) { if (maxIndex == 0) { - qDebug("DownChannelizer::createFilterChain: -> take left half (rotate by +1/4 and decimate by 2)"); m_filterStages.push_back(new FilterStage(FilterStage::ModeLowerHalf)); return createFilterChain(sigStart, sigStart + sigBw / 2.0, chanStart, chanEnd); } if (maxIndex == 1) { - qDebug("DownChannelizer::createFilterChain: -> take center half (decimate by 2)"); m_filterStages.push_back(new FilterStage(FilterStage::ModeCenter)); return createFilterChain(sigStart + rot, sigEnd - rot, chanStart, chanEnd); } if (maxIndex == 2) { - qDebug("DownChannelizer::createFilterChain: -> take right half (rotate by -1/4 and decimate by 2)"); m_filterStages.push_back(new FilterStage(FilterStage::ModeUpperHalf)); return createFilterChain(sigEnd - sigBw / 2.0f, sigEnd, chanStart, chanEnd); } diff --git a/sdrbase/dsp/upchannelizer.cpp b/sdrbase/dsp/upchannelizer.cpp index 5060a3fcb3..d597c85ed8 100644 --- a/sdrbase/dsp/upchannelizer.cpp +++ b/sdrbase/dsp/upchannelizer.cpp @@ -252,12 +252,6 @@ Real UpChannelizer::createFilterChain(Real sigStart, Real sigEnd, Real chanStart Real rot = sigBw / 4; Sample s; - qDebug() << "UpChannelizer::createFilterChain: start:" - << " sig: [" << sigStart << ":" << sigEnd << "]" - << " BW: " << sigBw - << " chan: [" << chanStart << ":" << chanEnd << "]" - << " rot: " << rot; - std::array filterMinSpaces; // Array of left, center and right filter min spaces respectively filterMinSpaces[0] = channelMinSpace(sigStart, sigStart + sigBw / 2.0, chanStart, chanEnd); filterMinSpaces[1] = channelMinSpace(sigStart + rot, sigEnd - rot, chanStart, chanEnd); @@ -266,16 +260,13 @@ Real UpChannelizer::createFilterChain(Real sigStart, Real sigEnd, Real chanStart int maxIndex = maxIt - filterMinSpaces.begin(); Real maxValue = *maxIt; - qDebug("UpChannelizer::createFilterChain: best index: %d best value: %.1f sigBW: %.1f chanBW: %.1f", - maxIndex, maxValue, sigBw, chanBw); + qDebug("UpChannelizer::createFilterChain: Signal [%.1f, %.1f] (BW %.1f) Channel [%.1f, %.1f] (BW %.1f) Selected: %d (fit %.1f)", + sigStart, sigEnd, sigBw, chanStart, chanEnd, chanBw, maxIndex, maxValue); - if ((sigStart < sigEnd) && (chanStart < chanEnd) && (maxValue >= chanBw/10.0)) + if ((sigStart < sigEnd) && (chanStart < chanEnd) && (maxValue >= chanBw/8.0)) { if (maxIndex == 0) { - qDebug() << "UpChannelizer::createFilterChain: take left half (rotate by +1/4 and decimate by 2):" - << " [" << m_filterStages.size() << "]" - << " sig: [" << sigStart << ":" << sigStart + sigBw / 2.0 << "]"; m_filterStages.push_back(new FilterStage(FilterStage::ModeLowerHalf)); m_stageSamples.push_back(s); return createFilterChain(sigStart, sigStart + sigBw / 2.0, chanStart, chanEnd); @@ -283,9 +274,6 @@ Real UpChannelizer::createFilterChain(Real sigStart, Real sigEnd, Real chanStart if (maxIndex == 1) { - qDebug() << "UpChannelizer::createFilterChain: take center half (decimate by 2):" - << " [" << m_filterStages.size() << "]" - << " sig: [" << sigStart + rot << ":" << sigEnd - rot << "]"; m_filterStages.push_back(new FilterStage(FilterStage::ModeCenter)); m_stageSamples.push_back(s); return createFilterChain(sigStart + rot, sigEnd - rot, chanStart, chanEnd); @@ -293,9 +281,6 @@ Real UpChannelizer::createFilterChain(Real sigStart, Real sigEnd, Real chanStart if (maxIndex == 2) { - qDebug() << "UpChannelizer::createFilterChain: take right half (rotate by -1/4 and decimate by 2):" - << " [" << m_filterStages.size() << "]" - << " sig: [" << sigEnd - sigBw / 2.0f << ":" << sigEnd << "]"; m_filterStages.push_back(new FilterStage(FilterStage::ModeUpperHalf)); m_stageSamples.push_back(s); return createFilterChain(sigEnd - sigBw / 2.0f, sigEnd, chanStart, chanEnd);