This full text paper was peer-reviewed at the direction of IEEE Instrumentation and Measurement Society prior to the acceptance and publication.
Frequency domain measurement node based on compressive sampling for sensors networks L. Angrisani, F. Bonavolontà, A. Tocchi
Rosario Schiano Lo Moriello
Dip. di Ingegn. Elettrica e delle Tecnologie dell’Informaz., Università di Napoli Federico II, Naples, Italy {angrisan, francesco.bonavolonta, alessandro.tocchi}@unina.it
Dipartimento di Ingegneria Industriale Università di Napoli Federico II Naples, Italy
[email protected]
Abstract— The paper deals with the problem of designing and implementing a measurement node based on compressive sampling (CS). The considered node is tailored for wide area sensors networks aimed to carry out measurements in frequency domain. To this aim, the node takes advantage from some known or recently proposed CS features in such a way as to outperform the nominal specification of its data acquisition module. To make the spectrum estimation feasible on the node level, a suitable strategy for input signal random sampling and an efficient CS implementation, i.e. the greedy algorithms based on the so-called match-pursuit approach, are exploited. First tests are presented, related to a cost-effective microcontroller from STMicrocontroller, namely STM32F429ZI, characterized by a data memory depth sufficient to execute the agile computational scheme of the greedy algorithm. The estimated spectra concur with those obtained through standard discrete Fourier transform-based approaches, thus highlighting the feasibility of the proposed measurement node. Keywords— Sensors Network; Low-cost Node; Measurement in Frequency Domain; Compressive Sampling; Greedy algorithms
I. INTRODUCTION The last decades have seen a remarkable development of Wireless Sensor Networks (WSNs), which allowed improvement of several physical parameters measurements by integrating the information coming from different locations [1]. Within a WSN, the measurement node provides the measure of the physical parameter of interest at measurement location. Potential applications for sensor networks include measurements in frequency domain as Power Quality, Electromagnetic Compatibility, Power Measurement, etc. It turns out to be mandatory to estimate input signal spectrum to carry out the desired measurements [2]. In order to properly compute the spectrum and prevent information loss, the Shannon-Nyquist sampling theorem requires that the sample rate has to be at least twice the maximum frequency component involved in the input signal. This way, high sample rates have to be guaranteed in many applications of interest. As a consequence, the realization of a measurement node that match these specifications can become unfeasible or very expensive. If wide grid have to be monitored, it should be necessary, in fact, to deploy several measurement nodes throughout the area. Moreover, high
978-1-4799-1860-7/15/$31.00 ©2015 IEEE
sample rate can worsens the performance of measurement nodes, in terms of both ADC errors, mainly due to jitter effects, and battery life [3]. To overcome the considered limitations, it is necessary to employ low-cost devices with no detriment of the distributed measurement system performance. Recently, many research activities suggest the possibility to move toward a different architectures exploiting the advantages of an innovative measurement approach: the Compressive Sampling (CS) [4-8]. The CS is a new acquisition paradigm capable of digitizing the input signal directly in a compressed form, acquiring only a reduced number of samples sufficient to successively reconstruct the input signal by means of suitable algorithms [9]. Differently from the traditional acquisition protocols, the CS allows to (i) digitize signals at sampling rates significantly below than those required from Shannon-Nyquist theorem and (ii) reconstructed them at higher rates. If the input signal consists of a periodic function, which can be represented by means the sum of simple sine waves, the CS is able to perform the computation of the spectrum of the input signal directly from the reduced number of digitized samples. It is so possible to carry out measurements in the frequency domain employing low-cost devices; the obtained performance, in term of maximum frequency analyzable and frequency resolution, are similar to high-performance devices. Stemming from the considered approach, the paper deals with the realization of a low-cost measurement node, which exploits the Matching Pursuit (MP) algorithm, tailored for lowperformance devices, to estimate the power spectrum of interest. Since microcontroller devices are "system on chip" having a full cost of few dollars, their use allows to achieve a significant reduction of the realization costs of both the measurement node and whole WSN. The research activity has been focused mainly in the preliminary assessment of the measurement node performance in frequency domain. Results obtained in term of reconstruction error highlights the feasibility of the proposed node for the realization of WSN based on CS. II. THEORETICAL BACKGROUND The traditional sampling protocol, based on the well-known Shannon-Nyquist theorem, requires that the input signal has to
be sampled at a sample rate at least twice its maximum frequency content: 𝑓 = 2∙ 𝑓
(1)
This way, in order to perform alias-free sampling of the input signal, its maximum frequency component has to be known, and the A/D converter characterized by a proper sample rate has to be adopted. Instead, CS approach allows to recover a given N-dimensional signal 𝒙 ∈ 𝑹 from its under-sampled version, in which the number 𝑀 of available measurements is much smaller than the length N of the signal 𝒙 [10]. A CS technique can be divided in two fundamental stages: (i) the input signal is first acquired directly in a compressed way; (ii) the input original signal is correctly reconstructed by means of a suitable CS-Solver [11]. One of the fundamental principles underlying the CS theory is the "sparsity" [12], a characteristic related to the input signal of interest. In particular, the discrete signal 𝒙 has to be projected on an orthonormal basis, 𝜳 ∈ 𝑹 : 𝒙 = 𝜳𝒔
(2)
The vector 𝒔 ∈ 𝑹 is S-sparse, which mean that the cardinality of its support is less or equal S [13]. When a signal has a sparse representation in a certain domain, it is possible to discard the small coefficients without significant loss of its information content. As an example, a sinusoidal signal is characterized by endless evolution versus time, while its Fourier transform provides the same information with only two coefficients different from zero. From a mathematical point of view, time–domain sampling of discrete signals can be expressed as: 𝒚 = 𝜱𝒔 𝒙
(3)
where 𝒚 ∈ 𝑹 is the vector of measurements, and 𝜱𝒔 ∈ 𝑹 is the sampling matrix, that performs a sampling of the input signal x. In traditional sampling approaches, the samples 𝒚 are uniformly acquired in time according to a defined sampling rate, selected according to (1). Thus, the sampling matrix 𝜱𝒔 turns out to be the square identity matrix I of size 𝑁x𝑁: 𝒚 = 𝑰𝒙
(4)
On the contrary, in compressed sampling approach, only the number of samples 𝑀 (with 𝑀 ≪ 𝑁 ) of the signal of interest 𝒙 ∈ 𝑹 sufficient to correctly reconstruct it are acquired. As for (3), the sampling process can be expressed as: 𝒚 = 𝜱𝒙
(5)
where 𝒚 ∈ 𝑹 is the vector of measurements, 𝜱 ∈ 𝑹 , is the rectangular sampling matrix of size 𝑀x𝑁, that highlights the under-sampling of the input signal x. A. Bases pursuit-based compressive sampling As it can be noticed, by combing equations (2) and (3) the following expression is obtained:
𝒚 = 𝜱𝒙 = 𝜱𝜳𝒔
(6)
By introducing the sensing matrix 𝑨 ∈ 𝑹𝑴𝒙𝑵 given from the matrix product 𝜱𝜳, equation (A.5) becomes: 𝒚 = 𝑨𝒔
(7)
This system is ill-posed since the number of equations M is smaller than the number of unknown variables N. Consequently, an infinite number of solutions characterizes the equations system in (7). Evaluate the solution s from the acquired samples y results impossible though the traditional approaches based on the minimum squares techniques. On the contrary, the typical approach to find the sparse solution of (7) is the ℓ1-norm minimization. In fact, the ℓ1-norm minimization approach, as demonstrated in literature, leads to the sparsest solution of an equations system. In particular, by imposing that the desired solution satisfy the system in (7), the following constrained convex optimization problem is obtained: min‖𝐬‖ℓ 𝐬ϵR
subject to
y = 〈φ , Ψs〉 ∀k ϵ M
(8)
whose solution 𝒔 is the best approximation of 𝒔 ∈ 𝑹 . The considered approach is usually referred to as basis pursuit (BP) algorithms. In order to assure a reliable reconstruction of the input signal, “Incoherent Sampling” has to be guaranteed, i.e. a large incoherent level, between the sampling matrix 𝜱 and the orthonormal basis 𝜳, has to be assured. The coherence between the matrices 𝜱 and 𝜳 is defined as the quantity: max μ(𝜱, 𝜳) = √N 1 ≤ k, j ≤ N < 𝝋𝒌 , 𝝍𝒋 >
(9)
where 𝝋𝒌 and 𝝍𝒋 stands respectively for the kth row and the jth column of the matrices 𝜱 and 𝜳, respectively [14]. If 𝜱 and 𝜳 contain uncorrelated elements, the coherence is small. The minimum level of coherence is equal to 1, whereas the maximum level is √𝑁 . In a CS-based approach, the coherence should be as close as possible to 1. Surprisingly, it has been demonstrated that random matrices are largely incoherent with any given orthonormal bases 𝜳. Thus, by selecting a random sampling matrix 𝜱, which can be obtained by randomly deleting N-M rows from the square identity matrix I (obtaining, thus, a rectangular sampling matrix of size MxN), it is possible to obtain a coherence as small as 2 log 𝑁. B. Constraint for a reliable reconstruction Finally, if 𝒙 ∈ 𝑹 is S-sparse in a suitable orthonormal bases 𝜳, the following inequality furnishes the lower limit of the number of samples M of x to be acquired, according to the sparsity of x and the characteristics of the sampling: 𝑀 ≥ 𝐶 ∙ 𝜇 (𝜱, 𝜳) ∙ 𝑆 ∙ log 𝑁
(10)
where M is the number of measurements, C is a positive constant, 𝜇 the coherence, S the sparsity, and N the number of points to be reconstructed. If the inequality (10) is fulfilled, the solution given from (8) is exact with outstanding probability. In other words, equation (10) provides the acquisition constraints for a CS-based sampling approach [15], by fixing the minimum number of samples M which has to be acquired to assure a reliable reconstruction of 𝑥, according to the coherence 𝜇, the sparsity S, and the number N of points to be reconstructed. From a different point of view, it is so possible to consider the CS approach as an efficient technique for directly acquiring a compressed signal representation without going through the intermediate stage of acquiring full-length N samples, as made by others compression algorithms. In particular, CS is capable of recovering the whole signal of interest from a reduced number of randomly acquired samples, in such a way as to obtain a signal very close to that achieved by the traditional sampling approach. As it can be observed, the only required information about the input signal is the sparsity S, i.e. the maximum number frequency components included in the input signal, independently on their location in the transformed domain [16]. With reference to the measurement approach proposed in this paper, the Discrete Fourier Transform (DFT) has been selected as orthonormal basis 𝜳 and the complex spectrum s as sparse representation of 𝒙. This choice allows computing magnitude spectrum of 𝒙, directly from the reduced number of measurements y, by solving the problem (8). III.
GREEDY ALGORITHMS FOR EFFICIENT CS IMPLEMENTATION In order to find a sparse solution of the eq. (7), several algorithms have been presented in the literature. Some of them, referred to as greedy iterative algorithms, defines a class of algorithms characterized by very low computational burden and, consequently, high recovery speed. As it can be expected, the obtained reconstruction quality turns out to be quite lower than that granted by the BP solvers. Differently from the BP approaches, the considered class of algorithms solves the reconstruction problem by finding, step by step, the solution in an iterative mode. The stopping criterion varies from algorithm to algorithm. The most used greedy algorithms are probably the matching pursuit MP and its derivative. However, when signal sparsity is reduced, recovery becomes costly. Thanks to its relative simplicity, MP is the ideal algorithm to be implemented on low-cost microcontroller, i.e. the core of the proposed measurement node. Major details about the operating steps of MP approach are given in the following. The key idea underlying the MP approach is the minimization of the so-called residual, i.e. the difference between the acquired samples y and the corresponding vector obtained iteratively from the solution algorithm. In particular, let us consider 𝒓 and 𝒔 , respectively the residual and the sparse solution of the eq.(6) at tth-iteration. Initially the residual is set equal to measurement vector y, and the sparse solution is set equal to zero. Thus 𝒓 ∈ 𝑹 and 𝒔 ∈ 𝑹 , with 𝑀 ≪ 𝑁.
𝒓 = 𝒚, 𝒔 = 0 As first stage of iteration, the correlation vector 𝒄 ∈ 𝑹 between the residual 𝒓 . Then, the entry 𝑐 characterized by highest value is estimation of the sparse solution 𝒔 . 𝒄 = 𝑚𝑎𝑥 |〈𝒓
(11)
algorithm computes the the sensing matrix A and of the correlation vector chosen to improve the , A〉|
(12)
where j is its index in the vector 𝒄 This task is accomplished by copying in the same position j the vector 𝒔 the highest value of the correlation vector 𝒄 , normalized by the value of the jth column of the sensing matrix A: 𝑠 =
(13)
Finally, the residual is update with the new value obtained subtracting from the previous residual the result of the cross product between 𝒄 and corresponding column of the sensing matrix, 𝑨 𝒓 =𝒓
− 𝒄 𝑨
(14)
The MP algorithm restarts from the eq(12) to improve the estimation of the sparse solution. Solution estimation stops if either the norm of the residual falls below a threshold or the number of iterations, k, reaches a defined limit value. Note that even if we perform M iterations of MP, it is not guaranteed that we will obtain an error of zero, though the asymptotical convergence of MP for 𝑘 → ∞ has been proven in [17]. IV. RESULTS OBTAINED ON LOW-COST MICROCONTROLLER As stated above, the considered efficient implementation of CS-based approach is tailored for low-cost microcontroller, i.e. an embedded system containing a processor core, memory, and a number programmable peripherals, such as Timers, ADCs, I/O peripherals, etc. In particular, the prototype of CS-based measurement network node has been implemented by means a STM32F429 Discovery Board of STMICROELECTRONICS™. It includes the microcontroller STM32F429ZI and an external SDRAM of 64 Mbits. The microcontroller used is a very low-cost hardware architecture, characterized by 32-bits ARM™ core processor and an ADC with a vertical resolution of 12 bit [18]. A number of tests have been carried out to preliminary assess the performance of the acquisition strategy. To this aim, the spectrum of the input signal recovered by the CS-based measurement node has been compared with that obtained by a DAS, assumed as reference, which performs a uniform sampling and computes the spectrum by means a Discrete Fourier Transform (DFT) algorithm. This DAS consisted of an ADC module NI9215 by National Instruments, which digitized n samples of the input signal at sampling rate and nominal vertical resolution equal respectively to 10 kSamples/s and 16
bits. Acquired samples were transferred to a Personal Computer (PC), where the reference spectrum is computed by means a DFT algorithm in MATLAB™ environment. As an example, some results obtained are briefly shown in the following. A first set of tests has been executed with a sinusoidal input signal at a frequency of 100 Hz, with 20 random samples digitized in a time window of 100 ms. The spectrum has been recovered on 1000 samples with a frequency resolution equal to 10 Hz and an equivalent sample rate of 10 kS/s. Parameters and results of tests are given in TABLE I. TABLE I
REFERENCES [1] [2]
[3]
[4]
SIGNAL AND ACQUISITION PARAMETERS Input parameters
Inpus signal frequency [Hz]
100
Acquired samples m
20
Samples number n
1000
Sampling rate [kS/s]
10000
[5]
[6]
Result obtained with 20 random samples acquired Amplitude (DFT) [VRMS]
1.800
Amplitude (CS-BASED) [VRMS]
1.815
[7]
As it can be appreciated, difference between amplitudes estimated by the CS-based method and that estimated by the DFT is lower than 1%, already with only 20 random samples acquired instead of the 1000 samples required by the DFT algorithm.
[8]
In Fig.1 the superposition of the spectrum computed by means the prototype of CS-based measurement node and the DFT algorithm is shown. The obtained results highlighted the feasibility of the proposed method and enabled the realization of applications based on CS to increase the performance of low-cost sensor node.
[10]
V. CONCLUSIONS A low-cost CS-based measurement node aimed to carry out measurements in frequency domain has been presented. In particular, it has been shown how a suitable random sampling strategy along with an efficient implementation of the CS approach can be exploited also with low-performance microcontrollers. This way, it is possible to execute both the acquisition and recovery stage on the microcontroller with no use of an external PC.
[13]
[9]
[11] [12]
Yick, J. et al., Wireless sensor network survey. Computer Networks, Volume 52, Issue 12, 22 August 2008, Pages 2292–2330. M. D’Arco, M. Genovese, E. Napoli, M. Vadursi, ‘Design and implementation of a preprocessing circuit for bandpass signals acquisition,’ IEEE Transactions on Instrumentation and Measurement, Vol.63, No.2, Feb. 2014, pp.287-294. L. Angrisani, M. D’Arco, “Modelling timing jitter effects in digital-to-analog converters,” IEEE Transactions on Instrumentation and Measurement, vol.58, n.2, February 2009, pp.330-336. Angrisani, L.; Bonavolontà, F.; D'Apuzzo, M.; Schiano Lo Moriello, R.; Vadursi, M.; A Compressive Sampling Based Method for Power Measurement of Band-Pass Signals. Proceedings IEEE International Instrumentation and Measurement Technology Conference, Minneapolis, May, 7 9, 2013, pp. 102-107. Bonavolontà, F.; D’Arco, M.; Ianniello, G.; Liccardo, A.; Schiano Lo Moriello, R.; Ferrigno, L.; Laracca, M.; Miele, G.; On the Suitability of Compressive Sampling for the Measurement of Electrical Power Quality. Proceedings IEEE International Instrumentation and Measurement Technology Conference, Minneapolis, May, 7 9, 2013, pp. 126-131. Angrisani, L.; Bonavolontà, F.; Ferrigno, L.; Laracca, M.; Liccardo, A.; Miele, G.; Schiano Lo Moriello, R.; Multi-channel Simultaneous data Acquisition Through a Compressive Sampling-Based Approach. Measurement: Journal of the International Measurement Confederation 2014, Volume 52, n.6, pp.156-172. Baccigalupi, M. D’Arco, A. Liccardo, R. Schiano Lo Moriello, ‘Compressive sampling-based strategy for enhancing ADCs resolution,’ Measurement, volume 56, 2014, pp.95–103. F. Bonavolontà, M. D’Apuzzo, A. Liccardo, M. Vadursi, “New approach based on compressive sampling for sample rate enhancement in DASs for low-cost sensing nodes”, Sensors, Vol. 14, N. 10, pp. 18915-18940, 2014. Candès, E.; Wakin, M. B.; An Introduction To Compressive Sampling. IEEE Signal Processing Magazine 2008, pp.21-30. Candès, E.; Romberg, J.; Tao, T.; Robust uncertainty principles: Exact signal reconstruction from highly incomplete frequency information. IEEE Transactions on Information Theory 2006, Volume 52, n. 2, pp. 489–509. Donoho, D.; Compressed sensing. IEEE Transactions on Information Theory 2006, Volume 52, n. 4, pp. 1289-1306. Candès, E.; Romberg, J.; Sparsity and incoherence in compressive sampling. Inverse Problems 2007, Volume 23, n. 3, pp. 969–985. E.J. Candès and J. Romberg, “Sparsity and incoherence in compressive sampling”, Inverse Problems, Vol. 23, N. 3, pp. 969-985, 2007.
Results highlighted the feasibility of the proposed measurement node. Tests have been performed with the aim of assessing the processing time of the MP algorithm implemented in the microcontroller for different conditions of the number both of acquired and reconstructed samples. Ongoing activities are mainly related to carry out a more comprehensive and exhaustive performance assessment in terms of both reconstruction quality and computational burden for different greedy algorithms, number of acquired samples, equivalent sample rate and input signal frequency.
Fig. 1 Difference between the spectrum computed by means the input signal frequency of 100 Hz.
[14] Mesecher, D.; Carin, L.; Kadar, I.; Pirich, R.; Exploiting signal sparseness for reduced-rate sampling. Systems. Proceedings of IEEE Systems, Applications and Technology Conference, Long Island, May, 1, 2009, pp 1-6. [15] Eldar, Y.C.; Kutyniok, G.; Compressed sensing Theory and Applications. Cambridge University Press, New York, USA, 2012. [16] Candès, E.; Romberg, J.; and Tao, T.; Stable signal recovery from incomplete and inaccurate measurements. Communication on Pure and Applied Mathematics 2006, Volume 59, n. 8, pp. 1207–1223.
[17] S. Mellat and Zhifeng Zhang. Matching Pursuits With Time-Frequency Dictionaries. In IEEE Transactions on Signal Processing, 1993. [18] RM0090 Reference Manual, “STM32F405/415, STM32F407/STM32F417, STM32F427/STM32F437 and STM32F429/STM32F439 advanced ARM-based 32-bit MCUs,” Mar. 2013 STMicroelectronic.