pyFDN.sos_filter_module#

pyFDN.sos_filter_module(sos, nfft, *, device=None, dtype=None, alias_decay_db=0, requires_grad=False)[source]#

Build a FLAMO parallelSOSFilter from an SOS coefficient array.

Parameters:
  • sos (ndarray) – Shape (n_sections, 6, n_channels). Each section is [b0, b1, b2, a0, a1, a2] (e.g. from SDN wall_filters_sos).

  • nfft (int) – FFT size for the FLAMO module.

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

  • dtype (torch.dtype or None) – Optional dtype for module parameters (e.g., torch.float64). If None, uses float32 to preserve previous behavior.

  • alias_decay_db (float) – FLAMO alias decay in dB.

  • requires_grad (bool) – Whether the SOS coefficients are trainable. The sections are normalized to a0 = 1 here rather than by flamo’s normalize_a0 map, whose in-place writes break autograd; a0 is then held at 1 by masking its gradient, so the trained coefficients stay a valid SOS array.

Returns:

FLAMO parallelSOSFilter with coefficients assigned.

Return type:

flamo.processor.dsp.parallelSOSFilter