diff --git a/radio/interpolation/Interpolator.cpp b/radio/interpolation/Interpolator.cpp deleted file mode 100644 index 2290eb9..0000000 --- a/radio/interpolation/Interpolator.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "Interpolator.hpp" -#include - -namespace Radio -{ -namespace Interpolation -{ -Interpolator::Interpolator() -: m_adv(0) -, m_mu(0) -{ -} - -Interpolator::~Interpolator() -{ - -} - -void Interpolator::process(radio_float_t dMu) -{ - m_mu += dMu; - m_adv = (size_t)m_mu; - m_mu -= m_adv; -} - -radio_float_t Interpolator::getMu() -{ - return m_mu; -} - -size_t Interpolator::getAdv() -{ - return m_adv; -} - -} // Interpolation -} // Radio diff --git a/radio/interpolation/Interpolator.hpp b/radio/interpolation/Interpolator.hpp deleted file mode 100644 index 3659dda..0000000 --- a/radio/interpolation/Interpolator.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef _INTERPOLATION_INTERPOLATOR_HPP_ -#define _INTERPOLATION_INTERPOLATOR_HPP_ - -#pragma once - -#include -#include - -namespace Radio -{ -namespace Interpolation -{ -class Interpolator -{ -public: - Interpolator(); - virtual ~Interpolator(); - - radio_float_t getMu(); - size_t getAdv(); - void process(radio_float_t dMu); - -private: - radio_float_t m_mu; - size_t m_adv; -}; -} // Interpolation -} // Radio - -#endif // _INTERPOLATION_INTERPOLATOR_HPP_ \ No newline at end of file diff --git a/radio/interpolation/TimingGenerator.cpp b/radio/interpolation/TimingGenerator.cpp new file mode 100644 index 0000000..5e9a425 --- /dev/null +++ b/radio/interpolation/TimingGenerator.cpp @@ -0,0 +1,49 @@ +#include "TimingGenerator.hpp" +#include + +namespace Radio +{ +namespace Interpolation +{ +TimingGenerator::TimingGenerator() +: m_omega(1) +, 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(); +} + +void TimingGenerator::update() +{ + m_mu += m_omega; + 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 diff --git a/radio/interpolation/TimingGenerator.hpp b/radio/interpolation/TimingGenerator.hpp new file mode 100644 index 0000000..95ec53e --- /dev/null +++ b/radio/interpolation/TimingGenerator.hpp @@ -0,0 +1,38 @@ +#ifndef _INTERPOLATION_TIMINGGENERATOR_HPP_ +#define _INTERPOLATION_TIMINGGENERATOR_HPP_ + +#pragma once + +#include +#include + +#include + +namespace Radio +{ +namespace Interpolation +{ +class TimingGenerator +{ +public: + TimingGenerator(); + virtual ~TimingGenerator(); + + size_t getAdv() const; + radio_float_t getMu() const; + void setOmega(radio_float_t omega); + + virtual void process(ComplexScalar const &iq); + +protected: + radio_float_t m_omega; + radio_float_t m_mu; + size_t m_adv; + +private: + void update(); +}; +} // Interpolation +} // Radio + +#endif // _INTERPOLATION_TIMINGGENERATOR_HPP_ \ No newline at end of file