# Robust Wireless Local Area Networks Based on Compressed Sensing
## 3 Proposed Algorithms
### RTNTC Algorithm  
The proposed clustering techniques can be applied to packets from different wireless nodes that are quantitative, qualitative, or a mixture of both. In this algorithm, a cluster is a collection of packet objects that are similar to one another within the same cluster and dissimilar to the objects in other clusters. The proposed clustering algorithm can also be applied to large datasets of different wireless communication systems. The grouping is done by minimizing the sum of squares of distances between wireless nodes and the corresponding cluster centroid [32]. The proposed algorithm has the following advantages: (1) perform online clustering and classification; (2) establish strong background to expend the current WLANs to ultra-low-power WLANs. The proposed algorithm is defined based on the following assumptions: (1) total of N wireless nodes; (2) denote K as the number of random sparse  
Figure 1: The proposed RTNTM algorithm. wireless nodes; (3) K is a random number and is much smaller than N; (4) denote [D]\({}_{\text{N}\times 1}\) as the packet vector in the WLAN; (5) assign each component of [D]\({}_{\text{N}\times 1}\) like a random value; (6) [D]\({}_{\text{N}\times 1}\) is a sparse vector since K \(\leq\) M\(<<\) N; (7) there are \(M\) active monitoring wireless nodes trying to capture K events. Any WLAN signal D can be expressed as [32]:  
\[\text{D}=\sum_{\text{i}=1}^{\text{N}}\text{S}_{\text{i}}\Psi_{\text{i}}, \tag{4}\]  
where S is the coefficient vector for D under the basis \(\Psi=[\Psi_{1},\Psi_{2},\cdots,\Psi_{N}]\). If D has the most compact representation in \(\Psi\), then D should be compressed if acquired on the proper basis. The CS theory also proposes that rather than acquire the entire signal and then compress, it should be possible to capture the signal's useful information. Then, we can determine the compressed WLAN's signal W from the random matrix \(\Phi\) based on the following equation [32]:  
\[[\text{W}]_{\text{M}\times 1}=[\Phi]_{\text{M}\times\text{N}}\ [\text{D}]_{ \text{N}\times 1} \tag{5}\]  
The matrix \([\Phi]\) must satisfy the Restricted Isometry Property (RIP) with the following conditions [32]:  
\[1-\varepsilon\leq\left\|\Phi\alpha\right\|_{2}\leq 1+\varepsilon; \tag{6}\]  
Then, we apply the following steps: (1) Apply segmentation algorithm to the WLAN in order to define the required number of classes. The number of classes is calculated based on the following equaltion [32]:  
\[\text{M}\leq\frac{\text{K}}{\text{C}(\text{LogN})},\quad\text{with C between 3-18} \tag{7}\]  
which M is the number of classes and N is the number of wireless nodes in the WLAN. (2) Collect QoS vector for each class; (3) Generate compressed [QoS]\({}_{\text{M}\times\text{N}}\) matrix; (4) Check the performance of the compressed [QoS]\({}_{\text{M}\times\text{N}}\) matrix based on the following condition [33]:  
\[(1-\text{C})\parallel[\text{QoS}]_{\text{M}\times\text{N}}Y\parallel_{2} \leq(1+\text{C})\parallel Y\parallel_{2} \tag{8}\]  
where Y is a random vector of [QoS]\({}_{\text{M}\times\text{N}}\). If [QoS]\({}_{\text{M}\times\text{N}}\) matrix satisfies the condition (5) we can go the next step. Otherwise, we need to improve the quality of [QoS]\({}_{\text{M}\times\text{N}}\) matrix; (5) Calculate the Classification Matrix (CM), and identify the number of classes. This matrix sorts all cases from the wireless nodes into different categories, by determining whether the predicted value (M) matched the actual value. All the cases in each category are then counted, and the totals are displayed in the CM matrix. The classification matrix in WLANs is a standard tool for evaluation of statistical models and is sometimes referred to as a confusion matrix of a WLAN. In addition, the CA is an important tool for assessing the performance of the WLANs.