pyFDN.td.TimeOperator#

class pyFDN.td.TimeOperator[source]#

Abstract class. Parent of all classes belonging to the td-graph group. A stateful (T, in_channels) -> (T, out_channels) time-domain block. Subclasses set in_channels / out_channels and implement process_block(). reset() returns the operator to its initial (zero) state.

__init__()#

Methods

__init__()

process_block(block)

Process one block and advance internal state.

process_signal(signal, *[, squeeze])

Process a whole signal in one call, from the current state.

reset()

Clear internal state (no-op for stateless operators).

Attributes

in_channels: int#
out_channels: int#
abstractmethod process_block(block)[source]#

Process one block and advance internal state.

Return type:

ndarray

process_signal(signal, *, squeeze=False)[source]#

Process a whole signal in one call, from the current state.

Convenience wrapper around process_block() for the common case of rendering an operator tree offline. Operators that process in blocks internally (Recursion) do so regardless of how the signal is handed to them, so this gives the same result as streaming signal through process_block() block by block.

Parameters:
  • signal (ArrayLike) – Input of shape (num_samples,) or (num_samples, in_channels).

  • squeeze (bool) – Squeeze singleton output channels (default False).

Returns:

Output of shape (num_samples, out_channels).

Return type:

ndarray

reset()[source]#

Clear internal state (no-op for stateless operators).

Return type:

None