satdump/src-core/dsp/utils/freq_shift.cpp

31 lines
923 B
C++
Raw Permalink Normal View History

2025-05-11 19:14:47 -03:00
#include "freq_shift.h"
namespace satdump
{
namespace ndsp
{
FreqShiftBlock::FreqShiftBlock() : BlockSimple<complex_t, complex_t>("freq_shift_cc", {{"in", DSP_SAMPLE_TYPE_CF32}}, {{"out", DSP_SAMPLE_TYPE_CF32}}) {}
FreqShiftBlock::~FreqShiftBlock() {}
uint32_t FreqShiftBlock::process(complex_t *input, uint32_t nsamples, complex_t *output)
{
2025-05-11 19:14:47 -03:00
if (needs_reinit)
2025-05-11 19:14:47 -03:00
{
needs_reinit = false;
init();
2025-05-11 19:14:47 -03:00
}
2025-05-23 19:19:37 +02:00
#if VOLK_VERSION >= 030100
volk_32fc_s32fc_x2_rotator2_32fc((lv_32fc_t *)output, (const lv_32fc_t *)input, (lv_32fc_t *)&phase_delta, (lv_32fc_t *)&phase, nsamples);
2025-05-23 19:19:37 +02:00
#else
volk_32fc_s32fc_x2_rotator_32fc((lv_32fc_t *)output, (const lv_32fc_t *)input, phase_delta, (lv_32fc_t *)&phase, nsamples);
#endif
return nsamples;
2025-05-11 19:14:47 -03:00
}
2025-05-11 19:14:47 -03:00
} // namespace ndsp
} // namespace satdump