Programming Reference:ParallelCombination
Function
The ParallelCombination class is a template that takes as arguments two filter class names. The instantiated template is then a combined filter, and must be given its own class name by defining a struct that publicly inherits from the instantiated template:
#include "FilterCombination.h"
#include "Filter1.h"
#include "Filter2.h"
struct MyCombination : ParallelCombination<Filter1, Filter2> {};
The instantiated ParallelCombination template may then be referred to as a filter with name MyCombination.
For the resulting filter, the following applies:
- The the filter's input channels may be fed selectively into the inputs of the two filters (see Parameters below).
- The filter's output is a concatenation of its two subfilters' outputs (see Output Signal below),
Any of the two filters may be a SubchainFilter, which allows for two parallel chains of filters, as well as more complex topologies because SubchainFilters may again contain ParallelCombination instantiations.
Parameters
<FilterName>Channels
The name of this parameter depends on the class name given to the instantiated combination as described under "Function", or the name given to the filter programmatically. In the example above, the parameter's name will be MyCombinationChannels.
The parameter is matrix-valued, and contains only a single column with two entries. The two rows correspond to the two filters given as template arguments, and each row's label gives the name of the filter it corresponds to.
Matrix elements themselves contain a list of channels each, determing which channels are transmitted to which of the two subfilters, or chains.
For channel lists, the following rules apply:
- Entries are separated by white space.
- Entries may contain wildcards: * to represent one or more arbitrary characters, and ? to represent a single arbitrary character.
- Character ranges may be enclosed by [].
- Wildcard patterns may be negated by prepending an exclamation mark.
- Ranges of channels may be specified using : or - to separate begin from end.
Examples for channel lists are:
* [matches all channels] EMG* [matches all channels whose name begins with 'EMG'] EEG* [matches all channels whose name begins with 'EEG']
States
None.
Output Signal
The output signal is a concatenation of both subfilters' (or subchains') output signals. First are output channels of the first subfilter, then output channels of the second subfilter. If one of these output signals has more signal elements (samples) than the other, then the maximum number of signal elements (samples) is taken as the number of signal elements of the concatenated output signal. Signal elements (samples) of the concatenated output signal that do not exist in one of the two subfilters' output will be filled with NaN values.
See also
Programming Reference:SubchainFilter, Programming Reference:LinearCombination, Programming Reference:ChoiceCombination