## 8 Application Example: Real-World Data  
Next, an example of the application of the generalised Kalman filter in Equations (97)-(104) to a real-world dataset is presented. A hydroacoustic recording is chosen that was obtained in the Baltic Sea by a floating hydrophone while a ship was passing at a distance of a few hundred metres. The original sampling rate was 20 kHz, but the data have been subsampled to 5 kHz. From a much longer time series, a short window of 0.4096 s in length is selected, corresponding to 2048 samples. The selected data are transformed into a mean of zero and a variance of one. Within the selected window, the underwater sound emission of the passing ship is dominated by a single line at a frequency of approx. 498.5 Hz. The aim of the analysis is to extract this line from background noise and other signal components. The data dimension is \(n=1\), while the state dimension is chosen as \(m=2\). Since it is intended to model a single stochastic oscillation, the structure of the state space model is chosen such that it corresponds to an autoregressive moving-average (ARMA) model with model orders \(p=2\) and \(q=1\):  
\[y_{t}=a_{1}y_{t-1}+a_{2}y_{t-2}+b_{1}\eta_{t-1}+\eta_{t}.\]  
From this model, the state transition matrix and the dynamical noise covariance matrix of the state space model, in _observer canonical form_, are as follows:  
\[\mathsf{A}= \begin{pmatrix}a_{1}&1\\ a_{2}&0\end{pmatrix} \qquad,\qquad\mathsf{Q}= \begin{pmatrix}1&b_{1}\\ b_{1}&b_{1}^{2}+\beta\end{pmatrix} .\]  
In a pure ARMA model, the additional parameter \(\beta\) should be zero; however, in order to avoid a singular covariance matrix, \(\mathsf{Q}\), it is necessary to allow this parameter to be non-zero; it is constrained to be positive. All the model parameters are fitted to the selected data through numerical maximisation of the innovation likelihood. The innovation likelihood is computed with the generalised Kalman filter in Equations (97)-(104). The resulting estimates of the model parameters are  
\[a_{1} =1.6180\, a_{2} =-0.9974\,\] \[\mathsf{C} =(-0.0099,0)\, b_{1} =-0.0013\,\] \[\beta =0.0020\, r =0.9329\,\] \[\mathsf{S}^{(0)} =(0.7056,0)^{\mathsf{T}}\, \mathsf{S}^{(1)} =(-0.2599,0)\.\]  
The estimates of \(a_{1}\) and \(a_{2}\) correspond to a frequency of 498.5751 Hz. Also, an estimate of the initial state, \(\mathbf{x}_{1|0}\), is obtained by maximising the innovation likelihood. It should be  
Figure 1: Histogram of reduction in variance in observational noise for 1000 time series that were created from a simulated state space model and analysed by estimating the states using the non-recursive weighted least-squares approach in Equation (65) (smoothed state estimates: red colour) and by estimating the states using the generalised Kalman filter in Equations (97)–(104) (filtered state estimates: green colour)noted that these estimates of the model parameters may represent only a local maximum of the innovation likelihood. Then, the optimised state space model is employed to estimate the states that correspond to the selected data, using either the non-recursive weighted least-squares approach of solving Equation (65) directly or the generalised Kalman filter in Equations (97)-(104). While the first approach yields smoothed estimates, the latter yields filtered estimates. Both time series of state estimates are displayed in Figure 2, either versus time or as a perpendicular scatter plot. At each time point, the state is a two-dimensional vector, but only the first component is displayed. In the figure, it can be seen that both time series of state estimates are very similar. The smoothed state estimates obtained by the non-recursive approach (denoted by lines and symbols in red colour) represent the correct estimates by definition.