FiltOctave#
- class acoular.tprocess.FiltOctave
Bases:
FilterOctave or third-octave bandpass filter (causal, with non-zero phase delay).
This class implements a bandpass filter that conforms to octave or third-octave frequency band standards. The filter is designed using a second-order section (SOS) Infinite Impulse Response (IIR) approach.
The filtering process introduces a non-zero phase delay due to its causal nature. The center frequency and the octave fraction determine the frequency band characteristics.
See also
FilterThe base class implementing a general IIR filter.
FiltFiltOctaveOctave or third-octave bandpass filter with zero-phase distortion.
- band
The center frequency of the octave or third-octave band. Default is
1000.
- fraction
Defines whether the filter is an octave-band or third-octave-band filter.
'Octave': Full octave band filter.'Third octave': Third-octave band filter.
Default is
'Octave'.
- order
The order of the IIR filter, which affects the steepness of the filter’s roll-off. Default is
3.
- sos
Second-order sections representation of the filter coefficients. This property depends on
band,fraction,order, and the source’s digest.
- 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.