Filtering and Decoding Implementation

The filtering and decoding routine of the mTouch CVD Framework executes all of the detection algorithms. Using the latched output from the acquisition module, the mTouchCVD_Service() function is called each time a new value is available for each sensor (known by checking the mTouchCVD_isDataReady() function). It will then loop through all of the active sensors and determine if they have changed state. If the CVD_DEBUG flag is set to enable the default mTouch CVD communications module, the algorithm will also transmit the latest set of data.

The decode routine implements a baseline average that is only updated while the sensor is in the CVD_RELEASED state. The difference between the sensor's average and its reading is stored in a variable called delta and is compared against the THRESHOLD_PRESS_SENSOR0 values (or the equivalent release threshold values) to determine if a change in state is necessary.

While pressed, the system can also begin a counter to automatically release the sensor after a given period of time. This can be implemented using the BUTTON_TIMEOUT configuration option.

In some systems when the user releases a sensor other sensors can see a slight negative shift in value. This is the opposite direction of the 'press' shift, so we have included some special options to define how the average updates in these situations. There are also options to change the normal averaging update rate to customize the feel of your sensors. For more information, see the CVD_Filter_UpdateAverage() function.

For more information about the filtering and decoding module, check out these help sections: