Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qltisys.h
1
9#ifndef QLTISYS_H
10#define QLTISYS_H
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16 #include <stdlib.h>
17 #include <stdint.h>
18 #include "qtdl.h"
19 #include "qnuma.h"
20
30 #define QLTISYS_DISCRETE ( -1.0F )
31
32 /*cstat -MISRAC2012-Rule-2.3*/
33
38
42 typedef float qLTISys_DiscreteX_t;
43
44 /*cstat +MISRAC2012-Rule-2.3*/
45
51 typedef struct _qLTISys_s //skipcq: CXX-E2000
52 {
54 float (*sysUpdate)( struct _qLTISys_s *sys, float u );
55 float *b, *a;
56 float *xd;
57 qNumA_state_t *xc;
58 qTDL_t tDelay;
59 float dt, b0, min, max;
60 size_t n, na, nb;
61 qNumA_IntegrationMethod_t integrate;
63 } qLTISys_t;
64
75 float qLTISys_Excite( qLTISys_t * const sys,
76 float u );
77
87 int qLTISys_SetDelay( qLTISys_t * const sys,
88 float * const w,
89 const size_t n,
90 const float initVal );
91
99 int qLTISys_SetSaturation( qLTISys_t * const sys,
100 const float min,
101 const float max );
102
107 int qLTISys_IsInitialized( const qLTISys_t * const sys );
108
117 int qLTISys_SetInitStates( qLTISys_t * const sys, const float * const xi );
118
152 int qLTISys_Setup( qLTISys_t * const sys,
153 float *num,
154 float *den,
155 void *x,
156 const size_t nb,
157 const size_t na,
158 const float dt );
159
175 float qLTISys_DiscreteFIRUpdate( float *w,
176 const float * const c,
177 const size_t wsize,
178 const float x );
179
194 qNumA_IntegrationMethod_t im );
195
198#ifdef __cplusplus
199}
200#endif
201
202#endif
float qLTISys_Excite(qLTISys_t *const sys, float u)
Drives the LTI system recursively using the input signal provided.
Definition qltisys.c:61
float qLTISys_DiscreteFIRUpdate(float *w, const float *const c, const size_t wsize, const float x)
Evaluate the discrete FIR filter by updating the delay lines of x inside the window w of size wsize w...
Definition qltisys.c:212
int qLTISys_SetDelay(qLTISys_t *const sys, float *const w, const size_t n, const float initVal)
Set the input delay for LTI system.
Definition qltisys.c:88
int qLTISys_SetIntegrationMethod(qLTISys_t *const sys, qNumA_IntegrationMethod_t im)
Set integration method for continuos systems.
Definition qltisys.c:239
int qLTISys_Setup(qLTISys_t *const sys, float *num, float *den, void *x, const size_t nb, const size_t na, const float dt)
Setup and initialize an instance of a LTI system.
Definition qltisys.c:155
qNumA_state_t qLTISys_ContinuosX_t
Type to specify continuos states.
Definition qltisys.h:37
float qLTISys_DiscreteX_t
Type to specify continuos states.
Definition qltisys.h:42
int qLTISys_SetSaturation(qLTISys_t *const sys, const float min, const float max)
Setup the output saturation for the LTI system.
Definition qltisys.c:103
int qLTISys_SetInitStates(qLTISys_t *const sys, const float *const xi)
Set the initial states for the given system.
Definition qltisys.c:130
int qLTISys_IsInitialized(const qLTISys_t *const sys)
Check if the LTI system is initialized.
Definition qltisys.c:118
A LTI system object.
Definition qltisys.h:52
Definition qnuma.h:19
A Tapped Delay Line (TDL) object.
Definition qtdl.h:35