pyFDN.dss_to_flamo#

pyFDN.dss_to_flamo(A, B, C, D, m, Fs, nfft=65536, device=None, *, shell=True, dtype=None, sos_filter=None, output_filter=None, post_delay_module=None)[source]#

Build a FLAMO model from delay state-space (A, B, C, D, m).

Signal flow: input -> B -> [recursion: delay -> (optional filter/module) -> A] -> C -> output, with direct path D summed in parallel.

Parameters:
  • A ((N, N) or (N, N, L) array) – Feedback matrix. A 3-D array is a polynomial (FIR) matrix in z^{-1} convention (e.g. paraunitary) and is placed as a FLAMO Filter module.

  • B ((N, num_in) array) – Input gain.

  • C ((num_out, N) array) – Output gain.

  • D ((num_out, num_in) array) – Direct gain.

  • m ((N,) array) – Delay lengths in samples (one per delay line).

  • Fs (float) – Sampling rate in Hz.

  • nfft (int) – FFT size for FLAMO (default 2**16).

  • device (torch device or None) – Device; default is cuda if available else cpu.

  • shell (bool) – If True (default), wrap the core in a Shell with FFT/iFFT. Use pyFDN.flamo_time_response() to obtain a NumPy impulse response. If False, return only the core (e.g. for use as post_delay_module in another dss_to_flamo).

  • dtype (torch.dtype or None) – Optional dtype for FLAMO delay/gain/filter modules (e.g., torch.float64). If None, wrapper defaults are used.

  • sos_filter ((n_sections, 6, N) array or None) – Optional SOS filter in the loop after delays.

  • output_filter ((n_sections, 6, num_out) array or None) – Optional SOS filter cascade applied per output channel after the output gain C (e.g. an output equalizer), matching the output filters of the MATLAB dss2impz.

  • post_delay_module (FLAMO module or None) – Optional module to append after the delay in the recursion (e.g. a Schroeder allpass core). Must have input/output size N. Loop becomes: delay -> post_delay_module -> A.

Returns:

model – If shell=True, FLAMO Shell. Use pyFDN.flamo_time_response() for a NumPy impulse response. If shell=False, the core module (same I/O as B.shape[1] / C.shape[0]).

Return type:

flamo.processor.system.Shell or core