TimeExpAverage#
- class acoular.tprocess.TimeExpAverage
Bases:
FilterCompute 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
FilterBase 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 thescipy.signal.sosfilt()function. The filtering is performed in a streaming fashion, yielding blocks of filtered signal data.- Parameters:
- num
int Number of samples per block.
- num
- Yields:
numpy.ndarrayAn array containing the bandpass-filtered signal for the current block. Each block has the shape (
num,num_channels), wherenum_channelsis inherited from thesource. The last block may contain fewer samples if the total number of samples is not a multiple ofnum.
- 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.