mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-04 16:01:14 -05:00
Tx support: optimize final interpolator stages
This commit is contained in:
parent
9b72a3c064
commit
3479559859
@ -18,6 +18,18 @@
|
|||||||
|
|
||||||
#include "dsp/hbfiltertraits.h"
|
#include "dsp/hbfiltertraits.h"
|
||||||
|
|
||||||
|
const int16_t HBFIRFilterTraits<16>::hbMod[16+6] = {
|
||||||
|
15,16,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,0,1,2
|
||||||
|
};
|
||||||
|
|
||||||
|
const int32_t HBFIRFilterTraits<16>::hbCoeffs[4] = {
|
||||||
|
//* Firwin as in https://www.dsprelated.com/showcode/270.php */
|
||||||
|
(int32_t)(-0.0052391810630145274965685509016566356877 * (1 << hbShift)),
|
||||||
|
(int32_t)(0.0232111017863650750947535073009930783883 * (1 << hbShift)),
|
||||||
|
(int32_t)(-0.0761058457486735451258397233686991967261 * (1 << hbShift)),
|
||||||
|
(int32_t)(0.3076987787367443383246268240327481180429 * (1 << hbShift)),
|
||||||
|
};
|
||||||
|
|
||||||
const int16_t HBFIRFilterTraits<32>::hbMod[32+6] = {
|
const int16_t HBFIRFilterTraits<32>::hbMod[32+6] = {
|
||||||
31,32,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, 20,21,22,
|
31,32,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, 20,21,22,
|
||||||
23,24,25,26,27,28,29,30,31,32,0,1,2
|
23,24,25,26,27,28,29,30,31,32,0,1,2
|
||||||
|
@ -31,6 +31,15 @@ struct HBFIRFilterTraits
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct HBFIRFilterTraits<16>
|
||||||
|
{
|
||||||
|
static const int32_t hbOrder = 16;
|
||||||
|
static const int32_t hbShift = 14;
|
||||||
|
static const int16_t hbMod[16+6];
|
||||||
|
static const int32_t hbCoeffs[4] __attribute__ ((aligned (16)));
|
||||||
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct HBFIRFilterTraits<32>
|
struct HBFIRFilterTraits<32>
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,9 @@
|
|||||||
#include "dsp/inthalfbandfilterdb.h"
|
#include "dsp/inthalfbandfilterdb.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define INTERPOLATORS_HB_FILTER_ORDER 64
|
#define INTERPOLATORS_HB_FILTER_ORDER_FIRST 64
|
||||||
|
#define INTERPOLATORS_HB_FILTER_ORDER_SECOND 32
|
||||||
|
#define INTERPOLATORS_HB_FILTER_ORDER_NEXT 16
|
||||||
|
|
||||||
template<uint SdrBits, uint OutputBits>
|
template<uint SdrBits, uint OutputBits>
|
||||||
struct interpolation_shifts
|
struct interpolation_shifts
|
||||||
@ -113,19 +115,19 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef USE_SSE4_1
|
#ifdef USE_SSE4_1
|
||||||
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator2; // 1st stages
|
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER_FIRST> m_interpolator2; // 1st stages
|
||||||
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator4; // 2nd stages
|
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER_SECOND> m_interpolator4; // 2nd stages
|
||||||
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator8; // 3rd stages
|
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER_NEXT> m_interpolator8; // 3rd stages
|
||||||
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator16; // 4th stages
|
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER_NEXT> m_interpolator16; // 4th stages
|
||||||
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator32; // 5th stages
|
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER_NEXT> m_interpolator32; // 5th stages
|
||||||
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator64; // 6th stages
|
IntHalfbandFilterEO1<INTERPOLATORS_HB_FILTER_ORDER_NEXT> m_interpolator64; // 6th stages
|
||||||
#else
|
#else
|
||||||
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator2; // 1st stages
|
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER_FIRST> m_interpolator2; // 1st stages
|
||||||
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator4; // 2nd stages
|
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER_SECOND> m_interpolator4; // 2nd stages
|
||||||
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator8; // 3rd stages
|
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER_NEXT> m_interpolator8; // 3rd stages
|
||||||
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator16; // 4th stages
|
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER_NEXT> m_interpolator16; // 4th stages
|
||||||
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator32; // 5th stages
|
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER_NEXT> m_interpolator32; // 5th stages
|
||||||
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER> m_interpolator64; // 6th stages
|
IntHalfbandFilterDB<INTERPOLATORS_HB_FILTER_ORDER_NEXT> m_interpolator64; // 6th stages
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user