ipqmf#

diffsptk.IPQMF#

alias of PseudoQuadratureMirrorFilterBankSynthesis

class diffsptk.PseudoQuadratureMirrorFilterBankSynthesis(n_band: int, filter_order: int, alpha: float = 100, learnable: bool = False, device: device | None = None, dtype: dtype | None = None, **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.

devicetorch.device or None

The device of this module.

dtypetorch.dtype or None

The data type of this module.

**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

>>> import diffsptk
>>> pqmf = diffsptk.PQMF(2, 10)
>>> ipqmf = diffsptk.IPQMF(2, 10)
>>> x = diffsptk.ramp(1, 4)
>>> x2 = ipqmf(pqmf(x))
>>> x2.squeeze()
tensor([0.5372, 1.9768, 2.9893, 3.9759])

See also

pqmf interpolate