Interface IOnlineFilter
Interface for online (sample-by-sample) digital filters that maintain internal state across calls.
Namespace: MOSAIC.Components.SignalProcessing
Assembly: MOSAIC.dll
Syntax
public interface IOnlineFilter
Remarks
Implementations (e.g., FirFilter, IirFilter) process one sample at a time via ProcessSample(double) while maintaining an internal delay line or state vector between calls.
Thread-safety: Implementations are generally not thread-safe. Callers must synchronize externally if concurrent access is required.
Methods
ProcessSample(double)
Processes a single input sample and returns the filtered output.
Declaration
double ProcessSample(double sample)
Parameters
| Type | Name | Description |
|---|---|---|
| double | sample | The input sample value. |
Returns
| Type | Description |
|---|---|
| double | The filtered output sample. |
ProcessSamples(double[])
Processes an array of input samples sequentially and returns the filtered outputs.
Declaration
double[] ProcessSamples(double[] samples)
Parameters
| Type | Name | Description |
|---|---|---|
| double[] | samples | The input sample array. |
Returns
| Type | Description |
|---|---|
| double[] | A new array of the same length containing the filtered output samples. |
Reset()
Resets all internal filter state (delay lines, history buffers), as if no samples had been processed.
Declaration
void Reset()