-
Notifications
You must be signed in to change notification settings - Fork 35
Description
The FirFilter operator currently supports applying a 1D kernel across all waveform channels (rows) for filtering purposes, e.g. band-pass. For individual calibration and filtering purposes, we would like to extend this functionality to support having separate kernels per channel.
A couple of important questions fall from this. The first one is whether this support should be provided using a new operator or an extension of the existing operator to multiple channels. The Kernel property would have to change to accept a 2D rectangular array (float[,]) rather than a flat array float[]. From an XML perspective, this is a backwards compatible change since the text conversion works, but there is currently no implicit conversion from float[] to float[,] so any input mappings would break (though this conversion could in principle be supplied since all float[] can always be interpreted as a float[,] with a single row).
The second question is how to efficiently implement the filter. The current operator leverages the Filter2D method of OpenCV, which applies row-wise correlation when the kernel is 1D. For 2D kernels however, the correlation is done in both columns and rows for every "pixel" so it is not really applicable to this more general case. We could either apply N independent filters for every channel, or for example implement filtering using multiplication in the frequency domain by using the DFT operator support for row-wise processing (see DiscreteTransformFlags.Rows).