#include "correct_iq.h" #include "common/dsp/complex.h" namespace satdump { namespace ndsp { template CorrectIQBlock::CorrectIQBlock() : BlockSimple(std::is_same_v ? "correct_iq_cc" : "correct_iq_ff", {{"in", std::is_same_v ? DSP_SAMPLE_TYPE_CF32 : DSP_SAMPLE_TYPE_F32}}, {{"out", std::is_same_v ? DSP_SAMPLE_TYPE_CF32 : DSP_SAMPLE_TYPE_F32}}) { beta = 1.0f - alpha; } template CorrectIQBlock::~CorrectIQBlock() { } template uint32_t CorrectIQBlock::process(T *in, uint32_t nsamples, T *out) { for (uint32_t i = 0; i < nsamples; i++) { acc = acc * beta + in[i] * alpha; out[i] = in[i] - acc; } return nsamples; } template class CorrectIQBlock; template class CorrectIQBlock; } // namespace ndsp } // namespace satdump