## 2 Methods  
### Structures of Recurrent Neural Networks for Sequence Data Predictions  
The RNN is used to manage the sequence data. As shown in Figure 2, the RNN layer accepts time-varying input data \(x_{t}\) and outputs a value \(y_{t}\). A loop allows information to be passed from one step of the network to another. The RNN layer \(H_{t}\) derives the output value \(y_{t}\) from the input value \(x_{t}\) at time \(t\) and from the weights of \(H_{t-1}\). Simultaneously, the weight information of \(H_{t}\) is conveyed to \(H_{t+1}\). This chain-like characteristic of the RNN shows good performance when processing sequences and lists. When processing long-term sequence data using the RNN, errors gradually accumulate from the previous tasks. The LSTM network was developed to avoid the vanishing gradient problem. LSTM networks, as introduced by [PERSON] and [PERSON] [23], are capable of learning long-term dependencies. LSTM is one of the RNN techniques, and the basic structure is the same as shown in Figure 2. A single LSTM block consists of a cell, input gate, output gate, and forget gate [24]. The LSTM block remembers the values over arbitrary time intervals and the three gates modulate the flow of information into and out of the block. The input gate determines whether data will be stored in the memory cell. The forget gate determines whether the current content of the memory cell must be forgotten. The output gate determines whether the current memory content exhibits the results. Each gate operates according to the following equations. Figure 2: Basic structure of a recurrent neural network (RNN). Chain-like characteristics of RNNs show the advantages of analyzing sequence data. \[ \begin{array}{l}\mathbf{i}^{t}=\sigma(\mathbf{W}_{i}\mathbf{x}^{t}+\mathbf{R}_{i} \mathbf{y}^{t-1}+\mathbf{b}_{i})\\ \mathbf{f}^{t}=\sigma(\mathbf{W}_{f}\mathbf{x}^{t}+\mathbf{R}/\mathbf{y}^{t-1} +\mathbf{b}_{f})\\ \mathbf{o}^{t}=\sigma(\mathbf{W}_{o}\mathbf{x}^{t}+\mathbf{R}_{o}\mathbf{y}^{t -1}+\mathbf{b}_{o})\end{array}  \tag{2}\]  
In the above equation, \(\sigma\) is the logic sigmoid used as the gate activation function; \(\mathbf{x}_{t}\) is the input vector; \(\mathbf{y}\) is the output vector at time \(t\). \(\mathbf{W}\), \(\mathbf{R}\), and \(\mathbf{b}\) are the input, recurrent, and bias weights, respectively. \(\mathbf{i}\), \(\mathbf{f}\), and \(\mathbf{o}\) denote the input, forget, and output gate-state vectors, respectively. The cell state \(\mathbf{c}_{t}\) and output of the memory cell \(\mathbf{y}^{t}\) are computed as follows:  
\[ \begin{array}{l}\mathbf{c}^{t}=\mathbf{f}^{t}*\mathbf{c}^{t-1}+\mathbf{i}^ {t}*\tanh(\mathbf{W}_{c}\mathbf{x}^{t}+\mathbf{R}_{c}\mathbf{y}^{t-1}+ \mathbf{b}_{c})\\ \mathbf{y}^{t}=\tanh(\mathbf{c}^{t})*\mathbf{o}^{t}\end{array}  \tag{3}\]  
where \(*\) is the scalar product, and \(\mathbf{W}\), \(\mathbf{R}\), and \(\mathbf{b}\) are modeling parameters learned during the training of the LSTM layers. The LSTM is capable of processing long-term sequence data owing to the forget gate and output activation function (considered critical components). For fast and stable convergence results, the LSTM neural networks can be trained using stochastic gradient descent and an adaptive learning rate [25]. The characteristics of the LSTM are suitable for predicting input sounds and generating noise-cancelation responses. In this study, deep LSTM neural networks were utilized for ANC to enhance the convergence speed and noise-cancelation capabilities. Deep Neural Networks Controller with Long Short-Term Memory (LSTM) for Active Noise Cancellation (ANC) System  
A block diagram of the ANC system using the deep neural network filter with the LSTM is shown in Figure 3. Compared to Figure 1, the blocks corresponding to the FxLMS algorithm are replaced with the LSTM controller block. The LSTM controller accepts the noise \(x(n)\) as input from the reference microphone. The controller generates an output \(y(n)\) that passes through the secondary path \(S(z)\) from the input data.