#include "TimingGenerator.hpp"
#include <iostream>

namespace Radio
{
namespace Interpolation
{
TimingGenerator::TimingGenerator()
: m_omega(0)
, m_mu(0)
, m_adv(0)
{
}

TimingGenerator::~TimingGenerator()
{

}

void TimingGenerator::setOmega(radio_float_t omega)
{
	m_omega = omega;
}

void TimingGenerator::process(ComplexScalar const &iq)
{
	(void)iq;
	update(1.0);
}

void TimingGenerator::update(radio_float_t dOmega)
{
	m_mu += (m_omega + dOmega);
	m_adv = (size_t)m_mu;
	m_mu -= m_adv;
}

radio_float_t TimingGenerator::getMu() const
{
	return m_mu;
}

size_t TimingGenerator::getAdv() const
{
	return m_adv;
}

} // Interpolation
} // Radio
