# Combination of Robust Algorithm and Head-Tracking for a Feedforward Active Headrest
## 2 Design of the Optimal Filter Coefficients of Active Headrest with Traditional Algorithm  
The noise data collected on a high-speed railway indicate that the frequency characteristic of the noise is constant [20; 21]. Therefore, the proposed active headrest system shown in Figure 1 adopts a fixed optimal filter rather than an adaptive filter for the active headrest. The system remains stable if feedback from the secondary sources to the reference microphone is not considered. After obtaining the optimal filter of the ANC system, error microphones are not needed.  
The implementation of the active headrest based on the feedforward algorithm is shown in Figure 1. The signal \(x(n)\) is the reference signal and \(P\) is the primary path transfer function. The primary  
Figure 1: Schematic diagram of the active feedforward headrest integrated with head-tracking.  
noise at the error microphones is \(d_{l}(n)\). Suppose that there are four secondary loudspeakers and two error microphones. Error microphones are placed at the individual's ears to reduce the noise at the ears. \(g_{lm}\) is the secondary path transfer function from the \(m\)th loudspeaker to the \(l\)th error microphone. The output of the controller \(y_{m}(n)\) is obtained by filtering the reference signal \(x(n)\) with the filter \(\mathbf{w}_{m}\).  
In the traditional active headrest system, the human head without rotation is positioned at the center of the headrest. The error microphones are placed at the two ears and the error signals \(e_{l}(n)\) can be expressed as  
\[e_{l}(n)=d_{l}(n)+\sum_{m=1}^{4}\mathbf{w}_{m}^{\top}\mathbf{r}_{lm}(n). \tag{1}\]  
The order of the filter \(\mathbf{w}_{m}=\begin{bmatrix}w_{m0}\ w_{m1}\ w_{m1}\...\ w_{m(I-1)}\end{bmatrix}^{T}\) is \(I\), and \(\mathbf{r}_{lm}(n)=\begin{bmatrix}r_{lm}(n)\ r_{lm}(n-1)\...\ r_{lm}(n-I+1) \end{bmatrix}^{T}\) is the filtered-x signal vector, where  
\[r_{lm}(n)=\sum_{j=0}^{J-1}g_{lm}(j)x(n-i). \tag{2}\]  
The optimal filter coefficient is designed to minimize the sum of the mean square errors of the residual signals \(e_{l}(n)\). The cost function can be stated concisely as:  
\[J(n)=E[e_{1}^{2}(n)+e_{2}^{2}(n)]. \tag{3}\]  
where \(E\) is the expectation operator. To find the optimal \(\mathbf{w}_{m}\) that minimizes Equation (3), its derivative is calculated with respect to each \(\mathbf{w}_{m}\) where the derivative is equal to 0.  
\[\frac{\partial J}{\partial\mathbf{w}_{i}}=\sum_{m=1}^{4}E\begin{bmatrix}\mathbf{r_{1} }\mathbf{r_{1m}^{T}}\mathbf{w_{m}}+\mathbf{r_{2i}}\mathbf{r_{2m}^{T}}\mathbf{w_{m}}\end{bmatrix}. \tag{4}\]  
Set \(\mathbf{w}=[\mathbf{w}_{1}^{T}\ \mathbf{w}_{2}^{T}\ \mathbf{w}_{3}^{T}\ \mathbf{w}_{4}^{T}]^{T}\) and rearrange Equation (4) by \(\mathbf{w}_{m}\). Then, we can place the coefficients of \(\mathbf{w}_{i}\) into a new autocorrelation matrix \(\mathbf{R}\).  
\[\mathbf{R}=E\begin{bmatrix}r_{11}\mathbf{r_{11}^{T}}+r_{21}\mathbf{r_{21}^{T}}&r_{11}\mathbf{ r_{12}^{T}}+r_{21}\mathbf{r_{22}^{T}}&r_{11}\mathbf{r_{13}^{T}}+r_{21}\mathbf{r_{23}^{T}}&r_{1 1}\mathbf{r_{14}^{T}}+r_{21}\mathbf{r_{24}^{T}}\\ r_{12}\mathbf{r_{11}^{T}}+r_{22}\mathbf{r_{21}^{T}}&r_{12}\mathbf{r_{12}^{T}}+r_{22}\mathbf{r_{ 22}^{T}}&r_{12}\mathbf{r_{13}^{T}}+r_{22}\mathbf{r_{23}^{T}}&r_{12}\mathbf{r_{14}^{T}}+r_{ 22}\mathbf{r_{24}^{T}}\\ r_{13}  
headrest retrieves the precalculated filter coefficients using the position of the head obtained by the head-tracking system.