Spaces:
Runtime error
Runtime error
File size: 2,118 Bytes
fc5ed00 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
from typing import List, Optional, Union
from numpy import ndarray
class DF:
def __init__(
self,
sr: int,
fft_size: int,
hop_size: int,
nb_bands: int,
min_nb_erb_freqs: Optional[int] = 1,
):
"""DeepFilter state used for analysis and synthesis.
Args:
sr (int): Sampling rate.
fft_size (int): Window length used for the Fast Fourier transform.
hop_size (int): Hop size between two analysis windows. Also called frame size.
nb_bands (int): Number of ERB bands.
min_nb_erb_freqs (int): Minimum number of frequency bands per ERB band. Defaults to 1.
"""
...
def analysis(self, input: ndarray) -> ndarray:
"""Analysis of a time-domain signal.
Args:
input (ndarray): 2D real-valued array of shape [C, T].
Output:
output (ndarray): 3D complex-valued array of shape [C, T', F], where F is the `fft_size`,
and T' the original time T divided by `hop_size`.
"""
...
def synthesis(self, input: ndarray) -> ndarray:
"""Synthesis of a frequency-domain signal.
Args:
input (ndarray): 3D complex-valued array of shape [C, T, F].
Output:
output (ndarray): 2D real-valued array of shape [C, T].
"""
...
def erb_widths(self) -> ndarray: ...
def fft_window(self) -> ndarray: ...
def sr(self) -> int: ...
def fft_size(self) -> int: ...
def hop_size(self) -> int: ...
def nb_erb(self) -> int: ...
def reset(self) -> None: ...
def erb(
input: ndarray, erb_fb: Union[ndarray, List[int]], db: Optional[bool] = None
) -> ndarray: ...
def erb_inv(input: ndarray, erb_fb: Union[ndarray, List[int]]) -> ndarray: ...
def erb_norm(erb: ndarray, alpha: float, state: Optional[ndarray] = None) -> ndarray: ...
def unit_norm(spec: ndarray, alpha: float, state: Optional[ndarray] = None) -> ndarray: ...
def unit_norm_init(num_freq_bins: int) -> ndarray: ...
|