2025-05-11 19:14:47 -03:00
|
|
|
#include "freq_shift.h"
|
|
|
|
|
|
|
|
|
|
namespace satdump
|
|
|
|
|
{
|
|
|
|
|
namespace ndsp
|
|
|
|
|
{
|
2025-05-17 13:27:09 -03:00
|
|
|
FreqShiftBlock::FreqShiftBlock() : BlockSimple<complex_t, complex_t>("freq_shift_cc", {{"in", DSP_SAMPLE_TYPE_CF32}}, {{"out", DSP_SAMPLE_TYPE_CF32}}) {}
|
2025-05-17 09:56:04 -03:00
|
|
|
|
2025-05-17 13:06:53 -03:00
|
|
|
FreqShiftBlock::~FreqShiftBlock() {}
|
2025-05-17 09:56:04 -03:00
|
|
|
|
2025-05-17 13:27:09 -03:00
|
|
|
uint32_t FreqShiftBlock::process(complex_t *input, uint32_t nsamples, complex_t *output)
|
2025-05-17 09:56:04 -03:00
|
|
|
{
|
2025-05-11 19:14:47 -03:00
|
|
|
|
2025-05-17 13:06:53 -03:00
|
|
|
if (needs_reinit)
|
2025-05-11 19:14:47 -03:00
|
|
|
{
|
2025-05-17 13:06:53 -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
|
2025-05-17 13:27:09 -03:00
|
|
|
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
|
2025-05-17 13:06:53 -03:00
|
|
|
|
2025-05-17 13:27:09 -03:00
|
|
|
return nsamples;
|
2025-05-11 19:14:47 -03:00
|
|
|
}
|
2025-05-17 13:06:53 -03:00
|
|
|
|
2025-05-11 19:14:47 -03:00
|
|
|
} // namespace ndsp
|
|
|
|
|
} // namespace satdump
|