mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 06:49:24 -05:00
Remove old decimating FIR code.
This commit is contained in:
parent
015e5516d5
commit
0f73d6061a
@ -196,87 +196,7 @@ buffer_s16_t FIR64AndDecimateBy2Real::execute(
|
||||
|
||||
return { dst.p, src.count / 2, src.sampling_rate / 2 };
|
||||
}
|
||||
#if 0
|
||||
size_t fir_and_decimate_by_2_complex(
|
||||
const complex16_t* const src_start,
|
||||
const size_t src_count,
|
||||
complex16_t* const dst_start,
|
||||
complex16_t* const z,
|
||||
const complex16_t* const taps,
|
||||
const size_t taps_count
|
||||
) {
|
||||
/* int16_t input (sample count "n" must be multiple of 4)
|
||||
* -> int16_t output, decimated by 2.
|
||||
* taps are normalized to 1 << 16 == 1.0.
|
||||
*/
|
||||
auto src_p = src_start;
|
||||
const auto src_end = &src_start[src_count];
|
||||
auto dst_p = dst_start;
|
||||
|
||||
auto z_p = &z[0];
|
||||
|
||||
while(src_p < src_end) {
|
||||
/* Put two new samples into delay buffer */
|
||||
*__SIMD32(z_p)++ = *__SIMD32(src_p)++;
|
||||
*__SIMD32(z_p)++ = *__SIMD32(src_p)++;
|
||||
|
||||
int64_t t_real = 0;
|
||||
int64_t t_imag = 0;
|
||||
|
||||
auto t_p = &taps[0];
|
||||
|
||||
const auto z_end = &z[taps_count];
|
||||
while(z_p < z_end) {
|
||||
const auto tap0 = *__SIMD32(t_p)++;
|
||||
const auto sample0 = *__SIMD32(z_p)++;
|
||||
t_real = __SMLSLD(sample0, tap0, t_real);
|
||||
t_imag = __SMLALDX(sample0, tap0, t_imag);
|
||||
|
||||
const auto tap1 = *__SIMD32(t_p)++;
|
||||
const auto sample1 = *__SIMD32(z_p)++;
|
||||
t_real = __SMLSLD(sample1, tap1, t_real);
|
||||
t_imag = __SMLALDX(sample1, tap1, t_imag);
|
||||
}
|
||||
|
||||
z_p = &z[0];
|
||||
|
||||
const auto t_end = &taps[taps_count];
|
||||
while(t_p < t_end) {
|
||||
const auto tap0 = *__SIMD32(t_p)++;
|
||||
const auto sample0 = *__SIMD32(z_p)++;
|
||||
t_real = __SMLSLD(sample0, tap0, t_real);
|
||||
t_imag = __SMLALDX(sample0, tap0, t_imag);
|
||||
|
||||
const auto tap1 = *__SIMD32(t_p)++;
|
||||
const auto sample1 = *__SIMD32(z_p)++;
|
||||
t_real = __SMLSLD(sample1, tap1, t_real);
|
||||
t_imag = __SMLALDX(sample1, tap1, t_imag);
|
||||
}
|
||||
|
||||
if( z_p == z_end ) {
|
||||
z_p = &z[0];
|
||||
}
|
||||
|
||||
/* TODO: No rounding taking place here, so might be adding a bit of
|
||||
* noise. Enough to be significant?
|
||||
*/
|
||||
*__SIMD32(dst_p)++ = __PKHBT(
|
||||
t_real / 131072,
|
||||
t_imag / 131072,
|
||||
16
|
||||
);
|
||||
/*
|
||||
*__SIMD32(dst_p)++ = __PKHBT(
|
||||
__SSAT((t_real / 131072), 16),
|
||||
__SSAT((t_imag / 131072), 16),
|
||||
16
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
return src_count / 2;
|
||||
}
|
||||
#endif
|
||||
size_t fir_and_decimate_by_2_complex_fast(
|
||||
const complex16_t* const src_start,
|
||||
const size_t src_count,
|
||||
|
@ -74,15 +74,6 @@ private:
|
||||
const std::array<int16_t, taps_count>& taps;
|
||||
};
|
||||
|
||||
size_t fir_and_decimate_by_2_complex(
|
||||
const complex16_t* const src_start,
|
||||
const size_t src_count,
|
||||
complex16_t* const dst_start,
|
||||
complex16_t* const z,
|
||||
const complex16_t* const taps,
|
||||
const size_t taps_count
|
||||
);
|
||||
|
||||
size_t fir_and_decimate_by_2_complex_fast(
|
||||
const complex16_t* const src_start,
|
||||
const size_t src_count,
|
||||
|
Loading…
Reference in New Issue
Block a user