freqt#
- class diffsptk.FrequencyTransform(in_order: int, out_order: int, alpha: float = 0)[source]#
See this page for details.
- 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\).
References
[1]A. V. Oppenheim et al, “Discrete representation of signals,” Proceedings of the IEEE, vol. 60, no. 6, pp. 681-691, 1972.
- forward(c: Tensor) Tensor [source]#
Perform frequency transform.
- Parameters:
- cTensor [shape=(…, M1+1)]
The input cepstral coefficients.
- Returns:
- outTensor [shape=(…, M2+1)]
The warped cepstral coefficients.
Examples
>>> c1 = diffsptk.ramp(3) >>> c1 tensor([0., 1., 2., 3.]) >>> freqt = diffsptk.FrequencyTransform(3, 4, 0.02) >>> c2 = freqt(c1) >>> c2 tensor([ 0.0208, 1.0832, 2.1566, 2.9097, -0.1772]) >>> freqt2 = diffsptk.FrequencyTransform(4, 3, -0.02) >>> c3 = freqt2(c2) >>> c3 tensor([-9.8953e-10, 1.0000e+00, 2.0000e+00, 3.0000e+00])
- diffsptk.functional.freqt(c: Tensor, out_order: int, alpha: float = 0) Tensor [source]#
Perform frequency transform.
- Parameters:
- cTensor [shape=(…, M1+1)]
The cepstral coefficients.
- out_orderint >= 0
The order of the output cepstrum, \(M_2\).
- alphafloat in (-1, 1)
The frequency warping factor, \(\alpha\).
- Returns:
- outTensor [shape=(…, M2+1)]
The warped cepstral coefficients.