*2.1. User-Clustering*

We assume that all users in the downlink MIMO cellular system can utilize NOMA-based resource allocation. Users need to be grouped first and the grouped users share a set of codes in the same group by the precoding matrix. Low channel gain users of NOMA clusters are often subject to higher intra-cluster interference [22].

In this paper, we propose the following two methods for user clustering:

(1) The user clustering method based on channel gain. As mentioned in [23], the cluster head user with the highest channel gain can eliminate intra-cluster interference, thereby obtaining the maximum throughput gain. Therefore, the keys to maximize overall system capacity is to ensure that high channel gain users are selected as cluster heads for different MIMO-NOMA clusters in one unit. To improve system performance, we grouped users by assigning the user with largest channel gain as cluster head. As shown in Figure 2, the number of user groups *M* is equal to the number of beams *G*. In this way, users in the same group will suffer higher channel correlation, which is beneficial to eliminate interference between users. The lower equivalent channel correlation of users in different beams is beneficial to eliminate inter-beam interference, which improves the multiplexing gain. The proposed solution is described in Algorithm 1.


**Figure 2.** User clustering based on channel gain.

(2) The user clustering method based on antenna grouping. We consider the downlink MIMO-NOMA system, the number of users *K* is larger than the number of beams *G*. We provide a low complexity MIMO-NOMA user clustering algorithm, where the number of clusters *G* is equal to the number of RF chains *NRF.* As shown in Figure 3, the antennas at the BS are sequentially grouped into *G* groups, there are *Nt* antennas in each group. We first select the user with the largest channel gain corresponding to each antenna group as the cluster head and find the correlation between the remaining users and each cluster head user. Then, we match the user with high channel correlation to the selected cluster head user. The proposed solution is described in Algorithm 2.

**Figure 3.** User clustering based on fixed antenna grouping.

**Algorithm 2**: User Clustering based on Fixed Antenna Grouping (UC\_FAG)
