SpectraOut#
- class acoular.base.SpectraOut
Bases:
SpectraGeneratorAbstract base class receiving from a
sourceand returning frequency domain signals.It provides a base class that can be used to create signal processing blocks that receive data from any generating
sourcedomain and generates a frequency domain output via theresult()generator in block-wise manner.- source
Data source;
Generatoror 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), wherenis the number of snapshots in the yielded block and is at mostnum. The final block may contain fewer thannumsnapshots.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.