grpdelay#

class diffsptk.GroupDelay(fft_length: int, alpha: float = 1, gamma: float = 1)[source]#

See this page for details.

Parameters:
fft_lengthint >= 2

The number of FFT bins, \(L\).

alphafloat > 0

The tuning parameter, \(\alpha\).

gammafloat > 0

The tuning parameter, \(\gamma\).

forward(b: Tensor | None = None, a: Tensor | None = None) Tensor[source]#

Compute group delay.

Parameters:
bTensor [shape=(…, M+1)] or None

The numerator coefficients.

aTensor [shape=(…, N+1)] or None

The denominator coefficients.

Returns:
outTensor [shape=(…, L/2+1)]

The group delay or modified group delay function.

Examples

>>> x = diffsptk.ramp(3)
>>> grpdelay = diffsptk.GroupDelay(8)
>>> g = grpdelay(x)
>>> g
tensor([2.3333, 2.4278, 3.0000, 3.9252, 3.0000])
diffsptk.functional.grpdelay(b: Tensor | None = None, a: Tensor | None = None, *, fft_length: int = 512, alpha: float = 1, gamma: float = 1, **kwargs) Tensor[source]#

Compute group delay.

Parameters:
bTensor [shape=(…, M+1)] or None

The numerator coefficients.

aTensor [shape=(…, N+1)] or None

The denominator coefficients.

fft_lengthint >= 2

The number of FFT bins, \(L\).

alphafloat > 0

The tuning parameter, \(\alpha\).

gammafloat > 0

The tuning parameter, \(\gamma\).

Returns:
outTensor [shape=(…, L/2+1)]

The group delay or modified group delay function.

See also

phase spec