Using of compressed sensing in energy sensitive WSN applications

The paper is focused on the use of methods of compressed sensing (CS) in energy efficient monitoring of signals. CS allows to minimize the number of data that need to be transmitted to the sink node in the WSN environment. As a case study, we use compressed sensing for monitoring of mains voltage deformation. In this case we can assume that the measured signal is sparse in frequency domain and using of methods of compressed sensing is meaningful. Computational complexity imposed on the sensor node is minimized. On the other hand, reconstruction of the original signal in the sink node requires relatively high computing power.


I. INTRODUCTION
NTERNET is undergoing a third stage of development nowadays.Since 1995, the Internet has evolved from interconnecting desktops and later mobile devices (tablets, smart phones), via networking of all devices (Internet of Things) to the Internet of Everything -IoE (networking of things, people, data and processes).According to estimate of Cisco [1] there are about 200 things for every one person on the Earth that can be connected to the data network.It follows that in the near future we can see the network containing up to 1.5 x 10 12 elements.Meaningful use of such a network is a huge challenge for the visionaries and theorists, but also for programmers, workers in the field of transmission technology and developers and technical resources.According to [2] we expect that in the next five years, the number of connected devices will increase from the current value of 12 x 10 10 to about 35 x 10 10 , Fig. 1.

I
In the IoE raises huge space for development and implementation of new applications of Wireless Sensor Netvorks (WSN).Recall that WSN consists of spatially distributed autonomous sensing elements that work together.They are distributed in the monitoring area and continuously evaluate the status of the monitored object.The term object here is understood in its broadest sense and may represent guarded area, production line or living being.Based on this definition the WSN represents a natural part of a global network IoE.The above projections indicate that in the near future we will see the growing number of WSN applications.
It is natural that during development of successful applications of WSN we are facing many constraints.Some of these constraints arise from the relationship of the society to the new information technologies (fear of loss of privacy, inability to effectively utilize the benefits of the system and many others).These limits are not analyzed in this paper.Let us mention technical limitations that determine the extent and success of WSN applications: • limited energy resources of WSN elements, • limited processing power, storage capacity, communication speed and range of broadcast modules of network elements, • limited size of individual elements, • limited (or even excluded) maintenance of the network elements during their lifetime, • constraints imposed by the requirements for working conditions of WSN components, • price limits for a single network element and the like.
Many of these limits are becoming less important with the continuous development of new electronic components and technologies.Others, however, will permanently restrict the The problem of efficient powering of network elements can be addressed in the following ways:

Using of compressed sensing in energy sensitive WSN applications
• consistent use of energy harvesting (EH) exploiting resources that are available in the application [3], • appropriate design of network topology with minimal demands on communication, optimal distribution of network tasks, dynamic reconfiguration of the network with respect to the current state of energy resources of individual elements, etc., • reducing consumption of sensor nodes that can be achieved by combining two approaches: • using only low-power elements in the process of sensor node development, • choosing of such a mode of operation of sensor node that minimizes energy consumption.Energy harvesting systems used for powering of network elements are usually designed so that they can ensure continued operation of the nodes.The term Zero Power Wireless Sensor [4] indicate precisely those solutions that do not need a power source for their operation, but are able to drain the necessary energy from the environment.The construction of sensor nodes is based on modern circuit with reduced consumption.During the operation the sensor nodes use sleep modes with reduced consumption and the sensor wakes up to the active state only when it is necessary.The wake up event is usually based on external conditions.Such systems are referred to as "event-driven".The node is brought into active mode only under specified conditions (e.g.change of the observed variables by defined amount, the achievement of pre-defined state of the object, etc.).In many cases (e.g. by monitoring of non-stationary processes) is such system more energy efficient when compared to conventional "Time-driven" systems.
However, there is a group of systems that strictly speaking cannot be classified into any of the above mentioned classes.It is a class of systems that use for collection, transmission and processing of information methods known under the name compressed sensing.The next section describes the basic theoretical background of compressed sensing.

II. COMPRESSED SENSING
The basis of the theory of digital processing of continuous signals is Shannon's theorem, which says that a perfect reconstruction of the sampled signal is only possible if the sampling frequency is at least twice the maximum frequency component contained in the original signal.The theorem is universally applicable, however, in some cases the strict requirement for the sampling rate can be substantially released.Recent research [5], [6] has shown that this is possible particularly in the case if the sampled signal is in some domain sparse.Sparse means that relatively few coefficients describing the signal in the domain are non-zero.
Let y be a one-dimensional discrete signal comprising of n elements.Next, let x be the representation of the signal y in some domain (e.g.Fourier or wavelet).For linear transformation it holds that x = Fy and y = Yx where F and Y and are square n x n matrices representing the direct and inverse transformation and are composed from linearly independent base vectors (usually orthonormal).
We say that the signal x is s-sparse (for 1 ≤ s ≤ n) if it has at most s non-zero coefficients.Intuitively, if the signal is ssparse, it should have only s degrees of freedom.In that case one needs substantially only s measurements for the reconstruction of the original signal.This is the basic idea of the compressed sensing -the number of measurements that is required for the perfect reconstruction of the original signal is directly proportional to its sparsity.
Let's show how it is possible to reconstruct the original signal y, if we have only m-dimensional vector of measurements b, while s ≤ m < n.The challenge is to find a solution to the equation Ax = b, where A has dimensions m x n and is referred to as a measurement matrix.If m < n, the problem is underdetermined and generally it has infinitely many solutions.Provided that any subset of 2s columns of the matrix A are linearly independent, the solution of the defined problem is the sparsest vector x: min x ∥x∥ 0 subject to Ax=b ( where denotes the sparsity of the vector x. Unfortunately, l 0 minimization is, in general, NP hard problem as it requires a search of all ( s n ) possible solutions.The problem is that the l 0 minimization is not a convex optimization problem, and therefore one cannot use the appropriate optimization algorithms.Replacing l 0 minimization by l 2 minimization (least squares problem) yields not satisfactory results.A more accurate estimate of the solution x e can be obtained by l 0 minimization: where It is much easier to verify the second sufficient condition based on mutual coherence μ(A).Mutual coherence is defined as the cosine of the smallest angle between any two columns of matrix A. Mutual coherence has to be as small as possible (cosine is close to zero for angles close to 90 °, which means that the columns are independent).Incoherence of the matrix A indicates that if the signal is sparse in one domain, it has to be spread out in the other domain (the one in which it is sampled).In practice, this means that columns of the matrix A are roughly uniform in magnitude.
Both sufficient conditions essentially require independence of columns of the matrix A. Interconnection of RIP and mutual coherence has been shown in [11].For an orthogonal square matrix it holds that both d S and µ(A) equal to zero.However, for m x n matrix (m < n) it is not possible to ensure the complete independence of columns, we just require them to be roughly orthogonal.
Simulation experiments in [18] have shown that there is rather universal dependence between the ratios m/n and s/m.This dependence can be used for selection of appropriate number of samples m if the sparsity s of the signal is known.Practical experiments indicate that most s-sparse signals can be perfectly reconstructed if m is in range from 3s to 5s [13].
We have shown that CS is applicable for the reconstruction of sparse undersampled signals.However, to be useful in practice, it is necessary for CS to cope with both nearly sparse signals and with noise.In other words, CS must be robust.Most real signals are not strictly sparse and measurements are corrupted with at least quantization noise, as the sensors do not have infinite precision.In this case, it is necessary to find solution to the equation: where e is a random variable.
If the sensed signal is not strictly s-sparse, we require it to be at least s-compressible.S-compressible signal has at most s significant coefficients and all the other coefficients are close to zero.In other words, if the coefficients are sorted by value, all coefficients, except for the first s, are smaller than some small nonzero constant.Thus, the majority of the signal's information content is concentrated in only a few coefficients.Typical examples of the compressible objects are images when expressed in appropriate base (e.g.wavelet).This feature of natural images has been used in compression algorithms such as JPEG2000 for years.We can say that many images are efficiently sparse in wavelet base.
To reconstruct the original signal in case of noisy measurements one can use l 1 minimization with relaxed conditions: This is a linear programming optimization problem with quadratic conditions (Basis Pursuit Denoising -BPDN).The problem can be reformulated as quadratic programming problem with linear conditions (known as LASSO): For appropriately selected parameter l the problem (5) can be expressed without conditions: Several types of algorithms can be used to reconstruct the original signals.Methods based on a convex optimization are computationally demanding.This category includes Basis Pursuit (BP), Basis Pursuit Denoising (BPDN), interior point methods [17] and projected gradient methods.This category is sometimes supplemented by Iterative Shrinkage algorithms such as Iterative Hard Thresholding (IHT).
The second group of algorithms consists of greedy algorithms that are looking for non-zero coefficients incrementally, starting with the most significant.Among greedy algorithms belong mainly Matching Pursuit (MP) [14] and its variations: Orthogonal Matching Pursuit (OMP) [8], regularized OMP (ROMP), Stagewise OMP (StOMP), OMP with Replacement (OMPR) and also the first sub-linear algorithm OMPR-Hash.This category includes also Subspace Pursuit (SP) [16] and Least Angle Regression(LARS) [15].Some of greedy algorithms are capable of providing similar guarantees of stability as BPDN while they are faster.Also they have the advantage of being easier to understand.
There are also combinatorial algorithms (e.g.HHS pursuit), which are very fast, but they require a lot of measurements.
Special types of algorithms are Total Variation (TV) algorithms.These are used mainly in the reconstruction of images where one may require sparsity of the gradient of the image.TV algorithms are particularly suitable for images composed from smooth areas separated by curves (objects without complex textures).Such images are common in medicine (MRI, angiogram, and the like).
Compressed sensing can be used if: • the signal is sparse in any known base, • measurements or calculations at the sensor are expensive in some sense, • calculations at the receiver are cheap.The application area of compressed sensing is very broad: MRI, astronomy, WSN, communication [10] and so on.The use of CS in wireless sensor networks is particularly useful.Compressed sensing allows to substantially simplify sensor nodes.The use of compressed sensing saves limited energy resources at several levels: • Signal sampling -the number of AD conversions required is a fraction compared to the conventional sampling using Nyquist frequency.• Preprocessing of the signal -transfer of all acquired samples is usually undesirable.It is necessary to reduce the amount of data to be transmitted by a communication channel.Signal preprocessing algorithms often involve computationally intensive transformations such as Discrete Fourier transformation.Compressed sensing does not require pre-processing at all.• Data transfer -energy is saved especially if we need to transfer the whole measured signal to the central node.Transmission of data is typically the most energy intensive operation in the processing of distributed data.Transmission of a smaller number of data has a positive effect on energy balance of the node and also on the throughput of the entire network.From the perspective of information processing the block structure of the node only consist of two parts: sensing and transmission.Simplification of the node and a reduction of its consumption significantly increases its reliability and extends its lifetime.
Note that the sampling process can be done in several ways.We can use random sampling, but then we must transmit pairs of numbers (sample-time).The major advantage of the compressed sensing is then deteriorated.The second possibility is to use a pseudo-random sampling when the signal is sampled according to a predetermined scheme, which, of course, has to be known in the central node, in which the original signal is recovered.
Pseudo-random sampling is advantageous also because it is possible to fit it for a specific application.The sensing matrix can be defined in order to meet all the prerequisites needed for perfect signal reconstruction.The compressed sensing can be realized also in such a way that the signal is captured at a Nyquist rate and then a subset of the samples corresponding to the sensing matrix is picked out.In this case there is no energy saving during sampling but only in blocks of preprocessing and transmission.The development of sensors that allow sensing of physical quantities using the principles of compressed sensing is one of intensively researched areas.Successful penetration of CS into WSN depends mainly on the availability of suitable (cheap and energy-efficient) sensing elements.

III. EXAMPLE OF USING CS IN WSN
One of the cases where it is possible to effectively use the compressed sensing is the monitoring of power quality.To provide high quality electric power service, it is essential to monitor number of parameters at different places in the network.Among the monitored parameters belong current and voltage RMS, phase relationship between waveforms of a multi-phase signal, power factor, frequency, total harmonic distortion, different kinds of power and many more.In this example we will focus on measuring of total harmonic distortion (THD).
THD can be calculated using following equation: where V i is the RMS voltage of i-th harmonic and i = 1 is index of the fundamental frequency component.As indicated by (8), we need to know the frequency spectrum of the measured signal in order to calculate the THD.The second option is to use filters to obtain the fundamental component and all other components [19].In both cases it is necessary to make quite a number of calculations on the sensor side.
THD monitoring is now more important than ever, given the increasing use of switching power supplies to power consumer electronics.Switching power supplies are causing clipping of supply voltage.Fig. 2 shows a clipped sine wave and its spectrum.The frequency of the sine wave is 50 Hz and the amplitude is clipped to 0.9.The more clipped is the sine wave, the more energy is concentrated in the higher harmonics and the greater is the value of THD.If both half-waves are clipped, non-zero coefficients correspond to odd order harmonics.Clipping only one half of the sinusoid causes a doubling of the number of harmonics (all the harmonics are non-zero).However, this case is not common in practice.The number of non-zero coefficients in the spectrum of clipped sinusoid is theoretically infinite and must be reduced to make calculation feasible.This truncation causes some error, but it is relatively small and it can be neglected.For example, the THD of the example signal is 4.6416 % taking into account only the first ten non-zero coefficients or it is 4.6444 % if the number of non-zero coefficients is one hundred.
Since the representation of the clipped sine wave is sparse in the frequency domain, it is possible to engage principles of the compressed sensing.Compressed sensing allows reducing the cost of the sensor element but, on the other hand, increases the demand for the computing power of the central network node.
To verify the possibility of using compressed sensing in this case we conducted simulation experiments.For the calculation of THD we used first 20 higher harmonics (i.e.first 10 non-zero coefficients).The fundamental frequency equals to line frequency: 50 Hz.The 20-th harmonic then corresponds to 1 000 Hz.According to the Shanon theorem, the signal must be sampled by frequency of at least 2 000 Hz. Suppose that the mains voltage is stationary within an interval of 200 ms (i.e. the statistical properties of the voltage are constant for a short period of time).In this example, we monitor the mains voltage within time windows of a length of 200 ms, which corresponds to the number of samples n = 400.Random sampling was realized by random selection of m-samples such that the mean period between two samples equals to n/m.Input signal is a sine wave with a frequency of 50 Hz and amplitude clipped to 0.9: x(t)= 0.9 , sin (2π ft )⩾0.9 sin (2π ft ) , |sin (2 π ft)|<0.9−0.9 , sin ( 2π ft )⩽−0.9 Using Monte Carlo method, we performed simulations for different values of m and different values of signal to noise ratio (SNR).For each pair {m, SNR} we conducted 100 simulations.The simulation consists of a reconstruction of the original signal in the frequency domain and the subsequent calculation of THD using (8).For the reconstruction of signal we used collection of MATLAB routines l1-magic [20].The resulting THD value is calculated as the arithmetic average of the 100 values.Fig. 3 shows the result of simulations.The THD of the original noise-free signal is 4.32 %.
Reconstruction of the original signal took from 1 to 5 seconds on dual core 2.6 GHz Athlon 64 processor.The duration of simulation depends on the length of the original signal n, the number of samples m as well as their distribution.
The results show that decreasing the number of samples and/or increasing the SNR deteriorate the accuracy of the reconstruction of the signal and thus the accuracy of the calculated THD.The simulations suggest that good results can be obtained when the number of samples m is at least 80 and the SNR is greater than 30 dB.In that case the compression ratio would be 1:5.If the mains voltage is stationary over longer periods, it is possible to achieve even higher compression ratios.If we increase the length of the time window to 400 ms (n = 800), it is possible to achieve even better results using the same compression ratio m/n.The effect of increasing the number of samples n is shown in table 1.The simmulation was done with noise-free sinusoid.We see that doubling the length of the window allows to reduce the ratio m/n from 0.2 to 0.15.Knowledge of the parameters of measured signal is therefore essential in optimal design of compressed sensing parameters.

IV. CONCLUSION
Simulation experiments demonstrate a possibility to use compressed sensing in appropriately selected applications of WSN.Energy savings due to the use of compressed sampling In the future, we will focus on design of deterministic sensing matrices suitable for compressed sensing of selected signal classes.It is also necessary to develop fast algorithms for reconstruction of the original signals so they can be used even in less powerful network nodes.

Fig 2 .
Fig 2. Clipped sine wave and its spectrum

Fig 3 .
Fig 3. THD as a function of m and SNR

Smartphones Tablets Smart TVs Wearables Connected Cars Internet of Things development
Ondrej Karpiš, Juraj Miček, Veronika Olešnaníková of new applications.One of such limitations that must be respected in the development of applications is the limited capacity of energy resources.Note that limited energy consumption of WSN node affects other technical parameters -computing power, communication speed and range, and so on.
[12]valence of l 0 and l 1 minimization is guaranteed if either of the following sufficient conditions is met.The first condition is a requirement that the matrix A approximately maintains the Euclidean length of the s-sparse signals.This characteristic of the matrix A is called the restricted isometry property (RIP)[9].RIP is related to the isometric constant d s defined We can say that A obeys the RIP of order s if d S is not very close to one.It is met if all the subsets of s columns of the matrix A are approximately orthogonal.However, checking whether the matrix A obeys the RIP is generally NP hard problem.Some matrices are known to obey the RIP with overwhelming probability (e.g.Random Gaussian Matrices, Bernoulli matrices, partial Fourier matrices).There is a prove in[12]that Gaussian and Bernoulli random matrices probably obey the RIP when the number of measurements satisfies the condition m ≥ Cs ln(n/s), where C is some constant dependent on d s .
[7]a means of finding the most sparse solution has been used already in 1973 in reflection seismology[7].The problem (2) is a convex optimization problem, which can be effectively solved using methods of linear programming.It is 1234 PROCEEDINGS OF THE FEDCSIS.Ł ÓD Ź, 2015often referred to as basis pursuit (BP).

TABLE I .
EFFECT OF DIFFERENT WINDOW LENGTHS ON ACCURACY OF THD ESTIMATE