TimeReverse#
- class acoular.tprocess.TimeReverse
Bases:
TimeOutCalculates 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
sourcein 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:
- num
int Number of samples per block.
- num
- Yields:
numpy.ndarrayAn array containing the time-reversed version of the signal for the current block. Each block will have the shape (
num,num_channels), wherenum_channelsis inherited from thesource. The last block may contain fewer samples if the total number of samples is not a multiple ofnum.
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.