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 filter(). reset() returns the operator to its initial (zero) state.

__init__()#

Methods

__init__()

filter(block)

Filter one block and advance internal state.

process(signal, *[, squeeze])

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

reset()

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

Attributes

abstractmethod filter(block)[source]#

Filter one block and advance internal state.

Return type:

ndarray

in_channels: int#
out_channels: int#
process(signal, *, squeeze=False)[source]#

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

Convenience wrapper around filter() 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 filter() 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