mlab.pyi 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. from collections.abc import Callable
  2. import functools
  3. from typing import Literal
  4. import numpy as np
  5. from numpy.typing import ArrayLike
  6. def window_hanning(x: ArrayLike) -> ArrayLike: ...
  7. def window_none(x: ArrayLike) -> ArrayLike: ...
  8. def detrend(
  9. x: ArrayLike,
  10. key: Literal["default", "constant", "mean", "linear", "none"]
  11. | Callable[[ArrayLike, int | None], ArrayLike]
  12. | None = ...,
  13. axis: int | None = ...,
  14. ) -> ArrayLike: ...
  15. def detrend_mean(x: ArrayLike, axis: int | None = ...) -> ArrayLike: ...
  16. def detrend_none(x: ArrayLike, axis: int | None = ...) -> ArrayLike: ...
  17. def detrend_linear(y: ArrayLike) -> ArrayLike: ...
  18. def psd(
  19. x: ArrayLike,
  20. NFFT: int | None = ...,
  21. Fs: float | None = ...,
  22. detrend: Literal["none", "mean", "linear"]
  23. | Callable[[ArrayLike, int | None], ArrayLike]
  24. | None = ...,
  25. window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
  26. noverlap: int | None = ...,
  27. pad_to: int | None = ...,
  28. sides: Literal["default", "onesided", "twosided"] | None = ...,
  29. scale_by_freq: bool | None = ...,
  30. ) -> tuple[ArrayLike, ArrayLike]: ...
  31. def csd(
  32. x: ArrayLike,
  33. y: ArrayLike | None,
  34. NFFT: int | None = ...,
  35. Fs: float | None = ...,
  36. detrend: Literal["none", "mean", "linear"]
  37. | Callable[[ArrayLike, int | None], ArrayLike]
  38. | None = ...,
  39. window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
  40. noverlap: int | None = ...,
  41. pad_to: int | None = ...,
  42. sides: Literal["default", "onesided", "twosided"] | None = ...,
  43. scale_by_freq: bool | None = ...,
  44. ) -> tuple[ArrayLike, ArrayLike]: ...
  45. complex_spectrum = functools.partial(tuple[ArrayLike, ArrayLike])
  46. magnitude_spectrum = functools.partial(tuple[ArrayLike, ArrayLike])
  47. angle_spectrum = functools.partial(tuple[ArrayLike, ArrayLike])
  48. phase_spectrum = functools.partial(tuple[ArrayLike, ArrayLike])
  49. def specgram(
  50. x: ArrayLike,
  51. NFFT: int | None = ...,
  52. Fs: float | None = ...,
  53. detrend: Literal["none", "mean", "linear"] | Callable[[ArrayLike, int | None], ArrayLike] | None = ...,
  54. window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
  55. noverlap: int | None = ...,
  56. pad_to: int | None = ...,
  57. sides: Literal["default", "onesided", "twosided"] | None = ...,
  58. scale_by_freq: bool | None = ...,
  59. mode: Literal["psd", "complex", "magnitude", "angle", "phase"] | None = ...,
  60. ) -> tuple[ArrayLike, ArrayLike, ArrayLike]: ...
  61. def cohere(
  62. x: ArrayLike,
  63. y: ArrayLike,
  64. NFFT: int = ...,
  65. Fs: float = ...,
  66. detrend: Literal["none", "mean", "linear"] | Callable[[ArrayLike, int | None], ArrayLike] = ...,
  67. window: Callable[[ArrayLike], ArrayLike] | ArrayLike = ...,
  68. noverlap: int = ...,
  69. pad_to: int | None = ...,
  70. sides: Literal["default", "onesided", "twosided"] = ...,
  71. scale_by_freq: bool | None = ...,
  72. ) -> tuple[ArrayLike, ArrayLike]: ...
  73. class GaussianKDE:
  74. dataset: ArrayLike
  75. dim: int
  76. num_dp: int
  77. factor: float
  78. data_covariance: ArrayLike
  79. data_inv_cov: ArrayLike
  80. covariance: ArrayLike
  81. inv_cov: ArrayLike
  82. norm_factor: float
  83. def __init__(
  84. self,
  85. dataset: ArrayLike,
  86. bw_method: Literal["scott", "silverman"]
  87. | float
  88. | Callable[[GaussianKDE], float]
  89. | None = ...,
  90. ) -> None: ...
  91. def scotts_factor(self) -> float: ...
  92. def silverman_factor(self) -> float: ...
  93. def covariance_factor(self) -> float: ...
  94. def evaluate(self, points: ArrayLike) -> np.ndarray: ...
  95. def __call__(self, points: ArrayLike) -> np.ndarray: ...