First order, (low pass / lag) filter.
Definition at line 124 of file FGJSBBase.h.
#include <FGJSBBase.h>
◆ Filter() [1/2]
◆ Filter() [2/2]
| Filter |
( |
double |
coeff, |
|
|
double |
dt |
|
) |
| |
|
inline |
Definition at line 131 of file FGJSBBase.h.
131 {
132 prev_in = prev_out = 0.0;
133 double denom = 2.0 + coeff*dt;
134 ca = coeff*dt/denom;
135 cb = (2.0 - coeff*dt)/denom;
136 }
◆ execute()
| double execute |
( |
double |
in | ) |
|
|
inline |
Definition at line 137 of file FGJSBBase.h.
137 {
138 double out = (in + prev_in)*ca + prev_out*cb;
139 prev_in = in;
140 prev_out = out;
141 return out;
142 }
◆ reset()
Definition at line 143 of file FGJSBBase.h.
143{ prev_in = prev_out = 0.0; }
The documentation for this class was generated from the following file: