Modified from the Ben Fulcher's
EN_SampEn which uses code from PhysioNet.
The publicly-available PhysioNet Matlab code, sampenc (renamed here to
RN_sampenc) is available from:
the input time series
Embedding dimension is set to 5. The threshold is set to 0.3.
cf. "Physiological time-series analysis using approximate entropy and sample entropy", J. S. Richman and J. R. Moorman, Am. J. Physiol. Heart Circ. Physiol., 278(6) H2039 (2000)
B.D. Fulcher and N.S. Jones. hctsa: A computational framework for automated time-series phenotyping using massive feature extraction. Cell Systems 5, 527 (2017).
B.D. Fulcher, M.A. Little, N.S. Jones Highly comparative time-series analysis: the empirical structure of time series and their methods. J. Roy. Soc. Interface 10, 83 (2013).