ndps2c#

class diffsptk.NegativeDerivativeOfPhaseSpectrumToCepstrum(fft_length: int, cep_order: int)[source]#

See this page for details.

Parameters:
fft_lengthint >= 2

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

cep_orderint >= 0

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

References

[1]

B. Yegnanarayana, “Pole-zero decomposition of speech spectra,” Signal Processing, vol. 3, no. 1, pp. 5-17, 1981.

forward(n: Tensor) Tensor[source]#

Convert NPDS to cepstrum.

Parameters:
nTensor [shape=(…, L/2+1)]

The NDPS.

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

The cepstrum.

Examples

>>> n = diffsptk.ramp(4)
>>> ndps2c = diffsptk.NegativeDerivativeOfPhaseSpectrumToCepstrum(8, 4)
>>> c = ndps2c(n)
>>> c
tensor([ 0.0000, -1.7071,  0.0000, -0.0976,  0.0000])
diffsptk.functional.ndps2c(n: Tensor, cep_order: int) Tensor[source]#

Convert NPDS to cepstrum.

Parameters:
nTensor [shape=(…, L/2+1)]

The NDPS, where \(L\) is the number of FFT bins.

cep_orderint >= 0

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

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

The cepstrum.

See also

c2ndps