ltcdf#

class diffsptk.AllPoleLatticeDigitalFilter(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.

References

[1]

C.-Y. Yu et al., “Differentiable time-varying linear prediction in the context of end-to-end analysis-by-synthesis,” Proceedings of Interspeech, 2024.

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

Apply an all-pole lattice digital filter.

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

The excitation signal.

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

The PARCOR coefficients.

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

The output signal.

Examples

>>> import diffsptk
>>> ltcdf = diffsptk.AllPoleLatticeDigitalFilter(0, 1)
>>> x = diffsptk.step(4)
>>> k = diffsptk.ramp(4)
>>> y = ltcdf(x, k.view(-1, 1))
>>> y
tensor([0., 1., 2., 3., 4.])
diffsptk.functional.ltcdf(x: Tensor, k: Tensor, frame_period: int = 80, ignore_gain: bool = False) → Tensor[source]#

Apply an all-pole lattice digital filter.

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

The excitation 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 output signal.