acorr#

class diffsptk.Autocorrelation(frame_length: int, acr_order: int, out_format: str | int = 'naive')[source]#

See this page for details.

Parameters:
frame_lengthint > M

The frame length in samples, \(L\).

acr_orderint >= 0

The order of the autocorrelation, \(M\).

out_format[‘naive’, ‘normalized’, ‘biased’, ‘unbiased’]

The type of the autocorrelation.

forward(x: Tensor) Tensor[source]#

Estimate the autocorrelation of the input waveform.

Parameters:
xTensor [shape=(…, L)]

The framed waveform.

Returns:
outTensor [shape=(…, M+1)]

The autocorrelation.

Examples

>>> x = diffsptk.ramp(4)
>>> acorr = diffsptk.Autocorrelation(5, 3)
>>> r = acorr(x)
>>> r
tensor([30.0000, 20.0000, 11.0000,  4.0000])
diffsptk.functional.acorr(x: Tensor, acr_order: int, out_format: str = 'naive') Tensor[source]#

Estimate the autocorrelation of the input waveform.

Parameters:
xTensor [shape=(…, L)]

The framed waveform.

acr_orderint >= 0

The order of the autocorrelation, \(M\).

out_format[‘naive’, ‘normalized’, ‘biased’]

The type of the autocorrelation.

Returns:
outTensor [shape=(…, M+1)]

The autocorrelation.

See also

frame levdur lpc