# Satellite-Based Wireless Sensor Development and Deployment Studies for Surface Wave Testing
## 3 Software Architecture  
The success of a wireless sensing solution for surface wave testing relies on processing of data transmitted from the satellite device and the implementation of a cloud-based database for the storage. In response to the aforementioned need, the software architecture embedded into the Raspberry Pi 3 Model B+ was designed to push the acquired data to a server as time series. Pre-programmed codes on the computational core commanded the satellite device to send encrypted data acquired by the sensor in the form of SBD via satellite communication. The software architecture utilized RockBLOCK's commercial cloud-based server, which is ideally suitable for storage, analytics, and management of data acquired from the wireless sensing nodes. As we can see in Figure 2, each user maintained a client identified by an assigned account and identifier key that were used for accessing messages in the commercial database. Data written from each satellite device was tagged with a unique registration that was used to record the data to a corresponding data port. All data were recorded according to the universal time coordinated (UTC) clock and could be analyzed or processed based on user-defined algorithms for further analytics and decision-making. A pre-trigger strategy was employed to record the entire waveforms caused by the impact of surface wave testing. Based on the UCT tags of each encrypted SBD, uploaded data could be synchronized for surface wave analysis. The whole codes for the actions of acquiring measured ground motion from the accelerometer sensor, encrypting data to SBD message, and transmitting SBD to satellite device were embedded onto Raspberry Pi's CPU programmed by the Python language. Meanwhile, considering the transmitting limit of SBD (340 bytes for outgoing and 270 bytes for incoming), a data-compressive method was designed to shorten the transmitting lengths of measurements. The compressive sensing (CS) methodology proposed by [PERSON] [20] and [PERSON] [21] in 2006 was employed in this research for encrypting and decrypting the acceleration data. Here is a brief summary of CS theory:  
Any compressible data defined by a sparse vector can be approximately recovered by convex optimization from random linear measurements that are considerably lesser than the original length. \[\mathbf{y}=\mathbf{\Phi}\mathbf{x}=\mathbf{\Phi}\mathbf{\Psi}\boldsymbol{ \alpha}+\boldsymbol{n}=\mathbf{\Theta}\boldsymbol{\alpha}+\boldsymbol{n}, \tag{1}\]  
where \(\mathbf{y}\in\mathbb{R}^{M}\) is the linear measurements, \(\mathbf{x}\in\mathbb{R}^{N}\) is the compressible data, \(\boldsymbol{\alpha}\in\mathbb{R}^{N}\) is the \(K\)-sparse (\(K\)-nonzero elements) vector representing the original signal \(\mathbf{x}\), \(\mathbf{\Psi}\in\mathbb{R}^{N\times N}\) is a specific basis matrix which transfers signal \(\mathbf{x}\) to sparse vector \(\boldsymbol{\alpha}\) in a specific domain. \(\mathbf{\Phi}\in\mathbb{R}^{m\times N}\) is the random linear measurement matrix (\(K<m\ll N\)), \(\mathbf{\Theta}=\mathbf{\Phi}\mathbf{\Psi}\) represents the transfer matrix from \(\boldsymbol{\alpha}\) to \(\mathbf{y}\). \(\boldsymbol{n}\) denotes the measuring noise and error. It is highly possible to recover the raw data with the random measurement matrix which is in coherence with the original data ensuring the information is distributed and carried by all the new components without bias. When the measurements number, \(m\), is larger than \(\mu\cdot K\cdot\log(N/K)\) (where \(\mu\) is a constant, \(\mu\approx 4\)), this ill-posed problem can be recovered with high-probability by optimizing the convex problem represented in Equation (2):  
\[\min\lVert\boldsymbol{\alpha}\rVert_{1}\text{ subject to }\big{\lVert} \mathbf{\Theta}\boldsymbol{\alpha}-\mathbf{y}\big{\rVert}_{2}<\varepsilon, \tag{2}\]  
Figure 2: Schematic diagram of software architecture. SBD—short burst data.