phase#

class diffsptk.Phase(fft_length, unwrap=False)[source]#

See this page for details.

Parameters:
fft_lengthint >= 2 [scalar]

Number of FFT bins, \(L\).

unwrapbool [scalar]

If True, perform phase unwrapping.

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

Compute phase spectrum.

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

Numerator coefficients.

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

Denominator coefficients.

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

Phase spectrum [\(\pi\) rad].

Examples

>>> x = diffsptk.ramp(3)
>>> phase = diffsptk.Phase(8)
>>> p = phase(x)
>>> p
tensor([ 0.0000, -0.5907,  0.7500, -0.1687,  1.0000])

See also

spec grpdelay