ipqmf#

diffsptk.IPQMF#

alias of PseudoQuadratureMirrorFilterBankSynthesis

class diffsptk.PseudoQuadratureMirrorFilterBankSynthesis(n_band, filter_order, alpha=100, learnable=False, **kwargs)[source]#

See this page for details.

Parameters:
n_bandint >= 1

Number of subbands, \(K\).

filter_orderint >= 2

Order of filter, \(M\).

alphafloat > 0

Stopband attenuation in dB.

learnablebool

Whether to make filter-bank coefficients learnable.

**kwargsadditional keyword arguments

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, keepdim=True)[source]#

Reconstruct waveform from subband waveforms.

Parameters:
yTensor [shape=(B, K, T) or (K, T)]

Subband waveforms.

keepdimbool

If True, the output shape is (B, 1, T) instead (B, T).

Returns:
outTensor [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

pqmf interpolate