pyFDN.build_fdn#

pyFDN.build_fdn(*, delays=None, N=None, rt=2.0, matrix='orthogonal', feedback=None, input_gain=None, output_gain=None, direct=0.0, trainable=None, train_rt=False, fs=48000.0, nfft=16384, alias_decay_db=None, device=None, dtype=None, rng=None)[source]#

Build a trainable flamo Shell from a config.

Parameters:
  • delays (ndarray | None) – Explicit integer delay lengths in samples. If omitted, N coprime delays are sampled (pyFDN.sample_delay_lengths()).

  • N (int | None) – Number of delay lines when delays is omitted.

  • rt (float | tuple[float, float] | None) – Reverberation time in seconds, realized as an AttenuationFilter with design="first_order_shelf". None builds a lossless FDN. For any other design, build the module yourself and pass it to trainable_from_build() as post_delay=.

  • matrix (Literal['orthogonal', 'random']) – Feedback-matrix parametrization.

  • feedback (ndarray | None) – Initial (N, N) feedback matrix; defaults to a random SO(N) matrix.

  • input_gain (ndarray | None) – B ((N, n_in)) and C ((n_out, N)); default ones / sqrt(N).

  • output_gain (ndarray | None) – B ((N, n_in)) and C ((n_out, N)); default ones / sqrt(N).

  • direct (float | ndarray) – Direct path D; a scalar fills (n_out, n_in).

  • trainable (Trainable | None) – Which gain groups are trained (default Trainable).

  • train_rt (bool) – Whether rt is a parameter rather than a design. Off by default, since the decay is usually designed from a measured reverberation time. What trains is the reverberation time itself, which keeps the loop contractive for every value it can take – unlike raw filter coefficients, which nothing holds inside the unit circle.

  • alias_decay_db (float | None) – Anti-time-aliasing decay, see trainable_from_build(). None (default) picks it from rt: LOSSLESS_ALIAS_DECAY_DB when rt is None, else 0. A lossless FDN has every pole exactly on the unit circle, where the FFT-domain evaluation breaks down entirely; a decaying FDN damps itself within nfft samples and needs no nudge. Pass 0.0 to opt out.

  • fs (float)

  • nfft (int)

  • device (Any)

  • dtype (Any)

  • rng (Generator | int | None) – Seed for the sampled delays / default feedback matrix.

Return type:

Any