git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@95 b431acfa-c32f-4a4a-93f1-934dc6c82436
61 lines
814 B
C++
61 lines
814 B
C++
/*
|
|
* File: FirComplex.hpp
|
|
* Author: jens
|
|
*
|
|
* Created on 20. Dezember 2014, 08:12
|
|
*/
|
|
|
|
#ifndef FIRCOMPLEX_HPP
|
|
#define FIRCOMPLEX_HPP
|
|
|
|
#include "Vector.hpp"
|
|
|
|
namespace Radio
|
|
{
|
|
|
|
class FirComplex
|
|
{
|
|
public:
|
|
FirComplex(uint32_t numTaps = 0)
|
|
: m_numTaps(numTaps)
|
|
, m_x(numTaps)
|
|
{
|
|
}
|
|
virtual ~FirComplex()
|
|
{
|
|
|
|
}
|
|
|
|
void setNumTaps(uint32_t numTaps)
|
|
{
|
|
m_numTaps = numTaps;
|
|
m_x.resize(numTaps);
|
|
m_x.fill(ComplexScalar(0,0));
|
|
}
|
|
|
|
void feed(ComplexScalar const &x)
|
|
{
|
|
m_x.reverse() << m_x.head(m_numTaps-1).reverse(), x;
|
|
}
|
|
|
|
ComplexScalar process(CVec const &coeff)
|
|
{
|
|
return m_x.transpose() * coeff.conjugate();
|
|
}
|
|
|
|
ComplexScalar processReal(RVec const &coeff)
|
|
{
|
|
return m_x.transpose() * coeff;
|
|
}
|
|
|
|
protected:
|
|
uint32_t m_numTaps;
|
|
CVec m_x;
|
|
|
|
};
|
|
|
|
} // ::Radio
|
|
|
|
#endif /* FIRCOMPLEX_HPP */
|
|
|