imdst#
- diffsptk.IMDST#
alias of
InverseModifiedDiscreteSineTransform
- class diffsptk.InverseModifiedDiscreteSineTransform(frame_length, window='sine')[source]#
This is the opposite module to
ModifiedDiscreteSineTransform()
.- Parameters:
- frame_lengthint >= 2
The frame length, \(L\).
- window[‘sine’, ‘vorbis’, ‘kbd’, ‘rectangular’]
The window type.
- forward(y, out_length=None)[source]#
Compute inverse modified discrete sine transform.
- Parameters:
- yTensor [shape=(…, 2T/L, L/2)]
The spectrum.
- out_lengthint or None
The length of the output waveform.
- Returns:
- outTensor [shape=(…, T)]
The reconstructed waveform.
Examples
>>> x = diffsptk.ramp(3) >>> x tensor([0., 1., 2., 3.]) >>> mdst_params = {"frame_length": 4} >>> mdst = diffsptk.MDST(**mdst_params) >>> imdst = diffsptk.IMDST(**mdst_params) >>> y = imdst(mdst(x)) >>> y tensor([-8.9407e-08, 1.0000e+00, 2.0000e+00, 3.0000e+00])
- diffsptk.functional.imdst(y, out_length=None, frame_length=400, window='sine')[source]#
Compute inverse modified discrete sine transform.
- Parameters:
- yTensor [shape=(…, 2T/L, L/2)]
The spectrum.
- out_lengthint or None
The length of the output waveform.
- frame_lengthint >= 2
The frame length, \(L\).
- window[‘sine’, ‘vorbis’, ‘kbd’, ‘rectangular’]
The window type.
- Returns:
- outTensor [shape=(…, T)]
The reconstructed waveform.