# Antiderivative Antialiasing for Stateful Systems +
## 3 Extension to Stateful Systems  
The half-sample delay introduced by the method of [10] becomes problematic if the nonlinearity is embedded in the feedback loop of a stateful system. As noted in [10], for the particular case of an integrator following the nonlinearity and using trapezoidal rule for time-discretization, one can simply replace the numerator of the discretized integrator's transfer function with the filter introduced by antialiasing. This fusing of antialiased nonlinearity and integrator then has no additional delay compared to the system without antialiasing, hence can be used inside a feedback system without problems. Here, we consider systems that do not necessarily have an integrator following the nonlinearity. In particular, we shall consider the general discrete nonlinear state-space system  
\[\mathbf{x}(n) =f_{\mathsf{x},0}(\mathbf{p}_{\mathsf{x},0}(n))+\cdots+f_{\mathsf{x},L}(\mathbf{p}_{\mathsf{x},L}(n)) \tag{6}\] \[\mathbf{y}(n) =f_{\mathsf{y},0}(\mathbf{p}_{\mathsf{y},0}(n))+\cdots+f_{\mathsf{y},M}(\mathbf{p}_{\mathsf{y},M}(n)), \tag{7}\]  
with  
\[\mathbf{p}_{\mathsf{x},l}(n) =\mathbf{C}_{\mathsf{P}_{\mathsf{x},l}}\mathbf{x}(n-1)+\mathbf{D}_{\mathsf{P} _{\mathsf{y},l}}\mathbf{u}(n) \tag{8}\] \[\mathbf{p}_{\mathsf{y},m}(n) =\mathbf{C}_{\mathsf{P}_{\mathsf{y},m}}\mathbf{x}(n-1)+\mathbf{D}_{\mathsf{P} _{\mathsf{y},m}}\mathbf{u}(n), \tag{9}\]  
where \(\mathbf{x}(n)\in\mathbb{R}^{K_{\rm x}}\) is the state vector, \(\mathbf{u}(n)\in\mathbb{R}^{K_{\rm u}}\) is the input vector, and \(\mathbf{y}(n)\in\mathbb{R}^{K_{\rm y}}\) is the output vector. The nonlinearity of the system is captured by the (potentially) nonlinear functions \(\mathbf{f}_{\mathsf{x},l}:\mathbb{R}^{K_{\rm P}_{\mathsf{y},l}}\to\mathbb{R}^{K_{ \rm x}}\) and \(\mathbf{f}_{\mathsf{y},m}:\mathbb{R}^{K_{\rm P}_{\mathsf{y},m}}\to\mathbb{R}^{K_{ \rm y}}\) for state update and output, respectively. Their arguments \(\mathbf{p}_{\mathsf{x},l}(n)\in\mathbb{R}^{K_{\rm P}_{\mathsf{y},l}}\) and \(\mathbf{p}_{\mathsf{y},m}(n)\in\mathbb{R}^{K_{\rm P}_{\mathsf{y},m}}\) are calculated by (8) and (9) as a linear combination of previous states and current input where the coefficient matrices \(\mathbf{C}_{\mathsf{P}_{\mathsf{x},l}}\in\mathbb{R}^{K_{\rm P}_{\mathsf{x},l}\times K _{\rm x}}\), \(\mathbf{D}_{\mathsf{P}_{\mathsf{x},l}}\in\mathbb{R}^{K_{\rm P}_{\mathsf{y},l}\times K _{\rm u}}\), \(\mathbf{C}_{\mathsf{P}_{\mathsf{y},m}}\in\mathbb{R}^{K_{\rm P}_{\mathsf{y},m}\times K _{\rm u}}\) and \(\mathbf{D}_{\mathsf{P}_{\mathsf{y},m}}\in\mathbb{R}^{K_{\rm P}_{\mathsf{y},m}\times K _{\rm u}}\) depend on the system. Some remarks are in order:  
* We not only allow multiple states, collected in the vector \(\mathbf{x}(n)\), but similarly multiple inputs in \(\mathbf{u}(n)\) and multiple outputs in \(\mathbf{y}(n)\). In many applications, input and output will however be scalar. * While having only one nonlinear function on the right-hand side, i.e., \(L=M=0\), is perfectly valid, we allow the decomposition into a sum of multiple functions. We do this because, as discussed above, nonlinear functions with scalar or very low-dimensional argument are much better suited to the proposed method than those with higher-dimensional argument. Thus, while we theoretically allow vector-valued \(\mathbf{p}_{\mathsf{x},l}(n)\) and \(\mathbf{p}_{\mathsf{y},m}(n)\) of arbitrary dimension, from a practical viewpoint, their dimensionalities \(K_{\mathsf{P}_{\mathsf{x},l}}\) and \(K_{\mathsf{P}_{\mathsf{y},m}}\) should be low. Therefore, if the system's nonlinearity can be decomposed into a sum of nonlinear functions with low-dimensional arguments, it should be. It has to be noted, though, that unfortunately not all systems allow their nonlinearity to be decomposed in such a way. * It may often be desirable to differentiate between linear and nonlinear parts of this system.