ialaw#

class diffsptk.ALawExpansion(abs_max=1, a=87.6)[source]#

See this page for details.

Parameters:
abs_maxfloat > 0

The absolute maximum value of the original input waveform.

afloat >= 1

The compression factor, \(A\).

forward(y)[source]#

Expand the waveform using the A-law algorithm.

Parameters:
yTensor [shape=(…,)]

The input compressed waveform.

Returns:
outTensor [shape=(…,)]

The expanded waveform.

Examples

>>> x = diffsptk.ramp(4)
>>> alaw = diffsptk.ALawCompression(4)
>>> ialaw = diffsptk.ALawExpansion(4)
>>> x2 = ialaw(alaw(x))
>>> x2
tensor([0.0000, 1.0000, 2.0000, 3.0000, 4.0000])
diffsptk.functional.ialaw(y, abs_max=1, a=87.6)[source]#

Expand the waveform using the A-law algorithm.

Parameters:
yTensor [shape=(…,)]

The compressed waveform.

abs_maxfloat > 0

The absolute maximum value of the original input waveform.

afloat >= 1

The compression factor, \(A\).

Returns:
outTensor [shape=(…,)]

The expanded waveform.

See also

alaw iulaw