pyFDN package#
Subpackages#
- pyFDN.auxiliary package
- Submodules
- pyFDN.auxiliary.acoustics module
- pyFDN.auxiliary.allpass module
- pyFDN.auxiliary.audio module
- pyFDN.auxiliary.delay module
- pyFDN.auxiliary.flamo module
- pyFDN.auxiliary.flamo_graph module
- pyFDN.auxiliary.lindsey_fox module
- pyFDN.auxiliary.marimo_utils module
- pyFDN.auxiliary.math module
- pyFDN.auxiliary.modal module
- pyFDN.auxiliary.plot module
- pyFDN.auxiliary.poles module
- pyFDN.auxiliary.utils module
- Module contents
- pyFDN.eq package
- pyFDN.resources package
- pyFDN.td package
- Submodules
- pyFDN.td.connectors module
- pyFDN.td.operators module
- Module contents
- pyFDN.train package
- Subpackages
- pyFDN.train.features package
- pyFDN.train.losses package
- Submodules
- pyFDN.train.losses.base module
- pyFDN.train.losses.distances module
- pyFDN.train.losses.features module
- pyFDN.train.losses.match module
- pyFDN.train.losses.parameter module
- pyFDN.train.losses.reductions module
- pyFDN.train.losses.spectral module
- pyFDN.train.losses.temporal module
- Module contents
- Submodules
- pyFDN.train.build module
- pyFDN.train.engine module
- pyFDN.train.filters module
- pyFDN.train.params module
- pyFDN.train.response module
- Module contents
- Subpackages
Submodules#
pyFDN.dss module#
The delay state-space (DSS) matrices of an FDN.
- class pyFDN.dss.DSS(delays, A, B, C, D)[source]#
Bases:
NamedTupleDelay state-space system: the standard matrices of an FDN, nothing else.
delaysholds one length per delay line, in samples.Ais the(N, N)feedback matrix,Bthe(N, inputs)input gains,Cthe(outputs, N)output gains andDthe(outputs, inputs)direct path. A filter (FIR) feedback matrix is not a DSS matrix; it goes into a graph’spost_matrixhook, as atd.MatrixFIRor apyFDN.fir_matrix_module().The field order is the argument order of the
dss_to_*functions, so a system unpacks straight into them. Filters and the sample rate are not part of the system; pass them alongside, e.g.pyFDN.dss_to_td(*dss, post_delay=sos).
pyFDN.process module#
One-shot processing of a delay state-space (DSS) system.
- pyFDN.process.process_dss(delays, A, B, C, D, signal)[source]#
Process a signal through a delay state-space system.
One-shot form of
dss_to_td(...).process_signal(signal): a freshpyFDN.tdgraph is built for every call. The system comes first, as inpyFDN.dss_to_impz()andscipy.signal.lfilter(), so aDSSunpacks straight in:process_dss(*dss, x). With filters, build the graph:dss_to_td(*dss, **filters).process_signal(x, squeeze=True).- Parameters:
delays (
ArrayLike) – Positive delay lengths in samples, shape(N,).A (
ArrayLike) – Feedback, input, output, and direct gain matrices.B (
ArrayLike) – Feedback, input, output, and direct gain matrices.C (
ArrayLike) – Feedback, input, output, and direct gain matrices.D (
ArrayLike) – Feedback, input, output, and direct gain matrices.signal (
ArrayLike) – Input of shape(num_samples,)or(num_samples, num_inputs).
- Returns:
Processed signal with singleton dimensions removed.
- Return type:
pyFDN.references module#
Citation helpers backed by the bibliography distributed with pyFDN.
pyFDN.save module#
Save and load any pyFDN object, and the presets that ship with pyFDN.
A DSS is saved as readable JSON: its five fields as nested
lists, one matrix row per line, plus the pyFDN version that wrote it.
Anything else – a td graph, a FLAMO model – is two pickles: a header
naming the pyFDN and Python versions that wrote it, then the object itself,
written with cloudpickle so FLAMO models (which hold lambdas) save too.
There is no format to maintain for these: when a refactor breaks an old file,
map the moved class in RENAMED or rebuild the object, then
resave_fdn() it. Loading a pickle runs code from the file, so only load
pickles you or pyFDN wrote.
- pyFDN.save.RENAMED: dict[tuple[str, str], tuple[str, str]] = {}#
(old module, old name) -> (new module, new name)for classes that moved since a pickle was saved, e.g.{("pyFDN.dss", "DSS"): ("pyFDN.system", "DSS")}.
- pyFDN.save.available_fdn_presets()[source]#
Return the names accepted by
load_fdn_preset().
- pyFDN.save.load_fdn(path)[source]#
Load an object written by
save_fdn().A JSON file is read as data. A pickle runs code from the file, so only load pickles you trust.
- Return type:
- pyFDN.save.load_fdn_preset(name)[source]#
Return a packaged FDN as a
DSS.The colorless presets come from Dal Santo et al., Differentiable Feedback Delay Network For Colorless Reverberation (MIT licence, see
pyFDN/resources/ATTRIBUTION.md). They were designed at 48 kHz.- Return type:
- pyFDN.save.resave_fdn(path)[source]#
Rewrite a saved file with the installed pyFDN, applying
RENAMED.- Return type:
- pyFDN.save.save_fdn(obj, path)[source]#
Save
objtogether with the version of pyFDN that wrote it.A
DSSbecomes readable JSON. Anything else that pickles – atdgraph, a FLAMO model, a(dss, filters)pair – is pickled. A FLAMO model’s lambdas are stored as Python bytecode, so its file loads only on the same Python minor version; nothing else depends on it.- Return type:
Module contents#
See API Reference for full documentation of all functions and classes.