|
6 | 6 | from torch import Tensor |
7 | 7 |
|
8 | 8 | from torchaudio._extension import _IS_TORCHAUDIO_EXT_AVAILABLE |
9 | | -from torchaudio._internal.module_utils import dropping_support |
10 | 9 |
|
11 | 10 |
|
12 | 11 | def _dB2Linear(x: float) -> float: |
@@ -325,7 +324,7 @@ def biquad(waveform: Tensor, b0: float, b1: float, b2: float, a0: float, a1: flo |
325 | 324 | a1 = torch.as_tensor(a1, dtype=dtype, device=device).view(1) |
326 | 325 | a2 = torch.as_tensor(a2, dtype=dtype, device=device).view(1) |
327 | 326 |
|
328 | | - output_waveform = _lfilter_deprecated( |
| 327 | + output_waveform = lfilter( |
329 | 328 | waveform, |
330 | 329 | torch.cat([a0, a1, a2]), |
331 | 330 | torch.cat([b0, b1, b2]), |
@@ -699,8 +698,8 @@ def filtfilt( |
699 | 698 | Tensor: Waveform with dimension of either `(..., num_filters, time)` if ``a_coeffs`` and ``b_coeffs`` |
700 | 699 | are 2D Tensors, or `(..., time)` otherwise. |
701 | 700 | """ |
702 | | - forward_filtered = _lfilter_deprecated(waveform, a_coeffs, b_coeffs, clamp=False, batching=True) |
703 | | - backward_filtered = _lfilter_deprecated( |
| 701 | + forward_filtered = lfilter(waveform, a_coeffs, b_coeffs, clamp=False, batching=True) |
| 702 | + backward_filtered = lfilter( |
704 | 703 | forward_filtered.flip(-1), |
705 | 704 | a_coeffs, |
706 | 705 | b_coeffs, |
@@ -998,7 +997,7 @@ def _lfilter_core( |
998 | 997 | _lfilter = _lfilter_core |
999 | 998 |
|
1000 | 999 |
|
1001 | | -def _lfilter_deprecated(waveform: Tensor, a_coeffs: Tensor, b_coeffs: Tensor, clamp: bool = True, batching: bool = True) -> Tensor: |
| 1000 | +def lfilter(waveform: Tensor, a_coeffs: Tensor, b_coeffs: Tensor, clamp: bool = True, batching: bool = True) -> Tensor: |
1002 | 1001 | r"""Perform an IIR filter by evaluating difference equation, using differentiable implementation |
1003 | 1002 | developed separately by *Yu et al.* :cite:`ismir_YuF23` and *Forgione et al.* :cite:`forgione2021dynonet`. |
1004 | 1003 | The gradients of ``a_coeffs`` are computed based on a faster algorithm from :cite:`ycy2024diffapf`. |
@@ -1067,7 +1066,6 @@ def _lfilter_deprecated(waveform: Tensor, a_coeffs: Tensor, b_coeffs: Tensor, cl |
1067 | 1066 |
|
1068 | 1067 | return output |
1069 | 1068 |
|
1070 | | -lfilter = dropping_support(_lfilter_deprecated) |
1071 | 1069 |
|
1072 | 1070 | def lowpass_biquad(waveform: Tensor, sample_rate: int, cutoff_freq: float, Q: float = 0.707) -> Tensor: |
1073 | 1071 | r"""Design biquad lowpass filter and perform filtering. Similar to SoX implementation. |
@@ -1117,7 +1115,7 @@ def _overdrive_core_loop_generic( |
1117 | 1115 | _overdrive_core_loop_cpu = _overdrive_core_loop_generic |
1118 | 1116 |
|
1119 | 1117 |
|
1120 | | -def _overdrive_deprecated(waveform: Tensor, gain: float = 20, colour: float = 20) -> Tensor: |
| 1118 | +def overdrive(waveform: Tensor, gain: float = 20, colour: float = 20) -> Tensor: |
1121 | 1119 | r"""Apply a overdrive effect to the audio. Similar to SoX implementation. |
1122 | 1120 |
|
1123 | 1121 | .. devices:: CPU CUDA |
@@ -1172,7 +1170,6 @@ def _overdrive_deprecated(waveform: Tensor, gain: float = 20, colour: float = 20 |
1172 | 1170 |
|
1173 | 1171 | return output_waveform.clamp(min=-1, max=1).view(actual_shape) |
1174 | 1172 |
|
1175 | | -overdrive = dropping_support(_overdrive_deprecated) |
1176 | 1173 |
|
1177 | 1174 | def phaser( |
1178 | 1175 | waveform: Tensor, |
|
0 commit comments