3
Signal Processing In‐Node Environment

3.1 Introduction

The analysis of the state‐of‐the‐art on the BSN domain has highlighted that the development of BSN applications is to date a complex task also due to the lack of programming frameworks with dedicated support to the distinctive requirements of BSN systems.

To support the programming of optimized BSN applications while minimizing the development time and effort, we have designed and realized SPINE (Signal Processing In‐Node Environment) [1–3], an open‐source domain‐specific programming framework for BSNs.

SPINE aims at boosting the prototyping of BSN applications. SPINE enables efficient implementations of signal‐processing algorithms for analysis and classification of sensor data through libraries of processing functionalities. It is organized into two interacting macro‐components, which are, respectively, implemented on commercially available programmable sensor devices and on the personal coordinator (Android smartphones and tablets, or a personal computer). Communication among these devices is wireless, using Bluetooth or IEEE 802.15.4 standards. The high‐level SPINE API (at the coordinator level) allows for dynamic and flexible configuration of sensing and processing functionalities available at the sensor node level. Many biophysical sensors and signal‐processing tasks are natively implemented and available to application developers. In addition, the SPINE framework has been carefully designed to allow for very easy integration of new, custom‐defined sensor drivers and processing tasks. A key advantage of adopting SPINE is its ability to configure the BSN system based on specific sensing and processing requirements; in this way, the same sensors can be used by different applications without requiring off‐line reprogramming before switching from an application to another.

3.2 Background

TinyOS [4] is an event‐driven operating system, which provides a programming environment for embedded systems. It has a component‐based execution model implemented in the nesC language [5] with a very low memory footprint.

TinyOS concurrency model is based on commands, asynchronous events, deferred computation called tasks, and split‐phase interfaces. The function invocation (as command) and its completion (as event) are separated into two phases in interfaces provided by TinyOS. Application user has to write the handler, which is invoked upon the triggering of an event. Commands and event handlers may post a task, which is executed by the TinyOS FIFO scheduler. These tasks are non‐preemptive among each other and, thus, run to completion. Only an (asynchronous) event can preempt running tasks. Data race conflicts that arise due to preemption can be solved using atomic sections.

Radio communication in TinyOS follows the Active Messages [6] model, in which each packet on the network specifies the ID of the handler that will be invoked on the recipient nodes. The handler ID is an integer that is carried in the header of the message. When a message is received, the event associated with the handler ID is signaled. Different sensor nodes can associate different receive events with the same handler ID.

3.3 Motivations and Challenges

The development of SPINE, as a domain‐specific BSN middleware (MW), is motivated by the need of providing more effective solutions than naïve application‐specific programming and a more efficient approach than general‐purpose programming frameworks. It has been demonstrated that in the BSN domain, domain‐specific frameworks contribute to reduce the development cycle and maintenance since they provide high‐level abstractions of network protocols and hardware details, allowing the programmer to focus mainly on the application logic without the burden of carrying the overhead of general‐purpose functionalities that are, in practice, not used in the BSN domain (e.g. multi‐hop support).

The main challenge during the design of SPINE was to find the most effective trade‐off between high‐level API definition (i.e. fulfillment of requirements in the BSN programming domain) and the limitations given by strongly resource‐constrained sensing devices.

3.4 The SPINE Framework

SPINE is a full‐fledged and extensible solution that allows rapid prototyping of BSN‐based applications and systems. It allows quick implementation of distributed signal‐processing intensive applications by supporting several physiological sensors, in‐node and on‐coordinator signal‐processing utilities, wireless transmission of biosignals, and built‐in optimized network and resource management. SPINE is designed as a modular structure to simplify the integration of additional sensor drivers and signal‐processing modules; in addition, the framework itself can be tailored and customized by a simple mechanism to combine all the sensing and processing modules altogether, according to specific application requirements. A key advantage of adopting SPINE is its ability to configure the BSN system based on specific sensing and processing requirements; in this way the same sensors can be used by different applications without requiring off‐line reprogramming before switching from an application to another. SPINE supports BSN networks that are conceptually organized in a star‐topology, with the sensor nodes representing the edges and the coordinator unit the center of the star. Direct node‐to‐node communication is also possible, although the predefined processing functionalities do not need it. It is worth noting that SPINE devices communicate atop an application‐level protocol, so it is in principle possible to use a multi‐hop network layer to realize systems that are based on a physical network in which the coordinator and the nodes are more than one hop distant.

In the following, we describe the software architecture of SPINE, its High‐Level Data Processing module, and finally discuss its heterogeneous support of sensor and coordinator device platforms.

3.4.1 Architecture

A high‐level representation of the SPINE architecture is shown in Figure 3.1. The SPINE MW is partially located at the coordinator device and partially on the wearable sensors. The MW provides an API both on the coordinator and the sensor nodes to support the development of applications that finally rely on the platform‐independent communication protocol layer. This protocol represents an abstraction layer including diverse platform‐dependent communication adapters that are dynamically loaded at the coordinator, whereas are linked at compile time at the sensor‐node level.

SPINE middleware architecture, including coordinator device, SPINE middleware, sensor nodes 1 and n with lines, from SPINE middleware, pointing to SPINE API, platform-independent SPINE communication protocol, etc.

Figure 3.1 The SPINE middleware architecture.

Figures 3.2 and 3.3 show, respectively, the architecture of the SPINE Node(s) and SPINE Coordinator components. The former is implemented in the sensor platform‐specific embedded programming language and is placed on each BSN sensor node; the latter is implemented in Java and runs on the coordinator device (an Android porting of the SPINE Coordinator has also been realized).

Diagram of SPINE Node software architecture with boxes labeled Communication, SPINE Node Manager, Signal Processing Manager, and Sensing Management linked by solid (data flow) and dashed (control flow) arrows.

Figure 3.2 The SPINE Node software architecture.

(Diagram source in Ref. [2]).

Diagram of SPINE Coordinator software architecture with boxes labeled Optional ADD-ONS, SPINE Coordinator Manager, and Communication linked by solid (data flow) and dashed (control flow) arrows.

Figure 3.3 The SPINE Coordinator software architecture.

(Diagram source in Ref. [2]).

The SPINE Node (see Figure 3.2) consists of four main components:

  • Sensor Node Manager, which handles the interactions among the Sensing Management, Signal Processing, and Communication modules; it dispatches the requests from the remote coordinator to the appropriate module.
  • Communication, which handles message reception/transmission and controls radio duty‐cycling. It consists of inbound packet decoders (i.e. service discovery, start and reset computation requests, setup function request, function (de)activation request, and setup sensor request) and outbound packets encoders (i.e. service advertisement, buffered sensor readings, processed data message, and acknowledgment packet). Any packet is initially handled by the Radio Controller module, which provides a generic interface independently from the specific underlying radio chip adapter.
  • Sensing Management (or SensorBoard controller), which is the component providing a generic interface to the physical sensors available on the node. It allows to perform one‐shot sensor readings and to setup timers for periodic sensor sampling. This component provides easy hardware‐independent access to all the supported sensor drivers (SPINE currently supports 3D accelerometer, 2D gyroscope, 4‐leads ECG, respiration rate, GSR, EMG, visible and infrared light, humidity, and environmental temperature) through a list of parameterized Sensor interfaces. This design choice is motivated by the need for high modularity and efficient customization to support heterogeneous sensing resources in a convenient way. Sensor readings are stored in the BufferPool, a data structure that is shared with the Signal Processing module. The BufferPool, internally organized as multiple circular buffers, provides two mechanisms to access the sensor data: (i) upon requests, using getter functions, and (ii) through event listeners that must be registered by interested components (e.g. Signal Processing module) to be notified when new sensor data are available. The Sensing Management also features a shared sensor registry to which each sensor driver self‐registers upon program bootstrap. This registry is accessed at runtime by other components to retrieve the list of sensors actually available on that specific node.
  • Signal Processing, which uses a block called Function Manager that is responsible for handling a customizable and expansible set of signal‐processing functionalities such as (i) math aggregators (features like maximum value, minimum value, amplitude, average, standard deviation, signal energy, and entropy), (ii) threshold‐based triggers (also known as alarms), and (iii) filters; such processing functionalities can be arbitrarily applied to any sensor data stream. The Function Manager engine uses an efficient design approach based on a list of parameterized Function interfaces providing a general‐purpose abstraction for any type of processing task. The Signal Processing module retrieves sensor data from the BufferPool and, by interacting with the Sensor Node Manager and the Packet Manager, it communicates the results to the coordinator unit.

The SPINE Coordinator (see Figure 3.3) consists of two main components:

  • Communication, which has similar functionalities to its corresponding component on the sensor node; it loads at runtime the proper radio module adapter according to the required network stack. It abstracts the logical interactions between the coordinator and the sensor nodes from the actual network activity that depends on the selected platform. This abstraction layer is realized by decoupling the communication interface from its platform‐dependent implementation layer.
  • SPINE Coordinator Manager, which is the most superficial layer atop which every SPINE applications will rely. It is composed of Sensor Network Control API (see Table 3.1) and Event Dispatcher. The former is an interface used by end‐user application developers for the management of the underlying BSN (e.g. to configure the sensors and enable on‐node signal processing). The latter is responsible for dispatching events, such as new node discovery and data message arrival, to the registered listeners implemented by the SPINE applications.

Table 3.1 API exposed by SPINE at the coordinator station.

FunctionalityDescription
discoveryBsnInquiry node discovery and supported sensing and processing capabilities
setupSensorAllows individual specification of sampling rates for multiple sensors
setupFunctionSetup a preliminary configuration of available processing functionalities
activateFunctionEnables the execution of one or multiple in‐node (periodic or trigger based) signal‐processing functionalities
startBsnIssues a broadcast message to the BSN to command a synchronized start of sensing and processing functionalities that have been previously setup and enabled
resetBsnIssues a broadcast message to the BSN to command a synchronized reset of the nodes
EventDescription
newNodeDiscoveredRegistered SPINE listeners are notified when a new BSN node is discovered
discoveryCompletedRegistered SPINE listeners are notified when the BSN discovery procedure is terminated
dataReceivedRegistered SPINE listeners are notified when new user data sent from a specified node are received by the coordinator
serviceMessageReceivedRegistered SPINE listeners are notified when a service message (e.g. warning or error notifications) sent by a specific node is received by the coordinator

3.4.2 Programming Perspective

From a programming perspective, SPINE provides an intuitive Java API (documented in Chapter 12) for convenient BSN management to easily support node discovery, sensing operations, signal processing, and data communication. In addition to several sensor natively supported and pre‐defined processing functions, SPINE is designed such that framework tailoring (i.e. customization and extension) becomes very straightforward.

3.4.3 Optional SPINE Modules

The SPINE MW is completed with “optional add‐on” modules available only on the coordinator node; they represent an important aspect, despite not being part of its core architecture:

  • High‐Level Data Processing, which provides advanced signal processing and pattern recognition functionalities. It supports the design and implementation of complex applications by means of highly generalized interfaces for data preprocessing, feature extraction and selection, signal processing, and pattern classification. It supports the integration of SPINE in analysis and data mining environments with functionalities such as automatic network configuration and aggregate data collection. It includes a predefined bridge to WEKA [7] (an open‐source Data Mining toolkit) to allow the use of its powerful algorithms directly within SPINE.
  • SPINE Management GUI, which consists of a visual programming tool to configure a SPINE‐based BSN without manually coding. According to our experience, it has been useful during initial system testing. Screenshots of its PC and Android implementations are shown in Figures 3.4 and 3.5, respectively.
Screenshot of Sensor‐node configuration window displaying Node Info, sensor code set to accelerometer, sample time set to 100, time type set to ms, and checked boxes labeled Raw Data and Min under Feature Setting.

Figure 3.4Java desktop implementation of the SPINE Management GUI (sensor‐node configuration dialog window).

2 Screenshots of android implementation of SPINE management GUI, with selected setup sen button with Sensor set to accelerometer (left) and selected setup fun button with Function set to BufferedRawD (right).

Figure 3.5Android implementation of the SPINE Management GUI (sensor and function configuration dialog windows).

3.4.4 High‐Level Data Processing

The High‐Level Data Processing module is an optional SPINE plug‐in that empowers the core framework functionalities with additional signal processing and decision‐support algorithms (e.g. signal filters, pattern recognition, classification, etc.). This module is available at the coordinator level and provides robust support throughout the typical signal‐processing workflow, from sensor data acquisition up to classification (see Figure 3.6).

Diagram of data processing chain supported by the SPINE high‐level data processing plug‐in, from sensor data acquisition and feature selection to classification pattern recognition.

Figure 3.6 Data processing chain supported by the SPINE High‐level Data Processing plug‐in.

A layered representation of the High‐Level Data Processing component is depicted in Figure 3.7. SPINE acts as a MW layer between this module and the underlying BSN. On top of SPINE, a set of converters are placed to convert SPINE data representations into more abstract objects, Datasets and Signals. Data mining and machine learning tools can therefore transparently handle BSN data, since the module can also generate WEKA‐compliant Comma Separated Values (CSVs) and Attribute‐Relation File Format (ARFF) files. Finally, a collection of functionality wrappers further support rapid implementation of common tasks needed during the development of SPINE applications. A typical use of this module is described in detail in the following.

High‐Level Data Processing layered software architecture with layers labeled SPINE applications, Functionality Wrappers, Signal Processing, Machine Learning, Data Converters, and SPINE Coordinator.

Figure 3.7 High‐Level Data Processing layered software architecture.

BSN sensory data are retrieved with SPINE and converted into more convenient data structures (Signal and Dataset objects, depending on application‐specific requirements). Then, developers can optionally apply filtering and segmentation to incoming signals. Feature Extraction algorithms are also available and they are useful when in‐node feature extraction functionalities provided by SPINE are not enabled (i.e. SPINE is used to acquire raw sensor signals). To support the initial problem analysis, several feature selection algorithms are provided to identify the most significant subset of extracted features to reach satisfactory classification accuracy. Finally, the classification phase is widely supported, including training. A few algorithms are implemented and ready‐to‐use; in addition, developers may easily integrate further classifiers, especially thanks to the choice of providing support for using WEKA libraries.

3.4.5 Multiplatform Support

SPINE supports a heterogeneous plethora of hardware platforms, sensors, programming languages, and operating systems; these make this framework suitable for diverse application scenarios (such as smart‐Health and e‐Fitness), in which, due to specific requirements, only certain hardware/software sensor platforms might be used.

SPINE supports the most common sensor motes. The TinyOS implementation runs on MicaZ, TelosB, and Shimmer/2/2R [8] (for the latter, SPINE supports both IEEE 802.15.4 and Bluetooth radios). This implementation includes a security function using hardware AES‐128 encryption of the CC2420 radio. In addition, there exist SPINE implementations for ZigBee devices (like the Telecom Italia “Bollino”, equipped with the CC2530 System‐on‐Chip) based on Texas Instruments Z‐Stack and for Java‐based Sun SPOT nodes [9]. SPINE also notably provides native support for several physical sensor transducers, including accelerometers, gyroscopes, electrocardiogram, electro impedance plethysmography, temperature, humidity, and light.

In addition to sensors and platforms supported by default, SPINE is designed in such a way that it is easy to integrate further drivers for other sensors and even add support for new platforms. The same happens for the processing functions: integrating additional feature extractors (and even simple classifier algorithms) is straightforward.

At the coordinator level, SPINE supports heterogeneous mobile and desktop devices, as depicted in Table 3.2. Originally, Windows‐ and Linux‐based computers were supported through the SPINE Java SE implementation. However, with the spread of smartphones and tablets having more than sufficient computation and storage capabilities to support mobile‐health applications and (almost) continuous Internet connectivity (through which it is possible to transmit raw signals and high‐level information to remote servers or in the cloud), we put significant efforts to obtain mobile SPINE coordinators since their use is particularly useful (sometimes strictly necessary) when continuous, outdoor mobility is required and is not possible to rely on fixed infrastructures. A JavaME porting of the framework has been in fact realized. A limited QT implementation is also available and runs on Symbian and Windows smartphones, enabling Bluetooth communication with Shimmer nodes using the third‐party QBluetooth library. Finally, and most significant, an Android implementation of SPINE has been more recently developed. SPINE Android has been evaluated on several devices (that have been connected to Shimmer nodes over Bluetooth).

Table 3.2 SPINE‐tested mobile personal devices.

DeviceCPURAM (MB)Miscellaneous
HTC Nexus One1 GHz, Snapdragon QSD 8250512Android 2.x., MicroSD, up to 32 GB
Samsung Galaxy S1 GHz, ARM Cortex‐A8 Dual‐Core512Android 2.x., MicroSD, up to 32 GB
Samsung Galaxy S41.9 GHz, Snapdragon 600 Quad‐Core2048Android 4.4.2., MicroSD, up to 64 GB
Huawei P8Quad‐core 2.0 GHz Cortex‐A53e+Quad‐core 1.5 GHz Cortex‐A533096Android 6.0, MicroSD, up to 128 GB
Samsung Tab2 10.11.0 GHz, ARM Cortex A9 Dual‐Core1024Android 4.0.3., MicroSD, up to 32 GB
Samsung Note32.3 GHz, Snapdragon 800 Quad‐Core3096Android 4.4.2., MicroSD, up to 64 GB
Nokia N95332 MHz, TI OMAP 2420 (ARM11‐based)128Symbian OS v9.2, S60 rel. 3., MicroSD, up to 32 GB
Nokia 6120369 MHz, ARM1164Symbian OS v9.2, S60 rel. 3.1., MicroSD, up to 8 GB

Finally, SPINE provides a Java‐based emulation environment that virtualizes generic sensor nodes. With this tool, it is possible to emulate a SPINE‐based BSN, provided that a dataset is available for each node. Hence, each emulated node is equipped with emulated sensors defined by its given dataset. The SPINE emulator is helpful in various situations; for example, to simplify testing and debugging, processing functionalities can be initially implemented in the emulated environment. In addition, the emulator, along with a simple dataset, has been released in open‐source to allow interested developers for investigating the potential of the SPINE framework itself, even if they are not equipped with real wireless sensor nodes.

3.5 Summary

In this chapter, SPINE, a domain‐specific programming framework, has been presented. The main goal of SPINE is to provide BSN developers with support for rapid prototyping of signal‐processing applications. In SPINE, sensors and common processing functionalities, such as math aggregators and threshold‐based alarms, can be configured independently and connected together arbitrarily at runtime based on external controls.

Hence, one of the main achievements of SPINE is the reuse of software components to allow different end‐user applications to configure sensor nodes at runtime based on the application‐specific requirements without off‐line reprogramming when switching from an application to another. Furthermore, thanks to its modular component‐based design approach, SPINE enables a great degree of heterogeneity: a wide variety of hardware platforms, sensors, programming languages, and operating systems are supported. This allows for a very flexible and usable framework in different BSN application scenarios, where, due to specific requirements, only certain platforms or operating systems might be used.

References

  1. 1 Bellifemine, F., Fortino, G., Giannantonio, R. et al. (2011). SPINE: a domain‐specific framework for rapid prototyping of WBSN applications. Software: Practice & Experience 41 (3): 237–265.
  2. 2 Fortino, G., Giannantonio, R., Gravina, R. et al. (2013). Enabling effective programming and flexible management of efficient body sensor network applications. IEEE Transactions on Human‐Machine Systems 43 (1): 115–133.
  3. 3 SPINE Website. http://spine.deis.unical.it (accessed 8 June 2017).
  4. 4 Tinyos Website. www.tinyos.net (accessed 14 June 2017).
  5. 5 Gay, D., Levis, P., von Behren, R. et al. (2003). The NesC language: a holistic approach to networked embedded systems. ACM SIGPLAN Notices 38 (5): 1–11.
  6. 6 Von Eicken, T., Culler, D., Goldstein, S.‐C., and Schauser, K.‐E. (1992). Active messages: a mechanism for integrated communication and computation. Proceedings of the 19th Annual International Symposium on Computer Architecture, ISCA’92, Queensland, Australia (19–21 May 1992), pp. 256–266. ACM Press.
  7. 7 Holmes, G., Donkin, A., and Witten, I., Weka: a machine learning workbench. Proceedings of the 2nd Australia and New Zealand Conference on Intelligent Information Systems, ANZIIS’94, Brisbane, Australia (29 November–2 December 1994), pp. 1269–1277. IEEE Press.
  8. 8 Shimmer Website. www.shimmersensing.com (accessed 5 June 2017).
  9. 9 SunSPOT Website. www.sunspotdev.org (accessed 10 June 2017).
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.223.123