TimePower#
- class acoular.tprocess.TimePower
Bases:
TimeOutCalculate the time-dependent power of a signal by squaring its samples.
This class computes the power of the input signal by squaring the value of each sample. It processes the signal in blocks, making it suitable for large datasets or real-time signal processing. The power is calculated on a per-block basis, and each block of the output is yielded as a NumPy array.
- Attributes:
- sourceSamplesGenerator
The input data source, which provides the time signal or signal samples to be processed. It must be an instance of
SamplesGeneratoror any derived class that provides a result() method.
- source
The input data source. It must be an instance of a
SamplesGenerator-derived class.
- result(num)
Generate the time-dependent power of the input signal in blocks.
This method iterates through the signal samples provided by the
sourceand calculates the power by squaring each sample. The output is yielded block-wise to facilitate processing large signals in chunks.- Parameters:
- num
int Number of samples per block.
- num
- Yields:
numpy.ndarrayAn array containing the squared samples from the
source. Each block will have the shape (num,num_channels), wherenum_channelsis inhereted from theTimeOutbase class. The last block may contain fewer samples if the total number of samples is not a multiple ofnum.
- 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 samples in output, as given by
source.
- digest
A unique identifier for the generator, based on its properties. (read-only)