mdst#

diffsptk.MDST#

alias of ModifiedDiscreteSineTransform

class diffsptk.ModifiedDiscreteSineTransform(frame_length, window='sine')[source]#

This module is a simple cascade of framing, windowing, and modified DST.

Parameters:
frame_lengthint >= 2

Frame length, \(L\).

window[‘sine’, ‘vorbis’, ‘kbd’, ‘rectangular’]

Window type.

forward(x)[source]#

Compute modified discrete sine transform.

Parameters:
xTensor [shape=(…, T)]

Waveform.

Returns:
outTensor [shape=(…, 2T/L, L/2)]

Spectrum.

Examples

>>> x = diffsptk.ramp(3)
>>> x
tensor([0., 1., 2., 3.])
>>> mdst = diffsptk.MDST(frame_length=4)
>>> y = mdst(x)
>>> y
tensor([[-0.2071, -0.5000],
        [ 1.5858,  0.4142],
        [ 4.6213, -1.9142]])
diffsptk.functional.mdst(x, frame_length=400, window='sine')[source]#

Compute modified discrete sine transform.

Parameters:
xTensor [shape=(…, T)]

Waveform.

frame_lengthint >= 2

Frame length, \(L\).

window[‘sine’, ‘vorbis’, ‘kbd’, ‘rectangular’]

Window type.

Returns:
outTensor [shape=(…, 2T/L, L/2)]

Spectrum.

See also

frame window imdst