csm2acr#

class diffsptk.CompositeSinusoidalModelCoefficientsToAutocorrelation(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(c: Tensor) Tensor[source]#

Convert CSM coefficients to autocorrelation.

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

The CSM coefficients.

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

The autocorrelation.

Examples

>>> import diffsptk
>>> acorr = diffsptk.Autocorrelation(5, 3)
>>> acr2csm = diffsptk.AutocorrelationToCompositeSinusoidalModelCoefficients(3)
>>> csm2acr = diffsptk.CompositeSinusoidalModelCoefficientsToAutocorrelation(3)
>>> x = diffsptk.ramp(4)
>>> r = acorr(x)
>>> r
tensor([30.0000, 20.0000, 11.0000,  4.0000])
>>> r2 = csm2acr(acr2csm(r))
>>> r2
tensor([30.0000, 20.0000, 11.0000,  4.0000])
diffsptk.functional.csm2acr(c: Tensor) Tensor[source]#

Convert CSM coefficients to autocorrelation.

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

The CSM coefficients.

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

The autocorrelation.

See also

acorr acr2csm