paddleaudio.functional.window module
- class paddleaudio.functional.window.WindowFunctionRegister[source]
Bases:
objectMethods
get
register
- paddleaudio.functional.window.get_window(window: Union[str, Tuple[str, float]], win_length: int, fftbins: bool = True, dtype: str = 'float64') Tensor[source]
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', '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'.
- Returns:
Tensor: The window represented as a tensor.
- Examples:
import paddle n_fft = 512 cosine_window = paddle.audio.functional.get_window('cosine', n_fft) std = 7 gaussian_window = paddle.audio.functional.get_window(('gaussian',std), n_fft)