|
|
|
|
@ -101,7 +101,7 @@ private:
@@ -101,7 +101,7 @@ private:
|
|
|
|
|
template<typename T, uint SdrBits, uint InputBits> |
|
|
|
|
void Decimators<T, SdrBits, InputBits>::decimate1(SampleVector::iterator* it, const T* buf, qint32 len) |
|
|
|
|
{ |
|
|
|
|
qint16 xreal, yimag; |
|
|
|
|
qint32 xreal, yimag; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len; pos += 2) |
|
|
|
|
{ |
|
|
|
|
@ -116,7 +116,7 @@ void Decimators<T, SdrBits, InputBits>::decimate1(SampleVector::iterator* it, co
@@ -116,7 +116,7 @@ void Decimators<T, SdrBits, InputBits>::decimate1(SampleVector::iterator* it, co
|
|
|
|
|
template<typename T, uint SdrBits, uint InputBits> |
|
|
|
|
void Decimators<T, SdrBits, InputBits>::decimate2_u(SampleVector::iterator* it, const T* buf, qint32 len) |
|
|
|
|
{ |
|
|
|
|
qint16 xreal, yimag; |
|
|
|
|
qint32 xreal, yimag; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len - 7; pos += 8) |
|
|
|
|
{ |
|
|
|
|
@ -137,7 +137,7 @@ void Decimators<T, SdrBits, InputBits>::decimate2_u(SampleVector::iterator* it,
@@ -137,7 +137,7 @@ void Decimators<T, SdrBits, InputBits>::decimate2_u(SampleVector::iterator* it,
|
|
|
|
|
template<typename T, uint SdrBits, uint InputBits> |
|
|
|
|
void Decimators<T, SdrBits, InputBits>::decimate2_inf(SampleVector::iterator* it, const T* buf, qint32 len) |
|
|
|
|
{ |
|
|
|
|
qint16 xreal, yimag; |
|
|
|
|
qint32 xreal, yimag; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len - 7; pos += 8) |
|
|
|
|
{ |
|
|
|
|
@ -158,7 +158,7 @@ void Decimators<T, SdrBits, InputBits>::decimate2_inf(SampleVector::iterator* it
@@ -158,7 +158,7 @@ void Decimators<T, SdrBits, InputBits>::decimate2_inf(SampleVector::iterator* it
|
|
|
|
|
template<typename T, uint SdrBits, uint InputBits> |
|
|
|
|
void Decimators<T, SdrBits, InputBits>::decimate2_sup(SampleVector::iterator* it, const T* buf, qint32 len) |
|
|
|
|
{ |
|
|
|
|
qint16 xreal, yimag; |
|
|
|
|
qint32 xreal, yimag; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len - 7; pos += 8) |
|
|
|
|
{ |
|
|
|
|
@ -183,8 +183,8 @@ void Decimators<T, SdrBits, InputBits>::decimate2_cen(SampleVector::iterator* it
@@ -183,8 +183,8 @@ void Decimators<T, SdrBits, InputBits>::decimate2_cen(SampleVector::iterator* it
|
|
|
|
|
|
|
|
|
|
while (pos < len - 3) |
|
|
|
|
{ |
|
|
|
|
qint16 x0 = buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre2; |
|
|
|
|
qint16 y0 = buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre2; |
|
|
|
|
qint32 x0 = buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre2; |
|
|
|
|
qint32 y0 = buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre2; |
|
|
|
|
pos += 2; |
|
|
|
|
|
|
|
|
|
if (m_decimator2.workDecimateCenter(&x0, &y0)) |
|
|
|
|
@ -203,14 +203,14 @@ void Decimators<T, SdrBits, InputBits>::decimate4_cen(SampleVector::iterator* it
@@ -203,14 +203,14 @@ void Decimators<T, SdrBits, InputBits>::decimate4_cen(SampleVector::iterator* it
|
|
|
|
|
|
|
|
|
|
while (pos < len) |
|
|
|
|
{ |
|
|
|
|
qint16 x0 = buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre4; |
|
|
|
|
qint16 y0 = buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre4; |
|
|
|
|
qint32 x0 = buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre4; |
|
|
|
|
qint32 y0 = buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre4; |
|
|
|
|
pos += 2; |
|
|
|
|
|
|
|
|
|
if (m_decimator2.workDecimateCenter(&x0, &y0)) |
|
|
|
|
{ |
|
|
|
|
qint16 x1 = x0; |
|
|
|
|
qint16 y1 = y0; |
|
|
|
|
qint32 x1 = x0; |
|
|
|
|
qint32 y1 = y0; |
|
|
|
|
|
|
|
|
|
if (m_decimator4.workDecimateCenter(&x1, &y1)) |
|
|
|
|
{ |
|
|
|
|
@ -229,19 +229,19 @@ void Decimators<T, SdrBits, InputBits>::decimate8_cen(SampleVector::iterator* it
@@ -229,19 +229,19 @@ void Decimators<T, SdrBits, InputBits>::decimate8_cen(SampleVector::iterator* it
|
|
|
|
|
|
|
|
|
|
while (pos < len) |
|
|
|
|
{ |
|
|
|
|
qint16 x0 = buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre8; |
|
|
|
|
qint16 y0 = buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre8; |
|
|
|
|
qint32 x0 = buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre8; |
|
|
|
|
qint32 y0 = buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre8; |
|
|
|
|
pos += 2; |
|
|
|
|
|
|
|
|
|
if (m_decimator2.workDecimateCenter(&x0, &y0)) |
|
|
|
|
{ |
|
|
|
|
qint16 x1 = x0; |
|
|
|
|
qint16 y1 = y0; |
|
|
|
|
qint32 x1 = x0; |
|
|
|
|
qint32 y1 = y0; |
|
|
|
|
|
|
|
|
|
if (m_decimator4.workDecimateCenter(&x1, &y1)) |
|
|
|
|
{ |
|
|
|
|
qint16 x2 = x1; |
|
|
|
|
qint16 y2 = y1; |
|
|
|
|
qint32 x2 = x1; |
|
|
|
|
qint32 y2 = y1; |
|
|
|
|
|
|
|
|
|
if (m_decimator8.workDecimateCenter(&x2, &y2)) |
|
|
|
|
{ |
|
|
|
|
@ -261,24 +261,24 @@ void Decimators<T, SdrBits, InputBits>::decimate16_cen(SampleVector::iterator* i
@@ -261,24 +261,24 @@ void Decimators<T, SdrBits, InputBits>::decimate16_cen(SampleVector::iterator* i
|
|
|
|
|
|
|
|
|
|
while (pos < len) |
|
|
|
|
{ |
|
|
|
|
qint16 x0 = buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre16; |
|
|
|
|
qint16 y0 = buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre16; |
|
|
|
|
qint32 x0 = buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre16; |
|
|
|
|
qint32 y0 = buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre16; |
|
|
|
|
pos += 2; |
|
|
|
|
|
|
|
|
|
if (m_decimator2.workDecimateCenter(&x0, &y0)) |
|
|
|
|
{ |
|
|
|
|
qint16 x1 = x0; |
|
|
|
|
qint16 y1 = y0; |
|
|
|
|
qint32 x1 = x0; |
|
|
|
|
qint32 y1 = y0; |
|
|
|
|
|
|
|
|
|
if (m_decimator4.workDecimateCenter(&x1, &y1)) |
|
|
|
|
{ |
|
|
|
|
qint16 x2 = x1; |
|
|
|
|
qint16 y2 = y1; |
|
|
|
|
qint32 x2 = x1; |
|
|
|
|
qint32 y2 = y1; |
|
|
|
|
|
|
|
|
|
if (m_decimator8.workDecimateCenter(&x2, &y2)) |
|
|
|
|
{ |
|
|
|
|
qint16 x3 = x2; |
|
|
|
|
qint16 y3 = y2; |
|
|
|
|
qint32 x3 = x2; |
|
|
|
|
qint32 y3 = y2; |
|
|
|
|
|
|
|
|
|
if (m_decimator16.workDecimateCenter(&x3, &y3)) |
|
|
|
|
{ |
|
|
|
|
@ -299,29 +299,29 @@ void Decimators<T, SdrBits, InputBits>::decimate32_cen(SampleVector::iterator* i
@@ -299,29 +299,29 @@ void Decimators<T, SdrBits, InputBits>::decimate32_cen(SampleVector::iterator* i
|
|
|
|
|
|
|
|
|
|
while (pos < len) |
|
|
|
|
{ |
|
|
|
|
qint16 x0 = buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre32; |
|
|
|
|
qint16 y0 = buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre32; |
|
|
|
|
qint32 x0 = buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre32; |
|
|
|
|
qint32 y0 = buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre32; |
|
|
|
|
pos += 2; |
|
|
|
|
|
|
|
|
|
if (m_decimator2.workDecimateCenter(&x0, &y0)) |
|
|
|
|
{ |
|
|
|
|
qint16 x1 = x0; |
|
|
|
|
qint16 y1 = y0; |
|
|
|
|
qint32 x1 = x0; |
|
|
|
|
qint32 y1 = y0; |
|
|
|
|
|
|
|
|
|
if (m_decimator4.workDecimateCenter(&x1, &y1)) |
|
|
|
|
{ |
|
|
|
|
qint16 x2 = x1; |
|
|
|
|
qint16 y2 = y1; |
|
|
|
|
qint32 x2 = x1; |
|
|
|
|
qint32 y2 = y1; |
|
|
|
|
|
|
|
|
|
if (m_decimator8.workDecimateCenter(&x2, &y2)) |
|
|
|
|
{ |
|
|
|
|
qint16 x3 = x2; |
|
|
|
|
qint16 y3 = y2; |
|
|
|
|
qint32 x3 = x2; |
|
|
|
|
qint32 y3 = y2; |
|
|
|
|
|
|
|
|
|
if (m_decimator16.workDecimateCenter(&x3, &y3)) |
|
|
|
|
{ |
|
|
|
|
qint16 x4 = x3; |
|
|
|
|
qint16 y4 = y3; |
|
|
|
|
qint32 x4 = x3; |
|
|
|
|
qint32 y4 = y3; |
|
|
|
|
|
|
|
|
|
if (m_decimator32.workDecimateCenter(&x4, &y4)) |
|
|
|
|
{ |
|
|
|
|
@ -339,7 +339,7 @@ void Decimators<T, SdrBits, InputBits>::decimate32_cen(SampleVector::iterator* i
@@ -339,7 +339,7 @@ void Decimators<T, SdrBits, InputBits>::decimate32_cen(SampleVector::iterator* i
|
|
|
|
|
template<typename T, uint SdrBits, uint InputBits> |
|
|
|
|
void Decimators<T, SdrBits, InputBits>::decimate4_inf(SampleVector::iterator* it, const T* buf, qint32 len) |
|
|
|
|
{ |
|
|
|
|
qint16 xreal, yimag; |
|
|
|
|
qint32 xreal, yimag; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len - 7; pos += 8) |
|
|
|
|
{ |
|
|
|
|
@ -362,7 +362,7 @@ void Decimators<T, SdrBits, InputBits>::decimate4_sup(SampleVector::iterator* it
@@ -362,7 +362,7 @@ void Decimators<T, SdrBits, InputBits>::decimate4_sup(SampleVector::iterator* it
|
|
|
|
|
// Inf (LSB):
|
|
|
|
|
// x y x y x y x y / x -> 0,-3,-4,7 / y -> 1,2,-5,-6
|
|
|
|
|
// [ rotate: 0, 1, -3, 2, -4, -5, 7, -6]
|
|
|
|
|
qint16 xreal, yimag; |
|
|
|
|
qint32 xreal, yimag; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len - 7; pos += 8) |
|
|
|
|
{ |
|
|
|
|
@ -379,7 +379,7 @@ void Decimators<T, SdrBits, InputBits>::decimate4_sup(SampleVector::iterator* it
@@ -379,7 +379,7 @@ void Decimators<T, SdrBits, InputBits>::decimate4_sup(SampleVector::iterator* it
|
|
|
|
|
template<typename T, uint SdrBits, uint InputBits> |
|
|
|
|
void Decimators<T, SdrBits, InputBits>::decimate8_inf(SampleVector::iterator* it, const T* buf, qint32 len) |
|
|
|
|
{ |
|
|
|
|
qint16 xreal[2], yimag[2]; |
|
|
|
|
qint32 xreal[2], yimag[2]; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len - 15; pos += 8) |
|
|
|
|
{ |
|
|
|
|
@ -402,7 +402,7 @@ void Decimators<T, SdrBits, InputBits>::decimate8_inf(SampleVector::iterator* it
@@ -402,7 +402,7 @@ void Decimators<T, SdrBits, InputBits>::decimate8_inf(SampleVector::iterator* it
|
|
|
|
|
template<typename T, uint SdrBits, uint InputBits> |
|
|
|
|
void Decimators<T, SdrBits, InputBits>::decimate8_sup(SampleVector::iterator* it, const T* buf, qint32 len) |
|
|
|
|
{ |
|
|
|
|
qint16 xreal[2], yimag[2]; |
|
|
|
|
qint32 xreal[2], yimag[2]; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len - 15; pos += 8) |
|
|
|
|
{ |
|
|
|
|
@ -427,7 +427,7 @@ void Decimators<T, SdrBits, InputBits>::decimate16_inf(SampleVector::iterator* i
@@ -427,7 +427,7 @@ void Decimators<T, SdrBits, InputBits>::decimate16_inf(SampleVector::iterator* i
|
|
|
|
|
{ |
|
|
|
|
// Offset tuning: 4x downsample and rotate, then
|
|
|
|
|
// downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6]
|
|
|
|
|
qint16 xreal[4], yimag[4]; |
|
|
|
|
qint32 xreal[4], yimag[4]; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len - 31; ) |
|
|
|
|
{ |
|
|
|
|
@ -455,7 +455,7 @@ void Decimators<T, SdrBits, InputBits>::decimate16_sup(SampleVector::iterator* i
@@ -455,7 +455,7 @@ void Decimators<T, SdrBits, InputBits>::decimate16_sup(SampleVector::iterator* i
|
|
|
|
|
{ |
|
|
|
|
// Offset tuning: 4x downsample and rotate, then
|
|
|
|
|
// downsample 4x more. [ rotate: 1, 0, -2, 3, -5, -4, 6, -7]
|
|
|
|
|
qint16 xreal[4], yimag[4]; |
|
|
|
|
qint32 xreal[4], yimag[4]; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len - 31; ) |
|
|
|
|
{ |
|
|
|
|
@ -481,7 +481,7 @@ void Decimators<T, SdrBits, InputBits>::decimate16_sup(SampleVector::iterator* i
@@ -481,7 +481,7 @@ void Decimators<T, SdrBits, InputBits>::decimate16_sup(SampleVector::iterator* i
|
|
|
|
|
template<typename T, uint SdrBits, uint InputBits> |
|
|
|
|
void Decimators<T, SdrBits, InputBits>::decimate32_inf(SampleVector::iterator* it, const T* buf, qint32 len) |
|
|
|
|
{ |
|
|
|
|
qint16 xreal[8], yimag[8]; |
|
|
|
|
qint32 xreal[8], yimag[8]; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len - 63; ) |
|
|
|
|
{ |
|
|
|
|
@ -512,7 +512,7 @@ void Decimators<T, SdrBits, InputBits>::decimate32_inf(SampleVector::iterator* i
@@ -512,7 +512,7 @@ void Decimators<T, SdrBits, InputBits>::decimate32_inf(SampleVector::iterator* i
|
|
|
|
|
template<typename T, uint SdrBits, uint InputBits> |
|
|
|
|
void Decimators<T, SdrBits, InputBits>::decimate32_sup(SampleVector::iterator* it, const T* buf, qint32 len) |
|
|
|
|
{ |
|
|
|
|
qint16 xreal[8], yimag[8]; |
|
|
|
|
qint32 xreal[8], yimag[8]; |
|
|
|
|
|
|
|
|
|
for (int pos = 0; pos < len - 63; ) |
|
|
|
|
{ |
|
|
|
|
|