This software module determines whether the sleeping person is dreaming or not, and sends this information to the user interaction and flow control module.
Depending on the device used, two scenarios are possible: a) the device or its provided software detect REM sleep automatically; in this case this software module has to read out the current REM state from the device or its software and send it to the user interaction and flow control module, or b) the device or its software do not detect the REM sleep automatically; in this case this software module has to access the (raw) data generated by the sleep recording device and apply a self-programmed REM detection algorithm on them, which can be of various kinds, e.g. using artificial neural networks.
Advantages of a self-programmed REM detector are that its parameters can be modified to one’s own needs, that it is understandable (“white box” instead of “black box”), and that it can be individually programmed according to a specific person’s sleep. A possible advantage of a device shipped with a predefined REM detector could be that this way the expertise of the device’s manufacturer can be used.