Integrator Class
The integrator class produces an integral of the input signal. More...
Header: | #include <Filter/Filter.h> |
Inherits: | CDPBaseObject |
Public Functions
Integrator() | |
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 |
- 46 public functions inherited from CDPBaseObject
- 26 public functions inherited from CDP::StudioAPI::CDPNode
- 22 public functions inherited from CDP::StudioAPI::ICDPNode
Additional Inherited Members
- 1 static public member inherited from CDPBaseObject
- 1 protected function inherited from CDP::StudioAPI::CDPNode
- 9 protected variables inherited from CDPBaseObject
Detailed Description
The integrator class produces an integral of the input signal.
See also Init(), Integrate(), IIRFilter, and RateLimitedFilter.
Member Function Documentation
Integrator::Integrator()
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.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.