TimeReverse#

class acoular.tprocess.TimeReverse

Bases: TimeOut

Calculates the time-reversed signal of a source.

This class takes the input signal from a source and computes the time-reversed version of the signal. It processes the signal in blocks, yielding the time-reversed signal block by block. This can be useful for various signal processing tasks, such as creating echoes or reversing the playback of time signal signals.

source = Instance(SamplesGenerator)

The input data source. It must be an instance of a SamplesGenerator-derived class.

result(num)

Generate the time-reversed version of the input signal block-wise.

This method processes the signal provided by the source in blocks, and for each block, it produces the time-reversed version of the signal. The result is yielded in blocks, with each block containing the time-reversed version of the signal for that segment. The signal is reversed in time by flipping the order of samples within each block.

Parameters:
numint

Number of samples per block.

Yields:
numpy.ndarray

An array containing the time-reversed version of the signal for the current block. Each block will have the shape (num, num_channels), where num_channels is inherited from the source. The last block may contain fewer samples if the total number of samples is not a multiple of num.

Notes

The time-reversal is achieved by reversing the order of samples in each block of the signal. The result() method first collects all the blocks from the source, then processes them in reverse order, yielding the time-reversed signal in blocks. The first block yielded corresponds to the last block of the source signal, and so on, until the entire signal has been processed in reverse.