# Development and Testing of an Active Noise Control System for Urban Road Traffic Noise
## 3 Development of the Active Noise Control Prototype System
### Active Noise Control System Algorithm  
In the realm of active noise control systems, the Least Mean Squares (LMS) algorithm holds a fundamental and crucial position among adaptive filtering algorithms. The LMS algorithm employs a steepest descent approach, recursively updating the filter coefficients. Figure 5 presents an adaptive filter model based on the LMS algorithm:  
In this model, the reference signal \(X(n)\), which represents the original noise signal, is captured by an external sensor and fed into the FIR (Finite Impulse Response) filter. This filter creates an output signal \(\mathbf{y}(n)\) based on its weights and \(X(n)\). Ideally, \(\mathbf{y}(n)\) should match the original noise \(d(n)\) in magnitude but be inversely phased for manual cancellation at the error sensor location, yielding the smallest error signal \(e(n)\). The system strives to minimize \(e(n)\) via continuous adaptive updates, thereby achieving optimal noise cancellation.  
We first define the vector of the reference signal \(X(n)\) at time n and the vector of the filter weight coefficients:  
\[X(n)=\left[x(n),x(n-1),\ldots,x(n-L+1)\right]^{T} \tag{7}\]  
\[W(n)=\left[w_{0}(n),w_{1}(n),\ldots,w_{(L-1)}(n)\right]^{T} \tag{8}\]  
The goal is to minimize the error signal \(e(n)\), the mean square value of which is:  
\[E\Big{[}e^{2}(n)\Big{]}=E\Big{[}\big{(}d(n)-y(n)\big{)}^{2}\Big{]}=E\bigg{[} \Big{(}d(n)-W^{T}(n)X(n)\Big{)}^{2}\bigg{]} \tag{9}\]  
Next, we need to find the filter coefficients that minimize the mean square value, thereby minimizing the mean square value of \(e(n)\) In the LMS algorithm, the steepest descent method is used; each step of the weight vector change is proportional to the negative value of the gradient vector [54], formalized as:  
\[W(n+1)=W(n)-\mu\
abla(n) \tag{10}\]  
Here, \(\
abla(n)\) denotes the gradient vector of the nth iteration, and \(\mu\) represents the iteration step size. The gradient vector is calculated as  
\[\
abla(n)=\frac{\partial E\big{[}e^{2}(n)\big{]}}{\partial W(n)}=-2E\big{[}e (n)X(n)\big{]} \tag{11}\]  
Taking the gradient of a single sample \(e^{2}(n)\) as an estimate of the mean square error gradient, we obtain the gradient estimate:  
\[\
abla(n)=\frac{\partial e^{2}(n)}{\partial W}=-2e(n)X(n) \tag{12}\]  
Figure 5: Adaptive filter based on Least Mean Squares (LMS) algorithm [52,53].  
Since the gradient estimate \(\hat{\
abla}(n)\) is an unbiased estimation of the real gradient \(\
abla(n)\), it can replace the real gradient in Equation (10), leading to the filter weight update formula:  
\[W(n+1)=W(n)-\mu\hat{\
abla}(n)=W(n)+2\mu e(n)X(n) \tag{13}\]  
To ensure the system stability, the range of the iteration step size \(\mu\) must be restricted. According to the requirements of the LMS algorithm, the iteration step size should be:  
\[0<\mu<\frac{1}{\lambda_{max}} \tag{14}\]  
where \(\lambda_{max}\) is the largest eigenvalue of the autocorrelation matrix R of the reference signal.  
The steps for the broadband feedforward LMS algorithm are summarized as follows: (1) The reference sensor captures the reference signal \(\mathbf{X}(\mathbf{n})\) and feeds it into the adaptive filter. The error sensor collects the error signal \(\mathbf{e}(\mathbf{n})\) at the noise cancellation point and feeds it into the adaptive filter. (2) The adaptive filter uses the reference signal \(\mathbf{X}(\mathbf{n})\) and the error signal \(\mathbf{e}(\mathbf{n})\) to update the filter weight \(\mathbf{W}(\mathbf{n})\), according to Equation (13). (3) The updated filter weight is used to generate a new output signal \(\mathbf{y}(\mathbf{n})\), and at the start of the next time step, steps 1 and 2 are repeated [55; 56]. Using continuous adaptive updates, we can effectively reduce the noise.