acr2csm#

class diffsptk.AutocorrelationToCompositeSinusoidalModelCoefficients(acr_order: int, device: device | None = None, dtype: dtype | None = None)[source]#

See this page for details.

Parameters:
acr_orderint >= 0

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

devicetorch.device or None

The device of this module.

dtypetorch.dtype or None

The data type of this module.

References

[1]

S. Sagayama et al., “Duality theory of composite sinusoidal modeling and linear prediction,” Proceedings of ICASSP, pp. 1261-1264, 1986.

forward(r: Tensor) Tensor[source]#

Convert autocorrelation to CSM coefficients.

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

The autocorrelation.

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

The CSM coefficients.

Examples

>>> import diffsptk
>>> acorr = diffsptk.Autocorrelation(5, 3)
>>> acr2csm = diffsptk.AutocorrelationToCompositeSinusoidalModelCoefficients(3)
>>> x = diffsptk.ramp(4)
>>> c = acr2csm(acorr(x))
>>> c
tensor([ 0.5261,  2.1403, 25.7668,  4.2332])
diffsptk.functional.acr2csm(r: Tensor) Tensor[source]#

Convert autocorrelation to CSM coefficients.

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

The autocorrelation.

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

The CSM coefficients.

See also

acorr csm2acr