testing#

py_fatigue.testing.get_sampled_time(fs: float, duration: float, start: float = 0.0) np.ndarray[Any, np.dtype[np.float64]]#

Get the time vector of the signal.

Parameters:
  • fs (float) – Sampling frequency in Hz.

  • duration (float) – Duration of the signal in s.

  • start (float, optional) – Start time of the signal in s. The default is 0.0.

Returns:

Time vector of the signal.

Return type:

np.ndarray

py_fatigue.testing.get_random_data(t: np.ndarray[Any, np.dtype[np.float64]], seed: int = 2, random_type: str = 'normal', min_: float = -10.0, range_: float = 50.0, **kwargs: Any) npt.NDArray#

Get random data from a given array.

Parameters:
  • t (array_like) – Array from which to get data (time).

  • seed (int) – Seed for the random generator.

  • random_type (str, optional) – Type of random data to generate. The default is “normal”. See numpy.random for more information.

  • min (float, optional) – Minimum value of the random data. The default is -10.0.

  • range (float, optional) – Range of the random data. The default is 50.0.

  • **kwargs (Any) – Keyword arguments for the random generators, see: https://numpy.org/doc/stable/reference/random/generator.html

Returns:

Random data.

Return type:

array_like