ipqmf#
- diffsptk.IPQMF#
- class diffsptk.PseudoQuadratureMirrorFilterBankSynthesis(n_band: int, filter_order: int, alpha: float = 100, learnable: bool = False, **kwargs)[source]#
See this page for details.
- Parameters:
- n_bandint >= 1
The number of subbands, \(K\).
- filter_orderint >= 2
The order of the filters, \(M\).
- alphafloat > 0
The stopband attenuation in dB.
- learnablebool
Whether to make the filter-bank coefficients learnable.
- **kwargsadditional keyword arguments
The parameters to find optimal filter-bank coefficients.
References
[1]T. Q. Nguyen, “Near-perfect-reconstruction pseudo-QMF banks,” IEEE Transactions on Signal Processing, vol. 42, no. 1, pp. 65-76, 1994.
[2]F. Cruz-Roldan et al., “An efficient and simple method for designing prototype filters for cosine-modulated filter banks,” IEEE Signal Processing Letters, vol. 9, no. 1, pp. 29-31, 2002.
- forward(y: Tensor, keepdim: bool = True) Tensor [source]#
Reconstruct waveform from subband waveforms.
- Parameters:
- yTensor [shape=(B, K, T) or (K, T)]
The subband waveforms.
- keepdimbool
If True, the output shape is (B, 1, T) instead of (B, T).
- Returns:
- outTensor [shape=(B, 1, T) or (B, T)]
The 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