Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[audio] rm kaiser window in audio get_window function && rm audio utils #47469

Merged
merged 3 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions python/paddle/audio/functional/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,6 @@ def _tukey(
return _truncate(w, needs_trunc)


@window_function_register.register()
def _kaiser(
M: int, beta: float, sym: bool = True, dtype: str = 'float64'
) -> Tensor:
"""Compute a Kaiser window.
The Kaiser window is a taper formed by using a Bessel function.
"""
raise NotImplementedError()


@window_function_register.register()
def _gaussian(
M: int, std: float, sym: bool = True, dtype: str = 'float64'
Expand Down Expand Up @@ -346,7 +336,7 @@ def get_window(
"""Return a window of a given length and type.

Args:
window (Union[str, Tuple[str, float]]): The window function applied to the signal before the Fourier transform. Supported window functions: 'hamming', 'hann', 'kaiser', 'gaussian', 'general_gaussian', 'exponential', 'triang', 'bohman', 'blackman', 'cosine', 'tukey', 'taylor'.
window (Union[str, Tuple[str, float]]): The window function applied to the signal before the Fourier transform. Supported window functions: 'hamming', 'hann', 'gaussian', 'general_gaussian', 'exponential', 'triang', 'bohman', 'blackman', 'cosine', 'tukey', 'taylor'.
win_length (int): Number of samples.
fftbins (bool, optional): If True, create a "periodic" window. Otherwise, create a "symmetric" window, for use in filter design. Defaults to True.
dtype (str, optional): The data type of the return window. Defaults to 'float64'.
Expand All @@ -363,7 +353,7 @@ def get_window(
cosine_window = paddle.audio.functional.get_window('cosine', n_fft)

std = 7
gussian_window = paddle.audio.functional.get_window(('gaussian',std), n_fft)
gaussian_window = paddle.audio.functional.get_window(('gaussian',std), n_fft)
"""
sym = not fftbins

Expand Down
13 changes: 0 additions & 13 deletions python/paddle/audio/utils/__init__.py

This file was deleted.

21 changes: 0 additions & 21 deletions python/paddle/audio/utils/error.py

This file was deleted.

7 changes: 0 additions & 7 deletions python/paddle/tests/test_audio_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ def test_gaussian_window_and_exception(self, n_fft: int):
np.testing.assert_array_almost_equal(
window_scipy_exp, window_paddle_exp.numpy(), decimal=5
)
try:
window_paddle = paddle.audio.functional.get_window(
("kaiser", 1.0), self.n_fft
)
except NotImplementedError:
pass

try:
window_paddle = paddle.audio.functional.get_window("hann", -1)
except ValueError:
Expand Down