diff --git a/firmware/baseband/dsp_decimate.cpp b/firmware/baseband/dsp_decimate.cpp index 642437490..93dbc6025 100644 --- a/firmware/baseband/dsp_decimate.cpp +++ b/firmware/baseband/dsp_decimate.cpp @@ -177,6 +177,20 @@ static inline uint32_t scale_round_and_pack( return __PKHBT(saturated_real, saturated_imag, 16); } +template +static void taps_copy( + const Tap* const source, + Tap* const target, + const size_t count, + const bool shift_up +) { + const uint32_t negate_pattern = shift_up ? 0b1110 : 0b0100; + for(size_t i=0; i> (i & 3)) & 1; + target[i] = negate ? -source[i] : source[i]; + } +} + // FIRC8xR16x24FS4Decim4 ////////////////////////////////////////////////// void FIRC8xR16x24FS4Decim4::configure( @@ -184,13 +198,7 @@ void FIRC8xR16x24FS4Decim4::configure( const int32_t scale, const Shift shift ) { - const int negate_factor = (shift == Shift::Up) ? -1 : 1; - for(size_t i=0; i