dfs#

diffsptk.IIR#

alias of InfiniteImpulseResponseDigitalFilter

class diffsptk.InfiniteImpulseResponseDigitalFilter(b=[1], a=[1], ir_length=None)[source]#

See this page for details. Note that numerator and denominator coefficients are fixed in the current implementation.

Parameters:
bList [shape=(M+1,)]

Numerator coefficients.

aList [shape=(N+1,)]

Denominator coefficients.

ir_lengthint >= 1 [scalar]

Length of impulse response.

forward(x)[source]#

Apply an approximated IIR digital filter.

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

Input waveform.

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

Filterd waveform.

Examples

>>> x = diffsptk.ramp(4)
>>> dfs = diffsptk.IIR(b=[1, -0.97])
>>> y = dfs(x)
>>> y
tensor([0.0000, 1.0000, 1.0300, 1.0600, 1.0900])

See also

df2