pyFDN.dss_to_td#

pyFDN.dss_to_td(delays, A, B, C, D, *, post_delay=None, post_matrix=None, post_output=None, block_size=None)[source]#

Assemble a delay state-space (DSS) system as a stateful td graph.

The returned graph contains the input, feedback, output, and direct gains; the delay bank; and the filter hooks given. It can process a whole signal with process_signal, process a stream with process_block, and return to zero state with reset.

The delay bank breaks the feedback loop, so the graph processes blocks of up to block_size samples and implements delays exactly. A DSS unpacks straight in: dss_to_td(*dss, post_delay=sos).

Parameters:
  • delays (ArrayLike) – Positive delay lengths in samples, one per delay line.

  • A (ArrayLike) – Feedback matrix, (N, N). A filter (FIR) feedback matrix is a graph operator, not a DSS matrix: put it on the feedback path, e.g. dss_to_td(delays, np.eye(N), B, C, D, post_matrix=td.MatrixFIR(fir)).

  • B (ArrayLike) – Input, output, and direct gain matrices.

  • C (ArrayLike) – Input, output, and direct gain matrices.

  • D (ArrayLike) – Input, output, and direct gain matrices.

  • post_delay (ArrayLike | TimeOperator | Any | None) – In-loop (after the delays), feedback-path (after A) and wet-signal (after C) hooks. Each is an (sections, 6, channels) SOS bank (placed as a SOSBank), a TimeOperator, or any object with a process_block(block) method.

  • post_matrix (ArrayLike | TimeOperator | Any | None) – In-loop (after the delays), feedback-path (after A) and wet-signal (after C) hooks. Each is an (sections, 6, channels) SOS bank (placed as a SOSBank), a TimeOperator, or any object with a process_block(block) method.

  • post_output (ArrayLike | TimeOperator | Any | None) – In-loop (after the delays), feedback-path (after A) and wet-signal (after C) hooks. Each is an (sections, 6, channels) SOS bank (placed as a SOSBank), a TimeOperator, or any object with a process_block(block) method.

  • block_size (int | None) – Internal block size. Defaults to the shorter of 4096 samples and the shortest delay. It must be positive and cannot exceed the shortest delay.

Return type:

TimeOperator

Returns:

  • TimeOperator – A stateful graph from FDN inputs to outputs.

  • The delay lines are the RecursionState at

  • graph.ops[0].ops[1].state; e.g. free decay from noise in every line:: – graph = dss_to_td(delays, A, B, C, D) graph.ops[0].ops[1].state.fill_noise() y = graph.process_signal(np.zeros(fs))