Class ParallelSumFilter
Runs two IOnlineFilter instances in parallel and sums their outputs.
Implements
Inherited Members
Namespace: MOSAIC.Components.SignalProcessing
Assembly: MOSAIC.dll
Syntax
public class ParallelSumFilter : IOnlineFilter
Remarks
Used to implement a bandstop filter as y[n] = LP(x[n]) + HP(x[n]),
where the lowpass passes everything below the stop-band and the highpass passes
everything above it. This is the correct topology for a notch/bandstop response —
cascading (series) would produce an all-reject filter instead.
Thread-safety: Not thread-safe. Callers must synchronize externally.
Constructors
ParallelSumFilter(IOnlineFilter, IOnlineFilter)
Initializes a new ParallelSumFilter.
Declaration
public ParallelSumFilter(IOnlineFilter filterA, IOnlineFilter filterB)
Parameters
| Type | Name | Description |
|---|---|---|
| IOnlineFilter | filterA | First parallel branch (e.g. lowpass). |
| IOnlineFilter | filterB | Second parallel branch (e.g. highpass). |
Fields
_filterA
Declaration
private readonly IOnlineFilter _filterA
Field Value
| Type | Description |
|---|---|
| IOnlineFilter |
_filterB
Declaration
private readonly IOnlineFilter _filterB
Field Value
| Type | Description |
|---|---|
| IOnlineFilter |
Methods
ProcessSample(double)
Processes a single input sample and returns the filtered output.
Declaration
public 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
public 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
public void Reset()