22 #ifndef INCLUDE_INTHALFBANDFILTER_DBF_H 23 #define INCLUDE_INTHALFBANDFILTER_DBF_H 30 template<
typename AccuType,
typename SampleType, u
int32_t HBFilterOrder>
35 void myDecimate(AccuType x1, AccuType y1, AccuType *x2, AccuType *y2)
40 storeSample(*x2, *y2);
49 m_samplesDB[m_ptr][0] = *x1;
50 m_samplesDB[m_ptr][1] = *y1;
66 doInterpolateFIR(x2, y2);
69 void myInterpolateInf(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4)
71 myInterpolate(x1, y1, x2, y2);
72 myInterpolate(x3, y3, x4, y4);
85 void myInterpolateSup(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4)
87 myInterpolate(x1, y1, x2, y2);
88 myInterpolate(x3, y3, x4, y4);
109 m_samplesDB[m_ptr][0] = x;
110 m_samplesDB[m_ptr][1] = y;
111 m_samplesDB[m_ptr + m_size][0] = x;
112 m_samplesDB[m_ptr + m_size][1] = y;
117 m_ptr = m_ptr + 1 < m_size ? m_ptr + 1: 0;
120 void doFIR(AccuType *x, AccuType *y)
122 int a = m_ptr + m_size;
127 for (
int i = 0; i < HBFIRFilterTraits<HBFilterOrder>::hbOrder / 4;
i++)
135 iAcc += m_samplesDB[b-1][0] / 2.0;
136 qAcc += m_samplesDB[b-1][1] / 2.0;
151 for (
int i = 0; i < HBFIRFilterTraits<HBFilterOrder>::hbOrder / 4;
i++)
164 template<
typename AccuType,
typename SampleType, u
int32_t HBFilterOrder>
169 for (
int i = 0;
i < m_size;
i++)
171 m_samplesDB[
i][0] = 0;
172 m_samplesDB[
i][1] = 0;
179 #endif // INCLUDE_INTHALFBANDFILTER_DBF_H void myInterpolate(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2)
void storeSample(AccuType x, AccuType y)
void myInterpolateInf(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4)
void myInterpolateSup(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4)
void myDecimate(AccuType x1, AccuType y1, AccuType *x2, AccuType *y2)
void doFIR(AccuType *x, AccuType *y)
void doInterpolateFIR(qint32 *x, qint32 *y)