SpectraOut#

class acoular.base.SpectraOut

Bases: SpectraGenerator

Abstract base class receiving from a source and returning frequency domain signals.

It provides a base class that can be used to create signal processing blocks that receive data from any generating source domain and generates a frequency domain output via the result() generator in block-wise manner.

source

Data source; Generator or derived object.

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 snapshots in output, as given by source.

num_freqs

Number of frequencies in output, as given by source.

freqs

1-D array of frequencies, as given by source.

block_size

The size 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 processes the source data and yields the output block-wise.

This method needs to be implemented by the derived classes.

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. Reshaping a block with block.reshape(n, num_freqs, num_channels) gives direct access to the data by snapshot, frequency, and channel.