Jump to content

User Reference:InterpolationFilter

From BCI2000 Wiki

Function

The InterpolationFilter allows for a linear interpolation over certain chunks of data, defined by an Expression for flexibility. Two main use cases are for interpolating over lost samples, in the case of the signal being sent over wireless transmission, and for masking a stimulation artifact to improve real-time signal processing.

Parameters

InterpolationExpression

This expression is evaluated at a sample by sample basis. When true, the "invalid" signal data will be replaced by a linear interpolation from the two adjacent valid samples (before and after the invalid sample(s)).

Integration

This filter can either be used in a signal source module or a signal processing module.

Source module

All that is needed is for it to be added in the source's cmake file with the line bci2000_include( SourceFilter ). When the source module is built again, the filter will be placed before the DataIOFilter, meaning it will affect the data that is saved. Therefore, it is necessary that the user is okay with the data being overwritten when the expression is true. This is only recommended if there is a BCI2000 stream state defining lost samples.

Signal processing

To add this to your signal processing chain, simply add it to the signal processing module's PipeDefinition.cpp. See this page for more details and customization: User Reference:Designing a Signal Processing Filter.