Acoular 25.03 documentation

AutoPowerSpectra

«  IRFFT   ::   fprocess   ::   CrossPowerSpectra  »

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 = Instance(SpectraGenerator)

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

scaling = Enum('power', 'psd')

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 = Bool(True, desc='single sided spectrum')

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

precision = Enum('float64', 'float32', desc='floating-number-precision')

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

digest = Property(depends_on=['source.digest', 'precision', 'scaling', 'single_sided'])

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.

«  IRFFT   ::   fprocess   ::   CrossPowerSpectra  »