ialaw#
- class diffsptk.ALawExpansion(abs_max: float = 1, a: float = 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: Tensor) Tensor [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: Tensor, abs_max: float = 1, a: float = 87.6) Tensor [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.