TimeExpAverage#

class acoular.tprocess.TimeExpAverage

Bases: Filter

Compute an exponentially weighted moving average of the input signal.

This filter implements exponential averaging as defined in IEC 61672-1, which is commonly used for sound level measurements. The time weighting determines how quickly past values decay in significance.

See also

Filter

Base class for implementing IIR filters.

Notes

The Impulse ('I') weighting is not part of IEC 61672-1 but is included for additional flexibility.

weight

Time weighting constant, determining the exponential decay rate.

  • 'F' (Fast) → 0.125

  • 'S' (Slow) → 1.0

  • 'I' (Impulse) → 0.035 (non-standard)

Default is 'F'.

sos

Filter coefficients in second-order section (SOS) format.

digest

A unique identifier for the filter, based on its properties. (read-only)

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.

source

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

sample_freq

Sampling frequency of output signal, as given by source.

num_channels

Number of channels in output, as given by source.

num_samples

Number of samples in output, as given by source.