## 3 SWIFTNET: Protocol for Fast-Reactive Monitoring
### Our Design of Measurement and Representation Basis
#### 3.3.1 Measurement Matrix and Sparse Representation  
Recall from Section 3.1, that one of the aims is to find a sensing matrix with the property that column vectors taken from arbitrary subsets are nearly orthogonal. Hence, the larger these subsets are, the better will be the reconstruction. In general, random matrices are largely incoherent with any fixed basis \(\Psi\). For example, it is proven by [41] that if we select an orthobasis \(\Phi\) uniformly at random, which can be done by orthonormalizing \(n\) vectors sampled independently and uniformly on the unit sphere, then with a high probability, the coherence between \(\Phi\) and \(\Psi\) is about \(\sqrt{2\text{ log }n}\). To achieve this, we used the Linear Feedback Shift Register popularly known as LFSR in the field of electronics. An LFSR is a shift register that is capable of generating pseudo-random numbers, which when clocked advances the signal through the register from one bit to the next most significant bit. Linear feedbackshift registers make extremely good pseudo-random pattern generators (PRNG). An LFSR can be formed by performing an exclusive-or (XOR) on two or more of the flip-flop outputs, and feeding them back as inputs into one of the flip-flops shown in Figure 3. This figure shows a 16-bit LFSR, the bit positions that affects the next state are called taps. From this figure the taps are \([16,14,13,11]\), the rightmost bit of the LFSR is the output bit. One way of implementing LFSRs is to have the taps XORed sequentially and then fed back into the leftmost bit. This way the XOR is external from the shift register. Another way of implementing the LFSR is by making the XOR internal to the register. In our implementation, we have utilized the external XOR method with a 16-bit feedback polynomial of maximal period 65,535 (_i.e._, \(2^{n}-1\), with \(n\) = 16). The output is initially loaded with a seed value (in our case 0 xACE1u), also known as the initial state, and when the register is clocked, it will generate a random pattern of 0 s and 1 s.  
A previous study in [25] conducted a performance evaluation of the different measurement matrices for signal recovery using CS. Instead, our method addresses the practicability of using one of these matrices on a 32-bit architecture with minimal energy requirement. It implies that, given any measurement matrix with a proper representation basis, we are able to design a reactive algorithm that achieves a minimum energy consumption, without losing any interesting event in the monitored environment. One of the key design choices requires that the chosen matrix should be easily implemented on the W24 TH node prototype without incurring huge computational overhead and memory usage. As explained under the CS theory, recovering sparse signals requires random matrices. Recall from Section 3.1.2 that one of the potential methods that obeys the RIP condition is to generate a matrix of uniform distribution. The generation of these random matrices requires producing a sequence of random numbers and storing them into arrays of size \(M\times N\). The LFSR is a potential solution for this since uniform random numbers can be easily generated with low complexity, considering the limited memory capacity of the 32-bit WISPES W24 TH node platform. In previous study by [50] (pp. 8-11), it was shown that it is possible to generate deterministic sensing matrices from an additive character sequence using an LFSR. Their results revealed that the sensing matrix generated using the LFSR has better eigenvalues statistics than the Gaussian random matrices, hence more suitable for CS matrices. Similarly, the study by [51] revealed that LFSR is suitable for generating uniform random numbers and they further showed some hardware implementations of the LFSR. In [52] (p. 4064) an LFSR was used to generate a Toeplitz matrix for a special-purpose light sensor application, for which the output is fed into an accumulator. The output is then sampled in a pseudo-random fashion, and it was shown to meet the requirement of a CS matrix.