Programming Reference:ParallelCombination: Difference between revisions
| Line 30: | Line 30: | ||
EMG* [matches all channels whose name begins with 'EMG'] | EMG* [matches all channels whose name begins with 'EMG'] | ||
EEG* [matches all channels whose name begins with 'EEG'] | EEG* [matches all channels whose name begins with 'EEG'] | ||
==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. | |||
==States== | |||
None. | |||
Revision as of 16:59, 5 September 2023
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:
struct MyCombination : ParallelCombination<Filter1, Filter2> {}
- The combination's input channels may be fed selectively into the inputs of the two filters.
- The combination's output is joined together from the output of the two filters.
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']
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.
States
None.