Open arvoelke opened 5 years ago
Work-in-progress:
def sys_filt(sys, u, saturate=10):
# https://github.com/arvoelke/nengolib/issues/168
assert sys.analog == False
x = np.zeros((len(sys)))
y = np.zeros((len(u), sys.size_out))
for i in range(len(u)):
y[i, :] = sys.C.dot(x) + sys.D.dot(u[i, :])
x[:] = (sys.A.dot(x) + sys.B.dot(u[i, :])).clip(-saturate, saturate)
return y
The sys *= z
in NengoLinearFilterMixin
can also be detrimental as this converts back and forth between TF and SS.
Also related to #106 as the current implementation for multi-output systems does not have these issues. That is, sys.X.filt
is okay but sys.filt
is not.
Currently
_CanonicalStep
(used bysys.filt
) converts the system into CCF. This conversion can be detrimental for difficult systems.