User Interaction and Flow Control

This module implements the logic of sleep communication and connects all other software modules. It integrates the information coming from the REM detection module and the body signal detection and decoding module. Moreover, it implements rules on when and how to start, stop or modify the stimulus generation. One example for such a rule can be a waiting time: Only if out of the last m seconds at least n % have been classified as REM sleep, stimulus generation is started, otherwise stopped. This way, a false REM detection due to noise in the data does not switch the stimulus on or off immediately. Another exemplary rule can be a stimulus control mechanism using the body signal detection and decoding: If a specific body signal is detected, stimulus intensity is decreased.

Moreover, this module offers a possibility for user interaction, allowing the user to control stimuli and their parameter directly, to set parameters of REM detection or body signal detection and decoding, or to access the data visualization. This can be implemented in a graphical user interface providing simple use of mouse and keyboard.