AutoPowerSpectra#

class acoular.fprocess.AutoPowerSpectra

Bases: SpectraOut

Compute the real-valued auto-power spectra from multi-channel frequency-domain data.

The auto-power spectra provide a measure of the power contained in each frequency bin for each channel. This class processes spectral data from the source block-by-block, applying scaling and precision adjustments as configured by the scaling and precision attributes.

source

The data source that provides frequency-domain spectra, implemented as an instance of SpectraGenerator or a derived object.

scaling

Specifies the scaling method for the auto-power spectra. Options are:

  • 'power': Outputs the raw power of the spectra.

  • 'psd': Outputs the Power Spectral Density (PSD), normalized by the block size and sampling frequency.

single_sided

A Boolean flag indicating whether the input spectra are single-sided. Default is True.

precision

Specifies the floating-point precision of the computed auto-power spectra. Options are 'float64' and 'float32'. Default is 'float64'.

digest

A unique identifier based on the computation properties.

result(num=1)

Generate real-valued auto-power spectra blocks.

This generator computes the auto-power spectra by taking the element-wise squared magnitude of the input spectra and applying the appropriate scaling. The results are yielded block-by-block with the specified number of snapshots.

Parameters:
numint, optional

Number of snapshots in each output block. Default is 1.

Yields:
numpy.ndarray

(num, num_channels * num_freqs). The last block may contain fewer snapshots if the input data does not completely fill the requested block size.

Notes

  • The auto-power spectra are computed as the squared magnitude of the spectra \(|S(f)|^2\), where \(S(f)\) is the frequency-domain signal.

  • Scaling is applied based on the configuration of the scaling and single_sided attributes.

  • The floating-point precision of the output is determined by the precision attribute.

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