PowerSpectraImport#

class acoular.spectra.PowerSpectraImport

Bases: PowerSpectra

Provides a dummy class for using pre-calculated CSMs.

This class does not calculate the CSM. Instead, the user can inject one or multiple existing CSMs by setting the csm attribute. This can be useful when algorithms shall be evaluated with existing CSMs. The frequency or frequencies contained by the CSM must be set via the frequencies attribute. The attr:num_channels attributes is determined on the basis of the CSM shape. In contrast to the PowerSpectra object, the attributes sample_freq, source, block_size, window, overlap, cached, and num_blocks have no functionality.

csm = Property()

The cross-spectral matrix stored in an array of shape (n, m, m) of complex for n frequencies and m channels.

frequencies = Union(None, CArray, Float)

The frequencies included in the CSM in ascending order. Accepts list, array, or a single float value.

num_channels = Property(depends_on=['digest'])

Number of time data channels, inferred from the shape of the CSM.

source = Enum(None)

PowerSpectraImport does not consume time data; source is always None.

sample_freq = Enum(None)

Sampling frequency of the signal. Default is None

block_size = Enum(None)

Block size for FFT, non-functional in this class.

window = Enum(None)

Windowing method, non-functional in this class.

overlap = Enum(None)

Overlap between blocks, non-functional in this class.

cached = Enum(False)

Caching capability, always disabled.

num_blocks = Enum(None)

Number of FFT blocks, always None.

digest = Property(depends_on=['_csmsum'])

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

basename = Property(depends_on=['digest'])

Name of the cache file without extension. (read-only)

fftfreq()

Return the Discrete Fourier Transform sample frequencies.

The method checks the type of frequencies and returns the corresponding frequency array. If frequencies is not defined, a warning is raised.

Returns:
numpy.ndarray

Array containing the frequencies.