![]() |
Documentation
Tools for embedded systems
|
A LTI continuous system object. More...
#include <ltisys.hpp>
Public Member Functions | |
virtual | ~continuousSystem () |
continuousSystem (real_t *num, real_t *den, nState *x, const size_t nD, const real_t dT) noexcept | |
Constructor for an instance of a LTI continuous system. | |
template<size_t order> | |
continuousSystem (continuousTF< order > &ctf, const real_t dT) | |
Constructor for an instance of a LTI continuous system from a transfer function definition. | |
template<size_t systemOrder> | |
continuousSystem (real_t(&num)[systemOrder+1], real_t(&den)[systemOrder+1], nState(&x)[systemOrder], const real_t dT) noexcept | |
Constructor for an instance of a LTI continuous system. | |
bool | setup (real_t *num, real_t *den, nState *x, const size_t nD, const real_t dT) noexcept |
Setup and initialize an instance of a LTI continuous system. | |
template<size_t systemOrder> | |
bool | setup (real_t(&num)[systemOrder+1], real_t(&den)[systemOrder+1], nState(&x)[systemOrder], const real_t dT) noexcept |
Setup and initialize an instance of a LTI continuous system. | |
template<size_t order> | |
bool | setup (continuousTF< order > &ctf, const real_t dT) |
Setup and initialize an instance of a LTI continuous system from a transfer function definition. | |
bool | isInitialized (void) const override |
Check if the LTI continuous system is initialized. | |
bool | setInitStates (const real_t *xi=nullptr) override |
Set the initial states for the continuous system. | |
bool | setIntegrationMethod (integrationMethod m) |
Set integration method of the continuous system. | |
![]() | |
virtual | ~ltisys () |
ltisys ()=default | |
real_t | excite (real_t u) |
Drives the LTI system recursively using the input signal provided. | |
ltisysType | getType (void) const |
Get the LTI system type. | |
bool | setDelay (real_t *const w, const size_t nD, const real_t initVal=0.0_re) noexcept |
Set the input delay for LTI system. | |
bool | setSaturation (const real_t minV, const real_t maxV) noexcept |
Setup the output saturation for the LTI system. | |
![]() | |
virtual | ~tdl () |
tdl ()=default | |
tdl (real_t *const area, const size_t n, const real_t initVal=0.0_re) | |
Constructor for the Tapped Delay Line (TDL) instance. | |
template<size_t numberOfDelays> | |
tdl (real_t(&area)[numberOfDelays], const real_t initVal=0.0_re) noexcept | |
Constructor for the Tapped Delay Line (TDL) instance. | |
void | setup (real_t *const area, const size_t n, const real_t initVal=0.0_re) noexcept |
Setup and initialize a Tapped Delay Line (TDL) instance by setting the default optimal parameters. | |
template<size_t numberOfDelays> | |
void | setup (real_t(&area)[numberOfDelays], const real_t initVal=0.0_re) noexcept |
Setup and initialize a Tapped Delay Line (TDL) instance by setting the default optimal parameters. | |
void | flush (const real_t initVal=0.0_re) noexcept |
Clears all delays from the TDL and sets them to the specified value. | |
real_t | getOldest (void) const noexcept |
Get the oldest sample from the TDL x(k-n) | |
real_t | getRecent (void) const noexcept |
Get the most recent sample from the TDL x(k) | |
real_t | getAtIndex (const size_t i) const noexcept |
Get the specified delayed sample from the TDL x(k-i) | |
void | insertSample (const real_t sample) noexcept |
Insert a new sample to the TDL removing the oldest sample. | |
const real_t & | operator[] (int index) noexcept |
Get the specified delayed sample from the TDL x(k-i) | |
void | operator() (const real_t sample) noexcept |
Insert a new sample to the TDL removing the oldest sample. | |
bool | isInitialized (void) const |
Check if the TDL has been initialized. | |
A LTI continuous system object.
The instance should be initialized using the continuousSystem::setup() method.
|
inlinevirtual |
|
inlinenoexcept |
Constructor for an instance of a LTI continuous system.
[in,out] | num | : An array of n+1 elements with the numerator coefficients of the transfer function. Coefficients should be given in descending powers of the n or nb-degree polynomial. Coefficients will be normalized internally. |
[in,out] | den | An array of n+1 elements with the denominator coefficients of the transfer function. Coefficients should be given in descending powers of the n or nb-degree polynomial. Coefficients will be normalized internally. |
[in,out] | x | Initial conditions of the system. For a continuos system, an array of type continuousStates with n elements. The supplied array will be updated on every invocation of continuousSystem::excite(). |
[in] | nD | The system order ( n ). |
example 2: \( \frac{ b_{0}s^{2}+b_{1}s+b_{2} }{ a_{0}s^{2} + a_{1}s + a_{2} }, na = 3 \)
[in] | dT | The time-step of the continuos system. |
|
inline |
Constructor for an instance of a LTI continuous system from a transfer function definition.
[in] | ctf | : The continuous transfer-function |
[in] | dT | The time-step of the continuos system. |
|
inlinenoexcept |
Constructor for an instance of a LTI continuous system.
[in,out] | num | : An array of n+1 elements with the numerator coefficients of the transfer function. Coefficients should be given in descending powers of the n or nb-degree polynomial. Coefficients will be normalized internally. |
[in,out] | den | An array of n+1 elements with the denominator coefficients of the transfer function. Coefficients should be given in descending powers of the n or nb-degree polynomial. Coefficients will be normalized internally. |
[in,out] | x | Initial conditions of the system. For a continuos system, an array of type continuousStates with n elements. The supplied array will be updated on every invocation of continuousSystem::excite(). |
[in] | dT | The time-step of the continuos system. |
|
inlineoverridevirtual |
Check if the LTI continuous system is initialized.
true
if the system has been initialized, otherwise return false
. Implements qlibs::ltisys.
|
overridevirtual |
Set the initial states for the continuous system.
[in] | xi | An array of n-elements with the initial state values. User can pass nullptr as argument to set initial conditions equal to zero. |
true
on success, otherwise return false
. Implements qlibs::ltisys.
bool continuousSystem::setIntegrationMethod | ( | integrationMethod | m | ) |
Set integration method of the continuous system.
[in] | m | The desired integration method. Use one of the following: |
INTEGRATION_RECTANGULAR
: Integrate using the Rectangular rule.
INTEGRATION_TRAPEZOIDAL
: (default) Integrate using the Trapezoidal rule.
INTEGRATION_SIMPSON
: Integrate using the Simpson's 1/3 rule.
true
on success, otherwise return false
.
|
inline |
Setup and initialize an instance of a LTI continuous system from a transfer function definition.
[in] | ctf | : The continuous transfer-function |
[in] | dT | The time-step of the continuos system. |
true
on success, otherwise return false
.
|
noexcept |
Setup and initialize an instance of a LTI continuous system.
[in,out] | num | : An array of n+1 elements with the numerator coefficients of the transfer function. Coefficients should be given in descending powers of the n or nb-degree polynomial. Coefficients will be normalized internally. |
[in,out] | den | An array of n+1 elements with the denominator coefficients of the transfer function. Coefficients should be given in descending powers of the n or nb-degree polynomial. Coefficients will be normalized internally. |
[in,out] | x | Initial conditions of the system. For a continuos system, an array of type continuousStates with n elements. The supplied array will be updated on every invocation of continuousSystem::excite(). |
[in] | nD | The system order ( n ). |
example 2: \( \frac{ b_{0}s^{2}+b_{1}s+b_{2} }{ a_{0}s^{2} + a_{1}s + a_{2} }, na = 3 \)
[in] | dT | The time-step of the continuos system. |
true
on success, otherwise return false
.
|
inlinenoexcept |
Setup and initialize an instance of a LTI continuous system.
[in,out] | num | : An array of n+1 elements with the numerator coefficients of the transfer function. Coefficients should be given in descending powers of the n or nb-degree polynomial. Coefficients will be normalized internally. |
[in,out] | den | An array of n+1 elements with the denominator coefficients of the transfer function. Coefficients should be given in descending powers of the n or nb-degree polynomial. Coefficients will be normalized internally. |
[in,out] | x | Initial conditions of the system. For a continuos system, an array of type continuousStates with n elements. The supplied array will be updated on every invocation of continuousSystem::excite(). |
[in] | dT | The time-step of the continuos system. |
true
on success, otherwise return false
.