TriggerAIAABenchmark#

class acoular.aiaa.aiaa.TriggerAIAABenchmark

Bases: TimeSamplesAIAABenchmark

Container for tacho data in *.h5 format.

This class loads tacho data from h5 files as specified in “Microphone Array Benchmark b11: Rotating Point Sources” (https://doi.org/10.14279/depositonce-8460) and and provides information about this data.

result(num=128)

Generate blocks of time-domain data iteratively.

The result() method is a Python generator that yields blocks of time-domain data of the specified size. Data is either read from an HDF5 file (if file is set) or from a NumPy array (if data is directly provided).

Parameters:
numint, optional

The size of each block to be yielded, representing the number of time-domain samples per block.

Yields:
numpy.ndarray

A 2D array of shape (num, num_channels) representing a block of time-domain data. The last block may have fewer than num samples if the total number of samples is not a multiple of num.

Raises:
OSError

If no samples are available (i.e., num_samples is 0).

Examples

Create a generator and access blocks of data:

>>> import numpy as np
>>> from acoular.sources import TimeSamples
>>> ts = TimeSamples(data=np.random.rand(1000, 4), sample_freq=51200)
>>> generator = ts.result(num=256)
>>> for block in generator:
...     print(block.shape)
(256, 4)
(256, 4)
(256, 4)
(232, 4)

Note that the last block may have fewer that num samples.

file

Full path to the .h5 file containing time-domain data.

basename

Basename of the .h5 file, set automatically from the file attribute.

num_channels

Number of input channels in the time data, set automatically based on the loaded data or specified array.

num_samples

Total number of time-domain samples, set automatically based on the loaded data or specified array.

data

A 2D NumPy array containing the time-domain data, shape (num_samples, num_channels).

metadata

Metadata loaded from the HDF5 file, if available.

digest

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

sample_freq

Sampling frequency of the signal, defaults to 1.0