## 5 Simulations and Discussion  
### Simulation Settings  
This section provides a description of the simulation environment as well as the simulation parameters used. All the simulations were performed using MATLAB R2018b over an Intel i5 3.20 GHz processor. The performance of the proposed system was evaluated by means of the outage probability, the BER, and the user and sum rates at various SNR values.  
The proposed NOMA system was simulated based on \(N\) UEs and a single BS over 2000 iterations. At the beginning of each set of iterations, the pilot data, \(x_{p}\), were randomly generated and were known at both the transmitter and the receiver for all UEs. Initially, the power coefficients for the users and the BCH code rates were randomly assigned. The pilot sequences, \(x_{p}\), were modulated by QPSK or 64-QAM. The resulting constellation was rotated by an angle of 0.506 rad for QPSK and 0.150 rad for 64-QAM [32], followed by induction of the cyclic Q-delay. The modulated signals were then superimposed using Equation (1). The superimposed message was transmitted through \(N\) independent Rayleigh fading channels perturbed by AWGN. At the receiver, every UE performed channel estimation to determine the SNR corresponding to its channel conditions.  
The channel estimation algorithm proposed is the LSTM neural network, which uses gradient-based algorithms rather than the backpropagation algorithm. In order to enable the LSTM to correctly predict the desired channel matrices, it needs to be merged with a fully connected layer. A fully connected layer is similar to the conventional multi-layer perceptron (MLP) neural network. The difference is that it uses a SoftMax activation function in the output layer and that each neuron in the former layer is fully connected to each neuron in the subsequent layer. The main purpose of the fully connected layer is to learn the non-linear combinations of the input features. The sum of all output possibilities from the fully connected layer is 1; this can be guaranteed by the use of the SoftMax as an activation function. The SoftMax function takes a vector of random real-numbers and transforms them into a vector of values ranging from zero to one.  
The channel taps used to model the Rayleigh wireless channel were based on the following international telecommunications union (ITU) channel models: ITU channel model A for the indoor office, channel model B for the indoor office, channel model A for outdoor/indoor pedestrian, channel model B for outdoor/indoor pedestrian, channel model A for vehicular environment, and channel model B for vehicular environment [61; 62]. At the start of each training phase, the initial weights were randomly initialized. Throughout the training period, according to a gradient descent process, the weights of the network and the bias values were adapted. The training performance of the LSTM network was evaluated by means of the root-mean-square error (RMSE) and the loss, which can be described by Equations (17) and (18), respectively:  
\[\text{RMSE} = \sqrt{\frac{\sum_{j=1}^{M}{\left(h_{j}-\hat{h}_{j}\right)}^{2}}{M}}, \tag{16}\] \[\text{Loss} = \sum\
olimits_{j=1}^{M}{\left(h_{j}-h_{j}\right)}^{2}, \tag{17}\]  
where \(h_{j}\) is the actual impulse response channel taps, \(\hat{h}_{j}\) is the predicted impulse response, and M is the number of predictions.  
The behavior of the RMSE and the loss during the training epochs are shown in Figures 7 and 8, respectively.  
All the parameters used for training and testing the LSTM model are summarized in Table 2. The LSTM channel estimation was tested over 2000 iterations, attaining an average RMSE of \(4.12\times 10^{-06}\) and an average loss of \(1.37\times 10^{-11}\).