iltcdf#

class diffsptk.AllZeroLatticeDigitalFilter(filter_order: int, frame_period: int, ignore_gain: bool = False)[source]#

See this page for details.

Parameters:
filter_orderint >= 0

The order of the filter, \(M\).

frame_periodint >= 1

The frame period in samples, \(P\).

ignore_gainbool

If True, perform filtering without the gain.

forward(x: Tensor, k: Tensor) → Tensor[source]#

Apply an all-zero lattice digital filter.

Parameters:
xTensor [shape=(…, T)]

The input signal.

kTensor [shape=(…, T/P, M+1)]

The PARCOR coefficients.

Returns:
outTensor [shape=(…, T)]

The residual signal.

Examples

>>> import diffsptk
>>> iltcdf = diffsptk.AllZeroLatticeDigitalFilter(0, 1)
>>> x = diffsptk.step(4)
>>> k = diffsptk.ramp(1, 5)
>>> y = iltcdf(x, k.view(-1, 1))
>>> y
tensor([1.0000, 0.5000, 0.3333, 0.2500, 0.2000])
diffsptk.functional.iltcdf(x: Tensor, k: Tensor, frame_period: int = 80, ignore_gain: bool = False) → Tensor[source]#

Apply an all-zero lattice digital filter.

Parameters:
xTensor [shape=(…, T)]

The input signal.

kTensor [shape=(…, T/P, M+1)]

The PARCOR coefficients.

frame_periodint >= 1

The frame period in samples, \(P\).

ignore_gainbool

If True, perform filtering without the gain.

Returns:
outTensor [shape=(…, T)]

The residual signal.