Electrocardiogram-based sleep analysis for sleep apnea screening and diagnosis