dfs#
- diffsptk.IIR#
alias of
InfiniteImpulseResponseDigitalFilter
- class diffsptk.InfiniteImpulseResponseDigitalFilter(b=None, a=None, ir_length=None, learnable=False)[source]#
See this page for details.
- Parameters:
- bList [shape=(M+1,)] or None
The numerator coefficients.
- aList [shape=(N+1,)] or None
The denominator coefficients.
- ir_lengthint >= 1 or None
The length of the truncated impulse response. If given, the filter is approximated by an FIR filter.
- learnablebool
If True, the filter coefficients are learnable.
- forward(x)[source]#
Apply an IIR digital filter to the input waveform.
- Parameters:
- xTensor [shape=(…, T)]
The input waveform.
- Returns:
- outTensor [shape=(…, T)]
The filtered 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])
- diffsptk.functional.dfs(x, b=None, a=None, ir_length=None)[source]#
Apply an IIR digital filter to the input waveform.
- Parameters:
- xTensor [shape=(…, T)]
The input waveform.
- bTensor [shape=(M+1,)] or None
The numerator coefficients.
- aTensor [shape=(N+1,)] or None
The denominator coefficients.
- ir_lengthint >= 1 or None
The length of the truncated impulse response. If given, the filter is approximated by an FIR filter.
- Returns:
- outTensor [shape=(…, T)]
The filtered waveform.
See also