public void DetectPoints(double[][] ecg, int width, int fs) { this.QRSList = new List <QRSdetection>(); QRSdetection d = new QRSdetection(ecg, width, fs); for (int i = 0; i < d.Impulse1.Length - 1; i++) { if (d.Impulse1[i] - d.Impulse1[i + 1] == -1) //if it's a starting Point { this.startingPoints.Add(i + 1, d.S1[i + 1]); } if (d.Impulse1[i] - d.Impulse1[i + 1] == 1) //if it's an Ending Point { this.endingPoints.Add(i + 1, d.S1[i + 1]); } } QRSList.Add(d); }
public void DetectPoints(double[][] ecg) { int width = 2000; /* List<QRSdetection>*/ this.QRSList = new List <QRSdetection>(); while (this.startingPoints.Keys.Count < 100 && this.endingPoints.Keys.Count <= 100) // 102 يوجد زيادة في عدد النقط , تحسبا فقط في حال النقطة الاولى تدل على إشارة مشوهة { int Offset = this.QRSList.Count * width; if (Offset < ecg.Length) { QRSdetection d = new QRSdetection(ecg, 370, 20, Offset); for (int i = 0; i < d.Impulse1.Length - 1; i++) { if (d.Impulse1[i] - d.Impulse1[i + 1] == -1) //if it's a starting Point { this.startingPoints.Add(i + Offset + 1, d.S1[i + 1]); } if (d.Impulse1[i] - d.Impulse1[i + 1] == 1) //if it's an Ending Point { this.endingPoints.Add(i + Offset + 1, d.S1[i + 1]); } } QRSList.Add(d); } } List <double> OverallList = new List <double>(); foreach (var sig in QRSList) { OverallList.AddRange(sig.Impulse1.ToList()); } this.Impulse1 = OverallList.ToArray(); }