dst#

diffsptk.DST#

alias of DiscreteSineTransform

class diffsptk.DiscreteSineTransform(dst_length: int, dst_type: int = 2)[source]#

Discrete sine transform module.

Parameters:
dst_lengthint >= 1

The DST length, \(L\).

dst_typeint in [1, 4]

The DST type.

forward(x: Tensor) Tensor[source]#

Apply DST to the input.

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

The input.

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

The DST output.

Examples

>>> x = diffsptk.ramp(3)
>>> dst = diffsptk.DST(4)
>>> y = dst(x)
>>> y
tensor([ 2.7716, -2.0000,  1.1481, -1.0000])
diffsptk.functional.dst(x: Tensor, dst_type: int = 2) Tensor[source]#

Compute DST.

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

The input.

dst_typeint in [1, 4]

The DST type.

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

The DST output.

See also

idst