## 2 Materials and Methods
### Proposed Joint CE and Turbo MUD
#### 2.2.1 Sparse Based \(k\)-NN for Active User Detection  
During the uplink transmission, users transmit the information to the central BS. Basically, all users are not dynamic during a given time interval so communication may be sporadic in nature. If we only predict the active users for transmission, the user can achieve high-speed internet connectivity. The transmitted signal vector is sparse and thus, the reconstruction of this transmitted sparse signal becomes a CS problem. In order to be suitable for a dimensional feature space, we constructed a bit mapping for the candidate bits. After mapping the received bits into a feature space, we distinguished the error bits and the right ones based on some properties. At the BS, the candidate bits are used in the training database. There is a large number of unknown bits that arrive at the same time. Therefore, the sparse based \(k\)-nearest neighbor (SKNN) algorithm is used to predict both the right and wrong bits. The prediction scheme is introduced for the detection of uplink data reception. The rights bits are taken as the active users from the BS, which is given to the receiver antennae. The prediction is conducted using the \(k\)-NN machine learning algorithm. The important aim of this paper is to detect the received signal from the channel matrix \(H\).  
\[Y=Hb+w \tag{9}\]  
\(H\in C^{N\times K}\) specifies the complex channel matrix between the central BS and \(K\) devices. We can determine the active users for the \(i\)-th symbol in b according to:  
\[\begin{array}{ll}b_{i}=0&\text{if inactive}\\ b_{i}\in M&\text{Otherwise}\end{array} \tag{10}\]  
Figure 1: Proposed multi-user detection (MUD) and channel estimation (CE).  
where \(M\) is the QAM modulation alphabet.  
We considered the received signal bits at the BS as \(I=(I_{1},\,I_{2},\,I_{3},\,\ldots,\,I_{\text{p}})\) where \(p\) is the user dimensionality of the input space. Each input variable can be considered as a dimension of a \(p\)-dimensional input space. The complete set of received signal bits is simply stored in the \"training phase\".  
First of all, we must determine the parameter \(l\), where \(0\leq l\leq 1\). The parameter \(l\) determines the number of nearest neighbors to determine the count of active users at a given time. After this, we computed the distance between the query instance and all the training samples. The BER and channel capacity is used as the query instance (QR) to predict the right and wrong bits for every user \(l\) within the limit of \(l<0.5\).  
The amount of error bits in the information stream per unit time is defined as the BER over the communication channel. BER is given as:  
\[\text{BER}=\frac{N_{e}}{N_{b}}, \tag{11}\]  
where \(N_{e}\) is the total number of error bits and \(N_{b}\) is the total number of bits sent.  
A non-linear function, which is called the ergodic capacity, is used for maximizing the capacity under fixed subcarrier rate. It can be defined as:  
\[C=\frac{1}{N}\sum_{k=1}^{N}B\,\log_{2}(1+\eta_{n}[k]), \tag{12}\]  
where \(\eta_{n}[k]\) represents the signal-to-noise ratio (SNR), \(N\) is the total number of bits sent and \(B\) is the bandwidth of the received signal. This is the average instantaneous capacity for an AWGN channel with SNR.  
The distance \(D\) (\(I,Q_{R}\)) between the two vectors \(I\) and \(Q_{R}\) is defined as their usual vector distance in Euclidean units:  
\[D(I,\,Q_{R})=\sqrt{\sum_{i=1}^{k}\left(I_{k}-Q_{R}\right)^{2}}. \tag{13}\]  
Finally, based on the \(k\)th minimum distance, the nearest neighbors are determined in order to sort the distance. A neighbor has the minimum distance, which can be used to predict the active users. Hence, we collected the number of nearest neighbors as the active users. The predicted users (a right bit belongs to a specific user) are finally taken as the active users and the receiver antennae receive the \(k\) number of active users. After this, the received bits are given to the Turbo MUD/decoder, which mitigates the effect of both noise and MAI.