- added
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@953 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -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
|
||||
@@ -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_
|
||||
Reference in New Issue
Block a user