ipqmf#
- diffsptk.IPQMF#
- class diffsptk.InversePseudoQuadratureMirrorFilterBanks(n_band, filter_order, alpha=100, learnable=False, **kwargs)[source]#
See this page for details.
- Parameters:
- n_bandint >= 1 [scalar]
Number of subbands, \(K\).
- filter_orderint >= 2 [scalar]
Order of filter, \(M\).
- alphafloat > 0 [scalar]
Stopband attenuation in dB.
- learnablebool [scalar]
Whether to make filter-bank coefficients learnable.
- **kwargsadditional keyword arguments
Parameters to find optimal filter-bank coefficients.
- forward(y, keepdim=True)[source]#
Reconstruct waveform from subband waveforms.
- Parameters:
- yTensor [shape=(B, K, T) or (K, T)]
Subband waveforms.
- keepdimbool [scalar]
If True, the output shape is (B, 1, T) instead (B, T).
- Returns:
- xTensor [shape=(B, 1, T) or (B, T)]
Reconstructed waveform.
Examples
>>> x = torch.arange(0, 1, 0.25) >>> x tensor([0.0000, 0.2500, 0.5000, 0.7500, 1.0000]) >>> pqmf = diffsptk.PQMF(2, 10) >>> ipqmf = diffsptk.IPQMF(2, 10) >>> x2 = ipqmf(pmqf(x), keepdim=False) >>> x2 tensor([[[8.1887e-04, 2.4754e-01, 5.0066e-01, 7.4732e-01, 9.9419e-01]]])
See also