zerodf#
- class diffsptk.AllZeroDigitalFilter(filter_order, frame_period, ignore_gain=False)[source]#
See this page for details.
- Parameters:
- filter_orderint >= 0 [scalar]
Order of filter coefficients, \(M\).
- frame_periodint >= 1 [scalar]
Frame period, \(P\).
- ignore_gainbool [scalar]
If True, perform filtering without gain.
- forward(x, h)[source]#
Apply an all-zero digital filter.
- Parameters:
- xTensor [shape=(…, T)]
Excitation signal.
- hTensor [shape=(…, T/P, M+1)]
Filter coefficients.
- Returns:
- yTensor [shape=(…, T)]
Output signal.
Examples
>>> x = diffsptk.step(4) >>> h = diffsptk.ramp(4) >>> zerodf = diffsptk.AllZeroDigitalFilter(0, 1) >>> y = zerodf(x, h.view(-1, 1)) >>> y tensor([[0., 1., 2., 3., 4.]])
See also