pqmf#

diffsptk.PQMF#

alias of PseudoQuadratureMirrorFilterBanks

class diffsptk.PseudoQuadratureMirrorFilterBanks(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(x)[source]#

Decompose waveform into subband waveforms.

Parameters:
xTensor [shape=(B, 1, T) or (B, T) or (T,)]

Original waveform.

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

Subband waveforms.

Examples

>>> x = diffsptk.ramp(0, 1, 0.25)
>>> pqmf = diffsptk.PQMF(2, 10)
>>> y = pmqf(x)
>>> y
tensor([[[ 0.1605,  0.4266,  0.6927,  0.9199,  1.0302],
         [-0.0775, -0.0493, -0.0211, -0.0318,  0.0743]]])

See also

ipqmf decimate