pyFDN.td.TimeVaryingMatrix#

class pyFDN.td.TimeVaryingMatrix(N, cycles_per_second, amplitude, fs, spread)[source]#

Stateful sinusoidally modulated orthogonal mixing matrix (time-varying feedback).

Each adjacent channel pair is rotated by a sinusoidally modulated angle, so the operator is orthogonal at every sample but never constant. Sitting on a Recursion feedback path, e.g. Series([Gain(A), TimeVaryingMatrix(N, 1.5, 0.35, fs, 0.1)]), it makes the loop genuinely time-varying – there is no static transfer function. This is the operator form of the post_matrix argument of pyFDN.process_fdn().

Translation of the MATLAB implementation timeVaryingMatrix.m from fdnToolbox. Original MATLAB code: (c) Sebastian Jiro Schlecht, 2019. Python translation: Alma Hova, 2026.

Parameters:
  • N (int) – Number of channels (the matrix is N x N). Must be a positive even integer.

  • cycles_per_second (float) – Frequency of the time variation in Hz (controls oscillation speed).

  • amplitude (float) – Maximum angle deflection in radians (strength of modulation).

  • fs (float) – Sampling rate in Hz.

  • spread (float) – Randomness factor (controls how differently each eigenmode behaves).

Variables:
  • num_pairs (int) – Number of eigenmode pairs (N // 2), i.e. independent 2-D rotation planes.

  • angle_amplitude (phase, frequency,) – Per-pair modulation parameters, drawn from the global NumPy RNG at construction. Seed np.random.seed beforehand for a reproducible modulation.

  • sample_index (int) – Current sample index; the modulation clock.

__init__(N, cycles_per_second, amplitude, fs, spread)[source]#

Methods

__init__(N, cycles_per_second, amplitude, ...)

filter(block)

Apply the time-varying orthogonal transformation to one block.

process(signal, *[, squeeze])

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

reset()

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

Attributes

in_channels

out_channels

filter(block)[source]#

Apply the time-varying orthogonal transformation to one block.

The operation is equivalent to constructing the block-diagonal rotation matrix from rotation_matrix_from_angles at every sample, but applies the 2-D rotations directly to the whole input block.

Return type:

ndarray

reset()[source]#

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

Return type:

None