|
| 1 | +from collections.abc import Callable |
| 2 | +from typing_extensions import TypeAlias |
| 3 | + |
| 4 | +import numpy as np |
| 5 | + |
| 6 | +__all__ = ["get_filter", "clear_cache", "sinc_window"] |
| 7 | + |
| 8 | +# Dictionary to cache loaded filters |
| 9 | +FILTER_CACHE: dict[str, tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]] |
| 10 | + |
| 11 | +# List of filter functions available |
| 12 | +FILTER_FUNCTIONS: list[str] |
| 13 | + |
| 14 | +_FilterType: TypeAlias = str | Callable[[int], np.ndarray[tuple[int], np.dtype[np.float64]]] |
| 15 | + |
| 16 | +def sinc_window( |
| 17 | + num_zeros: int = 64, |
| 18 | + precision: int = 9, |
| 19 | + window: Callable[[int], np.ndarray[tuple[int], np.dtype[np.float64]]] | None = None, |
| 20 | + rolloff: float = 0.945, |
| 21 | +) -> tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]: ... |
| 22 | +def get_filter( |
| 23 | + name_or_function: _FilterType, *, num_zeros: int = 64, precision: int = 9, rolloff: float = 0.945 |
| 24 | +) -> tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]: ... |
| 25 | +def load_filter(filter_name: str) -> tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]: ... |
| 26 | +def clear_cache() -> None: ... |
0 commit comments