SpectraGenerator#

class acoular.base.SpectraGenerator

Bases: Generator

Interface for any generating multi-channel signal frequency domain processing block.

It provides a common interface for all SpectraGenerator classes, which generate an output via the generator result() in block-wise manner. This class has no real functionality on its own and should not be used directly.

num_freqs

Number of frequencies

freqs

1-D array of frequencies

block_size

The length of the block used to calculate the spectra

digest

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

abstractmethod result(num=1)

Python generator that yields the output block-wise.

Parameters:
numint, optional

Maximum number of spectral snapshots per block to yield. Defaults to 1.

Yields:
numpy.ndarray

Two-dimensional spectral data block with shape (n, num_freqs * num_channels), where n is the number of snapshots in the yielded block and is at most num. The final block may contain fewer than num snapshots.

The second axis stores the spectra in frequency-major order with channels interlaced for each frequency bin. Reshagping a block with block.reshape(n, num_freqs, num_channels) gives direct access to the data by snapshot, frequency, and channel.

sample_freq

Sampling frequency of the signal, defaults to 1.0

num_samples

Number of signal samples. -1 denotes an indefinite stream.

num_channels

Number of channels