Use unified even/odd half band decimator

This commit is contained in:
f4exb 2018-05-08 01:35:08 +02:00
parent 8102d0ed08
commit 0c946d86e2
3 changed files with 26 additions and 36 deletions

View File

@ -24,12 +24,7 @@
#define INCLUDE_GPL_DSP_DECIMATORSU_H_
#include "dsp/dsptypes.h"
#ifdef SDR_RX_SAMPLE_24BIT
#include "dsp/inthalfbandfiltereo2.h"
#else // SDR_RX_SAMPLE_24BIT
#include "dsp/inthalfbandfiltereo1.h"
#endif // SDR_RX_SAMPLE_24BIT
#include "dsp/inthalfbandfiltereo.h"
#define DECIMATORS_HB_FILTER_ORDER 64
@ -204,19 +199,19 @@ public:
private:
#ifdef SDR_RX_SAMPLE_24BIT
IntHalfbandFilterEO2<DECIMATORS_HB_FILTER_ORDER> m_decimator2; // 1st stages
IntHalfbandFilterEO2<DECIMATORS_HB_FILTER_ORDER> m_decimator4; // 2nd stages
IntHalfbandFilterEO2<DECIMATORS_HB_FILTER_ORDER> m_decimator8; // 3rd stages
IntHalfbandFilterEO2<DECIMATORS_HB_FILTER_ORDER> m_decimator16; // 4th stages
IntHalfbandFilterEO2<DECIMATORS_HB_FILTER_ORDER> m_decimator32; // 5th stages
IntHalfbandFilterEO2<DECIMATORS_HB_FILTER_ORDER> m_decimator64; // 6th stages
IntHalfbandFilterEO<qint64, qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator2; // 1st stages
IntHalfbandFilterEO<qint64, qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator4; // 2nd stages
IntHalfbandFilterEO<qint64, qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator8; // 3rd stages
IntHalfbandFilterEO<qint64, qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator16; // 4th stages
IntHalfbandFilterEO<qint64, qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator32; // 5th stages
IntHalfbandFilterEO<qint64, qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator64; // 6th stages
#else
IntHalfbandFilterEO1<DECIMATORS_HB_FILTER_ORDER> m_decimator2; // 1st stages
IntHalfbandFilterEO1<DECIMATORS_HB_FILTER_ORDER> m_decimator4; // 2nd stages
IntHalfbandFilterEO1<DECIMATORS_HB_FILTER_ORDER> m_decimator8; // 3rd stages
IntHalfbandFilterEO1<DECIMATORS_HB_FILTER_ORDER> m_decimator16; // 4th stages
IntHalfbandFilterEO1<DECIMATORS_HB_FILTER_ORDER> m_decimator32; // 5th stages
IntHalfbandFilterEO1<DECIMATORS_HB_FILTER_ORDER> m_decimator64; // 6th stages
IntHalfbandFilterEO<qint32, qint32, DECIMATORS_HB_FILTER_ORDER> m_decimator2; // 1st stages
IntHalfbandFilterEO<qint32, qint32, DECIMATORS_HB_FILTER_ORDER> m_decimator4; // 2nd stages
IntHalfbandFilterEO<qint32, qint32, DECIMATORS_HB_FILTER_ORDER> m_decimator8; // 3rd stages
IntHalfbandFilterEO<qint32, qint32, DECIMATORS_HB_FILTER_ORDER> m_decimator16; // 4th stages
IntHalfbandFilterEO<qint32, qint32, DECIMATORS_HB_FILTER_ORDER> m_decimator32; // 5th stages
IntHalfbandFilterEO<qint32, qint32, DECIMATORS_HB_FILTER_ORDER> m_decimator64; // 6th stages
#endif
};

View File

@ -190,43 +190,43 @@ void DownChannelizer::applyConfiguration()
#ifdef SDR_RX_SAMPLE_24BIT
DownChannelizer::FilterStage::FilterStage(Mode mode) :
m_filter(new IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>),
m_filter(new IntHalfbandFilterEO<qint64, qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>),
m_workFunction(0),
m_mode(mode),
m_sse(true)
{
switch(mode) {
case ModeCenter:
m_workFunction = &IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateCenter;
m_workFunction = &IntHalfbandFilterEO<qint64, qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateCenter;
break;
case ModeLowerHalf:
m_workFunction = &IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateLowerHalf;
m_workFunction = &IntHalfbandFilterEO<qint64, qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateLowerHalf;
break;
case ModeUpperHalf:
m_workFunction = &IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateUpperHalf;
m_workFunction = &IntHalfbandFilterEO<qint64, qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateUpperHalf;
break;
}
}
#else
DownChannelizer::FilterStage::FilterStage(Mode mode) :
m_filter(new IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>),
m_filter(new IntHalfbandFilterEO<qint32, qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>),
m_workFunction(0),
m_mode(mode),
m_sse(true)
{
switch(mode) {
case ModeCenter:
m_workFunction = &IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateCenter;
m_workFunction = &IntHalfbandFilterEO<qint32, qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateCenter;
break;
case ModeLowerHalf:
m_workFunction = &IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateLowerHalf;
m_workFunction = &IntHalfbandFilterEO<qint32, qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateLowerHalf;
break;
case ModeUpperHalf:
m_workFunction = &IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateUpperHalf;
m_workFunction = &IntHalfbandFilterEO<qint32, qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateUpperHalf;
break;
}
}

View File

@ -23,12 +23,7 @@
#include <QMutex>
#include "export.h"
#include "util/message.h"
#ifdef SDR_RX_SAMPLE_24BIT
#include "dsp/inthalfbandfiltereo2.h"
#else // SDR_RX_SAMPLE_24BIT
#include "dsp/inthalfbandfiltereo1.h"
#endif // SDR_RX_SAMPLE_24BIT
#include "dsp/inthalfbandfiltereo.h"
#define DOWNCHANNELIZER_HB_FILTER_ORDER 48
@ -81,11 +76,11 @@ protected:
};
#ifdef SDR_RX_SAMPLE_24BIT
typedef bool (IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
typedef bool (IntHalfbandFilterEO<qint64, qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
IntHalfbandFilterEO<qint64, qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
#else
typedef bool (IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
typedef bool (IntHalfbandFilterEO<qint32, qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
IntHalfbandFilterEO<qint32, qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
#endif
WorkFunction m_workFunction;