Skip to content

sample_time.m

Basic Information

  SYNTAX:  [t0, dt, n] = sample_time(time_vec, sensitivity)

  PURPOSE:  Gets the initial sampling time(s) and sampling interval(s)
     defined by the time vector. If the time between samples is not uniform
     the outputs will be vectors.

  INPUT:
    time_vec = time vector (usually returned by getptd)
    sensitivity = fraction of min time step to be used to detect change
            in time step (optional, default = 1e-2)

  OUTPUT:
    t0 = initial sample time beginning each time segment having
            different sample times
    dt = time between samples in each segment
    n  = sample numbers corresponding to each t0

  RESTRICTIONS:  Certain time vectors, notably those corresponding to chopper
    data, have numerically nonuniform sampling over ANY interval and this
    procedure fails to return meaningful results.

Dependencies