- refactored
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@979 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
#include "Interpolator.hpp"
|
||||
#include <iostream>
|
||||
|
||||
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
|
||||
@@ -1,30 +0,0 @@
|
||||
#ifndef _INTERPOLATION_INTERPOLATOR_HPP_
|
||||
#define _INTERPOLATION_INTERPOLATOR_HPP_
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <radio/radio_types.h>
|
||||
#include <stddef.h>
|
||||
|
||||
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_
|
||||
@@ -0,0 +1,49 @@
|
||||
#include "TimingGenerator.hpp"
|
||||
#include <iostream>
|
||||
|
||||
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
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef _INTERPOLATION_TIMINGGENERATOR_HPP_
|
||||
#define _INTERPOLATION_TIMINGGENERATOR_HPP_
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <radio/radio_types.h>
|
||||
#include <cpp/radio/Vector.hpp>
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
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_
|
||||
Reference in New Issue
Block a user