# Antiderivative Antialiasing for Stateful Systems +
## 3 Extension to Stateful Systems
By letting \(f_{\mathsf{x},0}(\mathbf{p}_{\mathsf{x},0}(n))=\mathbf{p}_{\mathsf{x},0}(n)\) and \(f_{\mathsf{y},0}(\mathbf{p}_{\mathsf{y},0}(n))=remaming \(\mathbf{A}=\mathbf{C}_{\mathbb{P}_{\chi,0}}\in\mathbb{R}^{K_{\mathrm{x}}\times K_{\mathrm{x}}}\), \(\mathbf{B}=\mathbf{D}_{\mathbb{P}_{\chi,0}}\in\mathbb{R}^{K_{\mathrm{x}}\times K_{ \mathrm{u}}}\), \(\mathbf{C}_{\mathrm{y}}=\mathbf{C}_{\mathbb{P}_{\mathrm{y},0}}\in\mathbb{R}^{K_{\mathrm{ y}}\times K_{\mathrm{x}}}\), and \(\mathbf{D}_{\mathrm{y}}=\mathbf{D}_{\mathbb{P}_{\mathrm{y},0}}\in\mathbb{R}^{K_{ \mathrm{y}}\times K_{\mathrm{u}}}\), we therefore rewrite our system as \[\mathbf{x}(n) =\mathbf{A}\mathbf{x}(n-1)+\mathbf{B}\mathbf{u}(n)+f_{\mathrm{x},1}(\mathbf{p}_{ \mathrm{x},1}(n))+\cdots+f_{\mathrm{x},L}(\mathbf{p}_{\mathrm{x},L}(n))\] (10) \[\mathbf{y}(n) =\mathbf{C}_{\mathrm{y}}\mathbf{x}(n-1)+\mathbf{D}_{\mathrm{y}}\mathbf{u}(n)+f_{ \mathrm{y},1}(\mathbf{p}_{\mathrm{y},1}(n))+\cdots+f_{\mathrm{y},M}(\mathbf{p}_{ \mathrm{y},M}(n)).\] (11)  
A visual representation is given as a block diagram in Figure 1.  
* If the system is obtained in the context of virtual analog modeling, usually the nonlinear functions will only be given implicitly (as the solution of what is sometimes referred to as a delay-free loop), making solving a nonlinear equation necessary. However, they are typically based on a common set of functions \(f_{m}\), only applying different weighting to their outputs, i.e., \[f_{\mathrm{x},m}(\mathbf{p}_{\mathrm{x},m}(n)) =\mathbf{W}_{\mathrm{x},m}f_{m}(\mathbf{p}_{m}(n))\] (12) \[f_{\mathrm{y},m}(\mathbf{p}_{\mathrm{y},m}(n)) =\mathbf{W}_{\mathrm{y},m}f_{m}(\mathbf{p}_{m}(n))\] (13) with \(L=M\) and \(\mathbf{p}_{m}(n)=\mathbf{p}_{\mathrm{x},m}(n)=\mathbf{p}_{\mathrm{y},m}(n)\). While this redundancy should be kept in mind for optimizing an implementation, we will derive our method for the more general case of possibly independent nonlinear functions for state update and output. In a first step, we may consider only applying the aliasing suppression to \(f_{\mathrm{y},m}(\mathbf{p}_{\mathrm{y},m})\), as they are not part of any feedback loop. We have to be careful though, and may not just replace \(f_{\mathrm{y},m}\) with \(\tilde{f}_{\mathrm{y},m}\) in (11), as that would lead to a misalignment in time of the linear and antialiased nonlinear terms. Instead, we have to apply the antialiasing also to the linear part \(f_{\mathrm{y},0}\), even though it obviously does not introduce aliasing distortion. Fortunately, the integral has a closed solution no matter the dimensionality, namely  
\[\tilde{f}_{\mathrm{y},0}(\mathbf{u}(n),\mathbf{u}(n-1))=\frac{1}{2}\mathbf{C}\cdot\big{(} \mathbf{x}(n-1)+\mathbf{x}(n-2)\big{)}+\frac{1}{2}\mathbf{D}\cdot\big{(}\mathbf{u}(n)+\mathbf{u}(n -1)\big{)}, \tag{14}\]  
\[\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}\]0 Block diagram of the considered system according to (8)-(11) (for \(M=L=3\)). resulting in  
\[\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}\]1  
However, any aliasing distortion introduced into \(\mathbf{x}(n)\) by (10) will not undergo any mitigation (except for the lowpass filtering). Now, if we naively rewrite (10) as we did with (11), we modify our system in an unwanted way as we introduce additional delay in the feedback. But we do that in a very controlled way: the unit delay in the feedback is replaced by a delay of 1.5 samples. As a delay of 1.5 samples corresponds to a delay of one sample at \(\frac{2}{3}\) of the sampling rate, we can compensate for the extra half-sample delay by designing our system for this reduced sampling rate, but then operating it at the original sampling rate.