ifreqt2#

class diffsptk.SecondOrderAllPassInverseFrequencyTransform(in_order: int, out_order: int, alpha: float = 0, theta: float = 0, n_fft: int = 512)[source]#

Second-order all-pass inverse frequency transform module.

Parameters:
in_orderint >= 0

The order of the input sequence, \(M_1\).

out_orderint >= 0

The order of the output sequence, \(M_2\).

alphafloat in (-1, 1)

The frequency warping factor, \(\alpha\).

thetafloat in [0, 1]

The emphasis frequency, \(\theta\).

n_fftint >> M2

The number of FFT bins. The accurate conversion requires the large value.

References

[1]

T. Wakako et al., “Speech spectral estimation based on expansion of log spectrum by arbitrary basis functions,” IEICE Trans, vol. J82-D-II, no. 12, pp. 2203-2211, 1999 (in Japanese).

forward(c: Tensor) Tensor[source]#

Perform second-order all-pass inverse frequency transform.

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

The warped sequence.

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

The output sequence.

Examples

>>> c1 = diffsptk.nrand(3)
>>> c1
tensor([ 0.0304,  0.5849, -0.8668, -0.7278])
>>> freqt2 = diffsptk.SecondOrderAllPassFrequencyTransform(3, 4, .1, .3)
>>> c2 = freqt2(c1)
>>> c2
tensor([ 0.0682,  0.4790, -1.0168, -0.6026,  0.1094])
>>> ifreqt2 = diffsptk.SecondOrderAllPassInverseFrequencyTransform(4, 3, .1, .3)
>>> c3 = ifreqt2(c2)
>>> c3
tensor([ 0.0682,  0.4790, -1.0168, -0.6026,  0.1094])
diffsptk.functional.ifreqt2(c: Tensor, out_order: int, alpha: float = 0, theta: float = 0, n_fft: int = 512) Tensor[source]#

Perform second-order all-pass inverse frequency transform.

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

Cepstral coefficients.

out_orderint >= 0

The order of the output sequence, \(M_2\).

alphafloat in (-1, 1)

The frequency warping factor, \(\alpha\).

thetafloat in [0, 1]

The emphasis frequency, \(\theta\).

n_fftint >> M2

The number of FFT bins.

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

The warped cepstral coefficients.

See also

freqt freqt2 smcep