# Data Gathering Techniques in WSN: A Cross-Layer View
## 3 Compressed Sensing
Particularly, CDG suggests that rather than forwarding individual sensor readings, each sensor uses each of its reports (measurements) to construct and send \(M\) different messages, each comprising a weighted sum of the sensor's own report with other sensors' reports traversing it (relaying). Formally, denote by vector \(\boldsymbol{d}\,=\,[d_{1},d_{2},\ldots,d_{N}]^{T}\) the measurements (readings) obtained by all the sensors, where \(N\) is the number of nodes in the WSN and \(d_{i}\) denotes the measurement (reading) obtained by sensor \(s_{i}\). The sink obtains \(M\) messages (weighted sums) represented by the vector \(\boldsymbol{y}=\Phi d=\boldsymbol{\phi_{1}}d_{1},\boldsymbol{\phi_{2}}d_{2}, \ldots,\boldsymbol{\phi_{N}}d_{N}\), where \(\Phi\) is an \(M\times N\)\((M<<N)\) matrix comprising the series of coefficients generated by the sensors, and in particular, \(\boldsymbol{\phi_{i}}\) is the \(i\)-th column vector of \(\Phi\), which denotes the random coefficients selected by sensor \(i\). [PERSON] et al. [61] suggest that the measurement matrix (coefficients matrix) \(\Phi\) should be a full random matrix with its entries being _i.i.d._ Gaussian random numbers drawn according to \(\mathcal{N}(0,\frac{1}{M})\). The paper suggests that each weighted sum coefficient be chosen pseudo-randomly based on each sensor's ID in order to avoid the burden and high overhead required to collect these coefficients by the sink if they are chosen randomly. Ref. [62] extends the random coefficient selection suggested in [61] to an only partly random matrix in which the entries of a sub-matrix are still drawn according to \(\mathcal{N}(0,\frac{1}{M})\). Yet, for the rest of the matrix, two options are suggested, either an upper triangular matrix with non-zero entries drawn according to \(\mathcal{N}(0,\frac{1}{M})\), or the identity matrix. CDG exploits the compressive sampling theory and shows that when the sensor readings are compressible, the sink will be able to accurately recover the reports even when the number of weighted sums (messages) each sensor generates for each report (\(M\)) is much lower than the number of reporting sensors (\(N\)). For example, on a route comprising \(N\) sensors, the sink needs to collect only \(M<<N\) messages to encode the information sent by all the \(N\) sensors. Several studies further explore the sparsity of the sensed signal and its projection matrix, as well as the number of messages (\(M\)) that should be delivered to the sink. For example, [PERSON] et al. [63] argue that most natural signals are nonstationary and ordinarily variable in the temporal and spatial domains. In CS, these directly influence the reconstruction process and the number of required measurements; consequently, setting a fixed number of measurements with a fixed transform basis (coefficient matrix \(\Phi\)) can result in poor performance (inaccurate measurement reconstruction). Accordingly, [PERSON]. [63] suggests an adaptive data-gathering scheme based on CS, which utilizes an autoregressive (AR) model to exploit the local spatial correlation between sensed data of neighboring sensor nodes. The suggested reconstruction scheme adapts to the variation of sensed data by adjusting the AR parameters. The number of measurements is adjusted adaptively with the sensed data by evaluating the recovery result and approximating the number of measurements required to satisfy the accuracy demand. To reduce the transmission overhead, [PERSON] et al. [64] propose the compressed sparse function (CSF) scheme. The basic concept of CSF is, rather than encode the sensed data by projecting it on a basis on which it can be represented sparsely, as in typical CS-based schemes, to compress the sensed data in the form of sparse functions, which are sent to the source. The source can recover the function using techniques from polynomial approximation/interpolation theory and use them to compute data values that were not reported.