This page hosts the documentation of the SmartCGMS software architecture and all of its components.

Mapping and masking filters

There are two filters, that modifies a single property of passing device event. Mapping filter remaps the signal ID of the passing event to another one. Masking and unmasking filters masks passing events according to a bit mask.

Signal mapping is useful, when you need to change the signal ID of a passing event either temporarily or permanently. One such example is, when you obtain a calculated model signal and you need to consider it a reference one. This situation occurs, when a physiological model produces a model-calculated interstitial glucose signal, and the rest of the chain expects the measured interstitial glucose signal (i.e., scgms::signal_IG). When using mapping filter, be aware, that if the filter chain already contains the target signal ID, it is impossible to distinguish mapped and original signals.

For the purposes of temporary mapping, SmartCGMS defines a set of virtual signals scgms::signal_Virtual_1 through scgms::signal_Virtual_100 in the SDK.

A special case for mapping is, when a mapping to scgms::signal_Null is requested. In this case, all events with matching source signal GUIDs are released from memory and not passed through in any way.

Signal masking and unmasking is particularly useful, when dividing data to learn and validation sets. This way, the filter "hides" pieces of data transparently, while still being able to recover them by using the unmasking filter.


Mapping filter

  • Signal_Src_Id (GUID) - signal GUID, that should be mapped
  • Signal_Dst_Id (GUID) - signal GUID to which the filter should map

Masking filter

  • Signal (GUID) - signal GUID, that should be masked
  • Bitmask (string) - a string of zeroes and ones, representing a bitmask for masking; zeroes represents recurring positions of events to be masked

Unmasking filter

  • Signal (GUID) - signal GUID, that should be unmasked

Supported interfaces


General function

Mapping filter

The mapping filter contains a very simple logic, that could be summarized to the following control flow diagram. The logic is executed every time an event passes through the filter:

Mapping filter flow diagram

Masking filter

Masking filter changes the device event code from scgms::NDevice_Event_Code::Level to scgms::NDevice_Event_Code::Masked_Level for device events with configured signal GUID, conforming to the configured bitmask. Once the bitmask is "depleted", it repeats the same pattern for subsequent device events. Time diagram below depicts the logic.

Masking filter time diagram

The masking filter supports bitmasks with 8 to 64 bits. The configured string may contain spaces for better readability - they are removed during configuration and bitmask parsing.

Unmasking filter

The unmasking filter changes the device event code back from scgms::NDevice_Event_Code::Masked_Level to scgms::NDevice_Event_Code::Level for device events with configured signal GUID.