pyFDN.filter_matrix_gallery#
- pyFDN.filter_matrix_gallery(N, matrix_type, *, num_stages=3, sparsity=3.0, stage_matrix_type='hadamard', rng=None)[source]#
Return an FIR (filter) feedback matrix of the requested type.
All types are paraunitary (lossless):
A^T(z^{-1}) A(z) = I. Used as scattering feedback matrices in an FDN (Schlecht & Habets 2020).- Parameters:
N (
int) – Matrix size.matrix_type (
str) – One ofFILTER_MATRIX_TYPES:"random_dense"(dense cascaded paraunitary matrix),"velvet"(sparse velvet-noise feedback matrix), or"from_elementals"(cascade of degree-one lossless factors, polynomial degreeN * num_stages).num_stages (
int) – Number of cascade stages (or degree factor for"from_elementals").sparsity (
float) – Sparsity of the"velvet"type (ignored otherwise).stage_matrix_type (
str) – Stage matrix for"random_dense"and"velvet":"hadamard"or"random"(random orthogonal; avoids the structural double poles at z = ±1 of Hadamard stages).rng (
Generator|int|None) – Generator or integer seed, as for every random function.
- Return type:
- Returns:
ndarray – Feedback matrix of shape
(N, N, L)in z^{-1} convention.Example:: – filter_matrix_gallery(4, “velvet”, num_stages=3, sparsity=3)