Heart rate variability metrics are derived from the intervals between successive heart beats, referred to as BB intervals. A method implementable by an implantable cardiac device for excluding BB intervals due to ectopic beats based on a function of preceding BB intervals is presented. It is desirable to remove such BB intervals from a BB interval time series used to calculate a heart rate variability metric.