public static List<PointF> ECG_Complex__QRST_Aberrant_3 (Patient _P, Lead _L) { float lerpCoeff = Math.Clamp (Math.InverseLerp (30, 160, _P.HR)), QRS = Math.Lerp (0.12f, 0.26f, 1 - lerpCoeff), QT = Math.Lerp (0.25f, 0.6f, 1 - lerpCoeff); List<PointF> thisBeat = new List<PointF> (); thisBeat = Plotting.Concatenate (thisBeat, ECG_Q (_P, _L, QRS / 3, 0.1f, Plotting.Last (thisBeat))); thisBeat = Plotting.Concatenate (thisBeat, ECG_R (_P, _L, QRS / 6, -0.7f, Plotting.Last (thisBeat))); thisBeat = Plotting.Concatenate (thisBeat, ECG_J (_P, _L, QRS / 6, -0.6f, Plotting.Last (thisBeat))); thisBeat = Plotting.Concatenate (thisBeat, ECG_ST (_P, _L, ((QT - QRS) * 2) / 5, 0.1f, Plotting.Last (thisBeat))); thisBeat = Plotting.Concatenate (thisBeat, ECG_T (_P, _L, ((QT - QRS) * 3) / 5, 0.3f, 0f, Plotting.Last (thisBeat))); return thisBeat; }
public static List<PointF> ECG_Complex__QRST_SVT (Patient _P, Lead _L) { float _Length = _P.GetHR_Seconds; float lerpCoeff = Math.Clamp (Math.InverseLerp (160, 240, _P.HR)), QRS = Math.Lerp (0.05f, 0.12f, 1 - lerpCoeff), QT = Math.Lerp (0.22f, 0.36f, 1 - lerpCoeff); List<PointF> thisBeat = new List<PointF> (); thisBeat = Plotting.Concatenate (thisBeat, ECG_Q (_P, _L, QRS / 4, -0.1f, Plotting.Last (thisBeat))); thisBeat = Plotting.Concatenate (thisBeat, ECG_R (_P, _L, QRS / 4, 0.9f, Plotting.Last (thisBeat))); thisBeat = Plotting.Concatenate (thisBeat, ECG_S (_P, _L, QRS / 4, -0.3f, Plotting.Last (thisBeat))); thisBeat = Plotting.Concatenate (thisBeat, ECG_J (_P, _L, QRS / 4, -0.1f, Plotting.Last (thisBeat))); thisBeat = Plotting.Concatenate (thisBeat, ECG_ST (_P, _L, ((QT - QRS) * 1) / 5, -0.06f, Plotting.Last (thisBeat))); thisBeat = Plotting.Concatenate (thisBeat, ECG_T (_P, _L, ((QT - QRS) * 2) / 5, 0.15f, 0.06f, Plotting.Last (thisBeat))); thisBeat = Plotting.Concatenate (thisBeat, ECG_T (_P, _L, ((QT - QRS) * 2) / 5, 0.08f, 0f, Plotting.Last (thisBeat))); return thisBeat; }
public static List<PointF> RR_Rhythm (Patient _P, bool _Inspire) { float _Portion = 0.1f; List<PointF> thisBeat = new List<PointF> (); Plotting.Concatenate (ref thisBeat, Plotting.Line (ResolutionTime, _Portion, 0.3f * (_Inspire ? 1 : -1), Plotting.Last (thisBeat))); Plotting.Concatenate (ref thisBeat, Plotting.Line (ResolutionTime, _Portion, 0f, Plotting.Last (thisBeat))); return thisBeat; }
public static List<PointF> ECG_Complex__QRST_VF (Patient _P, Lead _L, float _Amp) { float _Length = _P.GetHR_Seconds, _Wave = _P.GetHR_Seconds / 2f, _Amplitude = (float)(Math.RandomDouble (0.3f, 0.6f) * _Amp); List<PointF> thisBeat = new List<PointF> (); while (_Length > 0f) { thisBeat = Plotting.Concatenate (thisBeat, Plotting.Curve (ResolutionTime, _Wave, _Amplitude, 0f, Plotting.Last (thisBeat))); // Flip the sign of amplitude and randomly crawl larger/smaller, models the // flippant waves in v-fib. _Amplitude = 0 - (float)Math.Clamp (Math.RandomDouble (_Amplitude - 0.1f, _Amplitude + 0.1f), -1f, 1f); _Length -= _Wave; } return thisBeat; }
public static List<PointF> ECG_Isoelectric__Atrial_Flutter (Patient _P, Lead _L) { int Flutters = (int)System.Math.Ceiling (_P.GetHR_Seconds / 0.16f); List<PointF> thisBeat = new List<PointF> (); for (int i = 1; i < Flutters; i++) thisBeat = Plotting.Concatenate (thisBeat, ECG_P (_P, _L, 0.16f, .08f, 0f, Plotting.Last (thisBeat))); return thisBeat; }