ifreqt2#
- class diffsptk.SecondOrderAllPassInverseFrequencyTransform(in_order, out_order, alpha=0, theta=0, n_fft=512)[source]#
Second-order all-pass inverse frequecy transform module.
- 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\).
- thetafloat [0 <= theta <= 1]
Emphasis frequency, \(\theta\).
- n_fftint >> math:M_1 [scalar]
Number of FFT bins. Accurate conversion requires the large value.
- forward(c1)[source]#
Perform second-order all-pass inverse frequency transform.
- Parameters:
- c1Tensor [shape=(…, M1+1)]
Warped sequence.
- Returns:
- c2Tensor [shape=(…, M2+1)]
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])