Acoular 25.01 documentation

Generator

«  base   ::   base   ::   SamplesGenerator  »

Generator

class acoular.base.Generator

Bases: ABCHasStrictTraits

Interface for any generating signal processing block.

It provides a common interface for all classes, which generate an output via the generator result() in block-wise manner. It has a common set of traits that are used by all classes that implement this interface. This includes the sampling frequency of the signal (sample_freq), the number of samples (num_samples), and the number of channels (num_channels). A private trait digest is used to store the internal identifier of the object, which is a hash of the object’s attributes. This is used to check if the object’s internal state has changed.

sample_freq = Float(1.0, desc='sampling frequency')

Sampling frequency of the signal, defaults to 1.0

num_samples = CInt

Number of signal samples

num_channels = CInt

Number of channels

abstract result(num)

Python generator that yields the output block-wise.

This method needs to be implemented by the derived classes.

Parameters:
numint

The size of the first dimension of the blocks to be yielded

Yields:
numpy.ndarray

Two-dimensional output data block of shape (num, …)

«  base   ::   base   ::   SamplesGenerator  »