iulaw#
- class diffsptk.MuLawExpansion(abs_max=1, mu=255)[source]#
See this page for details.
- Parameters:
- abs_maxfloat > 0
The absolute maximum value of the original input waveform.
- muint >= 1
The compression factor, \(\mu\).
- forward(y)[source]#
Expand the waveform using the \(\mu\)-law algorithm.
- Parameters:
- yTensor [shape=(…,)]
The input compressed waveform.
- Returns:
- outTensor [shape=(…,)]
The expanded waveform.
Examples
>>> x = diffsptk.ramp(4) >>> ulaw = diffsptk.MuLawCompression(4) >>> iulaw = diffsptk.MuLawExpansion(4) >>> x2 = iulaw(ulaw(x)) >>> x2 tensor([0.0000, 1.0000, 2.0000, 3.0000, 4.0000])
- diffsptk.functional.iulaw(y, abs_max=1, mu=255)[source]#
Expand the waveform using the \(\mu\)-law algorithm.
- Parameters:
- yTensor [shape=(…,)]
The compressed waveform.
- abs_maxfloat > 0
The absolute maximum value of the original input waveform.
- muint >= 1
The compression factor, \(\mu\).
- Returns:
- outTensor [shape=(…,)]
The expanded waveform.
See also