Acoular 25.07 documentation

Mixer

«  SpatialInterpolatorConstantRotation   ::   tprocess   ::   TimePower  »

Mixer

class acoular.tprocess.Mixer

Bases: TimeOut

Mix signals from multiple sources into a single output.

This class takes a primary time signal source and a list of additional sources with the same sampling rates and channel counts across all primary time signal source, and outputs a mixed signal. The mixing process is performed block-wise using a generator.

If one of the additional sources holds a shorter signal than the other sources the result() method will stop yielding mixed time signal at that point.

source = Instance(SamplesGenerator)

The primary time signal source. It must be an instance of a SamplesGenerator-derived class.

sources = List(Instance(SamplesGenerator, ()))

A list of additional time signal sources to be mixed with the primary source, each must be an instance of SamplesGenerator.

sample_freq = Delegate('source')

The sampling frequency of the primary time signal, delegated from source.

num_channels = Delegate('source')

The number of channels in the output, delegated from source.

num_samples = Delegate('source')

The number of samples in the output, delegated from source.

sdigest = Str()

Internal identifier that tracks changes in the sources list.

digest = Property(depends_on=['source.digest', 'sdigest'])

A unique identifier for the Mixer instance, based on the primary source and the list of additional sources.

result(num)

Generate mixed time signal data in blocks of num samples.

This generator method retrieves time signal data from all sources and sums them together to produce a combined output. The data from each source is processed in blocks of the same size, ensuring synchronized mixing.

Note

Yielding stops when one of the additionally provied signals ends; i.e. if one of the additional sources holds a signal of shorter length than that of the primary source that (shorter) signal forms the lower bound of the length of the mixed time signal yielded.

Parameters:
numint

Number of samples per block.

Yields:
numpy.ndarray

An array containing the mixed time samples in blocks of shape (num, num_channels), where num_channels is inhereted from the TimeOut base class. The last block may contain fewer samples if the total number of samples is not a multiple of num.

«  SpatialInterpolatorConstantRotation   ::   tprocess   ::   TimePower  »