## 2 Data Transmission in a Wireless Seizure Detection System
### Transmission of Compressed EEG  
One possible alternative to transmitting the entire EEG signals is to compress the raw EEG data before their transmission. Data compression reduces the number of bits by exploring the redundancy in the signals. A rich body of EEG compression algorithms has been proposed in the literature [11]. They vary in the lossiness, spatial or temporal redundancy being explored and the transformation used. While many of these algorithms are able to achieve high compression ratios (CRs), a crucial factor in our study is their computational complexity. The power consumed by the microcontroller to perform one of these algorithms can potentially outstrip the power saved by reducing the amount of data transmission. Recently, the application of compressive sensing (CS) on EEG compression has shown great promise in wireless sensor networks (WSNs). The idea of CS is to exploit the redundancy (_i.e._, compressibility or sparsity) of an input signal using random sampling techniques, such that the signal can be reconstructed from fewer samples than required by the Nyquist rate. The so-called _analog CS_ combines the sampling and compression steps in the analog sensor read-out electronics, allowing the signal be to sampled directly in a compressed form. This, in turn, allows for a significant reduction in the power consumption of the analog-to-digital conversion (ADC) module and microcontroller [12, 13]. Analog CS is particularly beneficial for WSNs involving high-throughput modalities, such as EEG, electromyography (EMG), _etc._  
In this work, we focus our attention on _digital CS_, where CS compression is applied after ADC, as this approach can be easily adopted by most existing sensor platforms. In digital CS, the compression phase of CS involves only a matrix multiplication operation, while the bulk of the computational load is shifted to the reconstruction phase, which is performed on the data server [14]. The way CS works is as follows. Consider a signal, \(\mathbf{x}\in\mathds{R}^{N\times 1}\), that is sparse in some domain, _i.e._, one can find a basis matrix, \(\mathbf{\Psi}\in\mathds{R}^{N\times N}\), so that \(\mathbf{x}\) can be represented as \(\mathbf{x}=\mathbf{\Psi}\mathbf{s}\), with \(\mathbf{s}\in\mathds{R}^{N\times 1}\) being a sparse vector. Suppose that \(\mathbf{x}\) can be related to another signal, \(\mathbf{y}\): \(\mathbf{y}=\mathbf{\Phi}\mathbf{x}\), where \(\mathbf{\Phi}\in\mathds{R}^{M\times N}\) is called the measurement matrix and \(\mathbf{y}\in\mathds{R}^{M\times 1}\) is the compressive measurements of \(\mathbf{x}\). Compression is achieved if \(M<N\). By correctly selecting \(\mathbf{\Phi}\), the compressive measurements, \(\mathbf{y}\), would be sufficient to represent the original signal, \(\mathbf{x}\), and allow exact reconstruction, even if \(M\) is small. In practice, \(\mathbf{\Phi}\) is chosen, such that its coherence with \(\mathbf{\Psi}\) is small, _i.e._, the elements of \(\mathbf{\Phi}\) and \(\mathbf{\Psi}\) have low correlation. Several choices for \(\mathbf{\Phi}\) are available. In this study, a sparse random binary measurement matrix (_i.e._, each column has exactly \(d\) nonzero entries equal to one, with \(d<<N\), and the positions of the \(d\) nonzero entries are randomly chosen) was used. This allows us to simplify the matrix multiplication operation in \(\mathbf{\Phi}\mathbf{x}\) to a series of addition operations, which can be efficiently realized on the sensor node with accumulator registers. The CS implementation used in this study was developed by [PERSON] _et al._ using a block sparse Bayesian learning (BSBL) framework. Details on the algorithm and its application to EEG signals can be found in [15]. To avoid on-board generation of random numbers, the sparse random binary measurement matrix is assumed generated offline with \(d=4\). The indices of the non-zero entries in the measurement matrix are loaded into the flash memory at the start-up of the sensor node.