git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@953 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-06-13 07:07:08 +00:00
parent 2dfbde5af2
commit f40d66c7f9
2 changed files with 68 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
#include "Interpolator.hpp"
namespace Radio
{
namespace Interpolation
{
Interpolator::Interpolator()
: m_mu (0)
{
}
Interpolator::~Interpolator()
{
}
void Interpolator::setMu(radio_float_t mu)
{
m_mu = mu;
}
size_t Interpolator::process(radio_float_t dMu)
{
radio_float_t nextMu = m_mu + dMu;
size_t adv = nextMu;
nextMu -= adv;
return adv;
}
radio_float_t Interpolator::getMu()
{
return m_mu;
}
} // Interpolation
} // Radio
+30
View File
@@ -0,0 +1,30 @@
#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();
void setMu(radio_float_t mu);
radio_float_t getMu();
size_t process(radio_float_t dMu);
private:
radio_float_t m_mu;
};
} // Interpolation
} // Radio
#endif // _INTERPOLATION_INTERPOLATOR_HPP_