def calc_sample_freq(time):
    """
    Calculates the sampling frequency of the ECG signal

    Args:
        time: array of time values
    Returns:
        fs: sampling frequency of ECG
    """
    fs = 1/(time[1]-time[0])
    return fs