calculate_sampling_rate¶
- brainsets.utils.misc_utils.calculate_sampling_rate(timestamps, rtol=0.001)[source]¶
Calculates median sampling rate from an array of timestamps.
- Parameters:
- Returns:
Sampling rate in Hz.
- Return type:
- Raises:
ValueError – If fewer than 2 timestamps are provided.
ValueError – If the timestamps are not strictly monotonically increasing.
ValueError – If the timestamps are not uniformly sampled within the given relative tolerance.