Spatial Filter

Summary

Doc_BoxAlgorithm_SpatialFilter.png
  • Plugin name : Spatial Filter
  • Version : 1.1
  • Author : Yann Renard, Jussi T. Lindgren
  • Company : Inria
  • Short description : Maps M inputs to N outputs by multiplying the each input vector with a matrix
  • Documentation template generation date : Nov 2 2017

Description

The applied coefficient matrix must be specified as a box parameter. The filter processes each sample independently of the past samples.

The spatial filter generates a number of output channels from another number of input channels, each output channel being a linear combination of the input channels. For example, lets say ICj is the jth input channel, OCk is the kth output channel, and Sjk is the coefficient for the jth input channel and kth output channel in the Spatial filter matrix.

Then the output channels are computed this way : OCk = Sum on j ( Sjk * ICj )

Inputs

1. Input Signal

This input contains the input channels to mix.

  • Type identifier : Signal (0x5ba36127, 0x195feae1)

Outputs

1. Output Signal

This output contains the generated channels, mixed from the input channels.

  • Type identifier : Signal (0x5ba36127, 0x195feae1)

Settings

1. Spatial Filter Coefficients

This setting contains a flat view of the spatial filter matrix. The coefficient orders is as follows : all the coefficients for the first output followed by all the coefficients for the second output and so on..

  • Type identifier : String (0x79a9edeb, 0x245d83fc)
  • Default value : [ 1;0;0;0;0;1;0;0;0;0;1;0;0;0;0;1 ]

2. Number of Output Channels

Number of output channels to generate

  • Type identifier : Integer (0x007deef9, 0x2f3e95c6)
  • Default value : [ 4 ]

3. Number of Input Channels

Number of input channels to compute from

  • Type identifier : Integer (0x007deef9, 0x2f3e95c6)
  • Default value : [ 4 ]

4. Filter matrix file

Filter matrix. You can alternatively provide the filter coefficients as an ASCII file.

  • Type identifier : Filename (0x330306dd, 0x74a95f98)
  • Default value : [ ]

Examples

Let's consider the following example :

  • Input channels list: C3 C4 FC3 FC4 C5 C1 C2 C6 CP3 CP4 (10 channels)

Spatial filter coefficients: 4 0 -1 0 -1 -1 0 0 -1 0 0 4 0 -1 0 0 -1 -1 0 -1 (20 values)

  • Number of output channels: 2
  • Number of input channels: 10

The output channels becomes :

OC1 = 4 * C3 + 0 * C4 + (-1) * FC3 + 0 * FC4 + (-1) * C5 + (-1) * C1 + 0 * C2 + 0 * C6 + (-1) * CP3 + 0 * CP4
= 4 * C3 - FC3 - C5 - C1 - CP3
OC2 = 0 * C3 + 4 * C4 + 0 * FC3 + (-1) * FC4 + 0 * C5 + 0 * C1 + (-1) * C2 + (-1) * C6 + 0 * CP3 + (-1) * CP4
= 4 * C4 - FC4 - C2 - C6 - CP4

This is basically a Surface Laplacian around C4 and C5.

Miscellaneous

For large filters, it is somewhat faster to provide the matrix in an ASCII file than having the coefficients in scenario.xml directly. If a file is used, the filter size is read from the file and the other parameters of the box are ignored.

To provide the filter matrix as a file, the format is the same as is used for storing electrode localizations. E.g. for 3x3 identity matrix, the file would be

[ ; * [ "row1" "row2" "row3" ] ; * [ "col1" "col2" "col3" ] ; * ]
[ ; * [ 1 0 0 ] ; * ]
[ ; * [ 0 1 0 ] ; * ]
[ ; * [ 0 0 1 ] ; * ]