mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-09-04 22:27:53 -04:00
Fixed down channelizer by dividing by 2 at each filter stage
This commit is contained in:
parent
ffb6ad3009
commit
3cd754bd67
@ -77,6 +77,8 @@ void DownChannelizer::feed(const SampleVector::const_iterator& begin, const Samp
|
|||||||
|
|
||||||
if(stage == m_filterStages.end())
|
if(stage == m_filterStages.end())
|
||||||
{
|
{
|
||||||
|
s.m_real /= (1<<(m_filterStages.size()));
|
||||||
|
s.m_imag /= (1<<(m_filterStages.size()));
|
||||||
m_sampleBuffer.push_back(s);
|
m_sampleBuffer.push_back(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -172,6 +174,8 @@ void DownChannelizer::applyConfiguration()
|
|||||||
|
|
||||||
m_mutex.unlock();
|
m_mutex.unlock();
|
||||||
|
|
||||||
|
//debugFilterChain();
|
||||||
|
|
||||||
m_currentOutputSampleRate = m_inputSampleRate / (1 << m_filterStages.size());
|
m_currentOutputSampleRate = m_inputSampleRate / (1 << m_filterStages.size());
|
||||||
|
|
||||||
qDebug() << "DownChannelizer::applyConfiguration in=" << m_inputSampleRate
|
qDebug() << "DownChannelizer::applyConfiguration in=" << m_inputSampleRate
|
||||||
@ -189,7 +193,9 @@ void DownChannelizer::applyConfiguration()
|
|||||||
#ifdef USE_SSE4_1
|
#ifdef USE_SSE4_1
|
||||||
DownChannelizer::FilterStage::FilterStage(Mode mode) :
|
DownChannelizer::FilterStage::FilterStage(Mode mode) :
|
||||||
m_filter(new IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>),
|
m_filter(new IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>),
|
||||||
m_workFunction(0)
|
m_workFunction(0),
|
||||||
|
m_mode(mode),
|
||||||
|
m_sse(true)
|
||||||
{
|
{
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
case ModeCenter:
|
case ModeCenter:
|
||||||
@ -208,7 +214,9 @@ DownChannelizer::FilterStage::FilterStage(Mode mode) :
|
|||||||
#else
|
#else
|
||||||
DownChannelizer::FilterStage::FilterStage(Mode mode) :
|
DownChannelizer::FilterStage::FilterStage(Mode mode) :
|
||||||
m_filter(new IntHalfbandFilterDB<DOWNCHANNELIZER_HB_FILTER_ORDER>),
|
m_filter(new IntHalfbandFilterDB<DOWNCHANNELIZER_HB_FILTER_ORDER>),
|
||||||
m_workFunction(0)
|
m_workFunction(0),
|
||||||
|
m_mode(mode),
|
||||||
|
m_sse(false)
|
||||||
{
|
{
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
case ModeCenter:
|
case ModeCenter:
|
||||||
@ -286,3 +294,27 @@ void DownChannelizer::freeFilterChain()
|
|||||||
delete *it;
|
delete *it;
|
||||||
m_filterStages.clear();
|
m_filterStages.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DownChannelizer::debugFilterChain()
|
||||||
|
{
|
||||||
|
qDebug("DownChannelizer::debugFilterChain: %lu stages", m_filterStages.size());
|
||||||
|
|
||||||
|
for(FilterStages::iterator it = m_filterStages.begin(); it != m_filterStages.end(); ++it)
|
||||||
|
{
|
||||||
|
switch ((*it)->m_mode)
|
||||||
|
{
|
||||||
|
case FilterStage::ModeCenter:
|
||||||
|
qDebug("DownChannelizer::debugFilterChain: center %s", (*it)->m_sse ? "sse" : "no_sse");
|
||||||
|
break;
|
||||||
|
case FilterStage::ModeLowerHalf:
|
||||||
|
qDebug("DownChannelizer::debugFilterChain: lower %s", (*it)->m_sse ? "sse" : "no_sse");
|
||||||
|
break;
|
||||||
|
case FilterStage::ModeUpperHalf:
|
||||||
|
qDebug("DownChannelizer::debugFilterChain: upper %s", (*it)->m_sse ? "sse" : "no_sse");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
qDebug("DownChannelizer::debugFilterChain: none %s", (*it)->m_sse ? "sse" : "no_sse");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -81,6 +81,8 @@ protected:
|
|||||||
IntHalfbandFilterDB<DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
|
IntHalfbandFilterDB<DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
|
||||||
#endif
|
#endif
|
||||||
WorkFunction m_workFunction;
|
WorkFunction m_workFunction;
|
||||||
|
Mode m_mode;
|
||||||
|
bool m_sse;
|
||||||
|
|
||||||
FilterStage(Mode mode);
|
FilterStage(Mode mode);
|
||||||
~FilterStage();
|
~FilterStage();
|
||||||
@ -105,6 +107,7 @@ protected:
|
|||||||
bool signalContainsChannel(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd) const;
|
bool signalContainsChannel(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd) const;
|
||||||
Real createFilterChain(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd);
|
Real createFilterChain(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd);
|
||||||
void freeFilterChain();
|
void freeFilterChain();
|
||||||
|
void debugFilterChain();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void inputSampleRateChanged();
|
void inputSampleRateChanged();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user