Filter#

class acoular.tprocess.Filter

Bases: TimeOut

Abstract base class for IIR filters using SciPy’s lfilter().

This class implements a digital Infinite Impulse Response (IIR) filter that applies filtering to a given signal in a block-wise manner. The filter coefficients can be dynamically changed during processing.

See also

scipy.signal.lfilter()

Filter data along one-dimension with an IIR or FIR (finite impulse response) filter.

scipy.signal.sosfilt()

Filter data along one dimension using cascaded second-order sections.

FiltOctave

Octave or third-octave bandpass filter (causal, with non-zero phase delay).

FiltFiltOctave

Octave or third-octave bandpass filter with zero-phase distortion.

source = Instance(SamplesGenerator)

The input data source. It must be an instance of a SamplesGenerator-derived class.

sos = Property()

Second-order sections representation of the filter coefficients. This property is dynamically updated and can change during signal processing.

result(num)

Apply the IIR filter to the input signal and yields filtered data block-wise.

This method processes the signal provided by source, applying the defined filter coefficients (sos) using the scipy.signal.sosfilt() function. The filtering is performed in a streaming fashion, yielding blocks of filtered signal data.

Parameters:
numint

Number of samples per block.

Yields:
numpy.ndarray

An array containing the bandpass-filtered signal for the current block. Each block has the shape (num, num_channels), where num_channels is inherited from the source. The last block may contain fewer samples if the total number of samples is not a multiple of num.