Integrator Class

The integrator class produces an integral of the input signal. More...

Header: #include <Filter/Filter.h>
Inherits: CDPBaseObject

Public Functions

double GetGti()
double Getk()
void Init(double Gti, double yMin, double yMax, double k = 1)
virtual double Integrate(double x)
void SetGti(double Gti)
void SetLimits(double min, double max)
void SetValue(double newValue)
void Setk(double newk)
double Value()

Reimplemented Public Functions

virtual void Create(const char *shortName, CDPBaseObject *pParent)
virtual std::string GetNodeTypeName() const override

Additional Inherited Members

Detailed Description

The integrator class produces an integral of the input signal.

See also Init(), Integrate(), IIRFilter, and RateLimitedFilter.

Member Function Documentation


Set default values to prevent errors if Init() has not been called.

[virtual] void Integrator::Create(const char *shortName, CDPBaseObject *pParent)

Reimplemented from CDPBaseObject::Create().

Create the integrator with a shortName and a pParent object.

double Integrator::GetGti()

Returns Gti parameter

[override virtual] std::string Integrator::GetNodeTypeName() const

Reimplemented from ICDPNode::GetNodeTypeName().

Returns "Integrator"

double Integrator::Getk()

Returns k parameter

void Integrator::Init(double Gti, double yMin, double yMax, double k = 1)

Initialize integrator, set Gti integrator gain, yMin minimum output value limit and yMax maximum output value limit. The k integrator gain is set to 1 by default. This function can also be used to reset the Integrator output.

[virtual] double Integrator::Integrate(double x)

Integrates x. The output is calculated in following way: y = k * y_n + Gti * x, where x is input and y_n is the previous output value. The output is limited within a minimum and a maximum value. Should be called periodically to run the integrator. The method returns the new output value.

Note: To read the output more than once each period, use Value() method to prevent the integrator from calculating a new value.

void Integrator::SetGti(double Gti)

Sets Gti parameter.

void Integrator::SetLimits(double min, double max)

Sets integrator limits min and max

void Integrator::SetValue(double newValue)

Sets current output value to newValue.

void Integrator::Setk(double newk)

Sets k parameter.

double Integrator::Value()

Returns current output value without calculating new.

© CDP Technologies AS - All rights reserved