freqt#

class diffsptk.FrequencyTransform(in_order, out_order, alpha=0)[source]#

See this page for details.

Parameters:
in_orderint >= 0 [scalar]

Order of input sequence, \(M_1\).

out_orderint >= 0 [scalar]

Order of output sequence, \(M_2\).

alphafloat [-1 < alpha < 1]

Frequency warping factor, \(\alpha\).

forward(c1)[source]#

Perform frequency transform.

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

Input sequence.

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

Warped sequence.

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])

See also

mgc2mgc mgcep