- class flamo.auxiliary.scattering.ScatteringMapping(N: int, n_stages: int = 3, sparsity: int = 3, gain_per_sample: float = 0.9999, pulse_size: int = 1, m_L: tensor | None = None, m_R: tensor | None = None, device: str = 'cpu')
Class mapping an orthogonal matrix to a paraunitary matrix using sparse scattering.
It is parameterized as a set of \(K\) orthogonal mixing matrices (input) \(\mathbf{U}_k\) each followed by a set of parallel delays.
\[\mathbf{U}(z) = \mathbf{D}_{\mathbf{m}_{K+1}}(z)\mathbf{U}_K\cdots\mathbf{U}_2\mathbf{D}_{\mathbf{m}_2}(z)\mathbf{U}_1\mathbf{D}_{\mathbf{m}_1}(z)\mathbf{U}_0\mathbf{D}_{\mathbf{m}_0}(z),\]where \(\mathbf{U}_0, \dots, \mathbf{U}_K\) are \(N \times N\) orthogonal matrices and \(\mathbf{m}_0, \dots, \mathbf{m}_{K+1}\) are vectors of \(N\) integer delays. This parameterization ensures that the scattering matrix is paraunitary and lossless.
For more details, refer to the paper Scattering in Feedback Delay Networks by Schlecht, S. J. et al. Adapted to python by: Dal Santo G.
- Arguemnts
N (int): The size of the orthogonal matrix.
n_stages (int): The number of stages in the paraunitary matrix. Defaults to 3.
sparsity (int): The sparsity of the generated FIR filters. Defaults to 3.
gain_per_sample (float): The gain per sample for homogenous attenuation. Defaults to 0.9999.
pulse_size (int): The size of the pulse. Defaults to 1.
m_L (Tensor): The left shift \(\mathbf{m}_{K+1}\). Defaults to None.
m_R (Tensor): The right shift \(\mathbf{m}_{0}\). Defaults to None.
device (str): The device to run the calculations on. Defaults to ‘cpu’.
- forward(U)
Forward pass of the scattering mapping.
- flamo.auxiliary.scattering.cascaded_paraunit_matrix(U: tensor, n_stages: int = 3, gain_per_sample: float = 0.9999, sparsity: int = 3, pulse_size: int = 1, m_L: tensor | None = None, m_R: tensor | None = None)
Creates paraunitary matrix from input orthogonal matrix. For details refer to
flamo.auxiliary.scattering.ScatteringMapping
- Arguments:
U (Tensor): The input orthogonal matrix of size (n_stages+1, N, N).
n_stages (int): The number of stages in the paraunitary matrix.
gain_per_sample (float): The gain per sample for homogenous attenuation.
sparsity (int): The sparsity.
m_L (Tensor): The left shift.
m_R (Tensor): The right shift.
- Returns:
Tensor: The paraunitary scattering matrix.