DISCRETE ELECTRO CARDIOGRAM T AMPLITUDE DETECTION BASED ON CYCLE DURATION

In each cycle of the electrocardiogram wave there are P, Q, R, S and T amplitudes. Many studies have been conducted to obtain amplitude and QRS waves because they are related to ventricular depolarization, but to obtain T amplitude values related to ventricular repolarization are still rarely done, not even for the clinical standard (12 leads). This study aims to obtain the amplitude T value in each cycle and each electrocardiogram lead. Obtaining the amplitude T position on the reference lead will also find the amplitude T value on the other lead. Each cycle duration obtained from the duration RN to RN+1 is used to obtain the position of the endpoint of each cycle. The maximum value between the amplitude S position and the end point of the cycle is the amplitude T value. The results of research on 10 Physionet sinus rhythm samples and 10 Saiful Anwar Hospital Malang samples show that the duration of the cycle was successful in obtaining the amplitude T value for each lead. All samples can display a value. The amplitude in each cycle, where the values obtained in each cycle are still in normal conditions. The amplitude T value obtained is certainly accurate because there is only one positive value between the amplitude S position and the end of the cycle position. The position of the amplitude integer T found in a cycle in one lead will be the same as the position of the amplitude integer T in the cycle for the other lead. This occurs because of the simultaneous transmission of impulses that affect the atrial and ventricular muscle cells. The position of the amplitude T for each cycle can be found by filtering the maximum amplitude value between the amplitude position S and the final position of the cycle. Practically, this method can be programmed to be added to a digital electrocardiograph


Introduction
Electrocardiograph is still used as a non-invasive standard cardiac clinic examination tool where the output is in the form of an Electrocardiogram (ecg) which is presented on an Electrocardiograph monitor screen and special ecg paper [1]. In each cardiac cycle in a typical electrocardiogram, there will be a P wave representing atrial muscle depolarization, a QRS wave representing ventricular muscle depolarization, and a T wave representing the presentation of ventricular muscle repolarization. In addition to wave morphology, the importance of in-depth interpretation and diagnosis requires information on amplitude values (P, Q, R, S and T), and duration values (intervals, segments), at least for a duration of 3 cycles. The results of the author's observations of several electrocardiograms from standard clinic examinations show that the amplitude value information is not presented for each cycle, especially for the amplitude T value. Common information shown is the average value of the amplitude R and a small part of the average value of the amplitude P, each of which is depolarization of the atrial and ventricular muscles. Much has been done to convert analog biosignals into digital signals, which generally use Analog to Digital Converter (ADC), to processing integer-based amplitude data (discrete data). The use of a computer program with a certain threshold value has been able to find the amplitude R value to obtain the cycle duration value from peak R to peak R. The cycle duration is the duration required for the impulse to propagate from the SA Node to the Purkinje fiber.
Let's note that the duration of the cycle in question is the duration from R to R and has not been positioned at the location of the actual wave cycle, to get the initial cycle position and the end of the cycle for each cycle. This problem is also to explain the actual position of the wave from the start of the impulse traveling to the atrial muscle cells which gives rise to the P wave, followed by the propagation of the impulse to the ventricular muscle cells which causes the QRS wave and the release of the impulse from the ventricular muscle cells which gives rise to the T wave.
It is important to know the amplitude T value because it is related to the repolarization of the ventricular muscle, and the presentation of this value in each cycle is to find out whether the value is the same or there is a difference. The difference in these values in follow-up studies can be analyzed to determine whether there are symptoms of abnormal ventricular muscle cells that allow ischemia or myocard infraction.
Almost all natural phenomena including activities in the human body are generally analog in nature so that the signal is classified as a continuous signal. In the information, analog signals can only be represented by images or traveling waves. To be able to provide number or value information, analog signals must be converted to digital signal form, through the process of sampling, quantizing and decoding. Devices that can carry out this process and are used today the beginning of the cycle and the end of the cycle in each cycle. The reason for not studying it is because it does not have primary data that can be used for data analysis and the difficulty in applying cycle duration values to waves.
In [8] abnormal detection of P wave, QRS complex and T wave has been obtained, but in particular the amplitude value of T can be obtained if the maximum operation is carried out. Irena: The Tpe interval will be the same in all leads because there is only one transmission of the impulse from the SA node. If the intervals are different, it is possible that the inspection tool used needs to be checked again or maybe the data processing program needs to be checked.
Several articles about electrocardiogram amplitude detection that have been published include [9] combines Particle swarm Optimization (PSO) and K-Nearest Neighbor (KNN) methods to detect peak amplitude R and QRS waves. While [2] detect QRS waves and R-R duration in real time using a Deterministic Finite Automaton (DFA). [3] based on CWT Maxime detects 12 ecg signals automatically for P, QRS and T patterns.
In [10] for prediction of VT/VF, the utility of Tpe depends on the method of measurement, but for prediction of mortality, most of the published methods of measuring Tpe are equally predictive. Heart rate correction improves predictability. The automatic 12SL method works as well as any manual measurement, and of the manual methods, the V2 lead is the most useful. The problem is how to detect the peak amplitude R and peak amplitude T using hierarchical clustering and Discrete Wavelet Transform (DWT). The unstudied part of the problem is identifying the position of the amplitude S and the position of the end of the cycle in each cycle. The reason for not studying it is because they don't know how to determine the initial position of the cycle and the end of the cycle for each cycleConclusion. [11]: this study leads to the following points. First, in normal healthy recordings, the interval Tpe differs across ECG leads, and the distribution of duration is related to the spatial width and morphological complexity of the three-dimensional T-wave loop. Second, the duration of the Tpe interval is independent of heart rate in a systematic way. Third, compared with other repolarization-associated intervals, Tpe measurements suffer from poorer intrasubject reproducibility. Finally, the relationship between the Tpe intervals measured in different ECG leads differs in different subjects; Tpe interval studies should therefore avoid combining measurements in different lead ECGs. The problem is how to detect the average T amplitude. The part of the problem that has not been studied is how to detect the amplitude T value from discrete electrocardiogram data. The reason for not studying it is because the amplitude wave data that is owned is not integer based.
In [4]: use of low and high cascade digital FIR Filters with a cut-off frequency between 0.25 and 30 Hz. In the identification of all peaks (P-QRS-T) with the help of adaptive threshold pop-up window, it achieves 96.29 % accuracy. In [12]: The proposed work uses a Hamming self-convolution window (HSCW) based on band-pass filtering used to denoise ECG signals. the error rate and the value obtained are 99.93 %, 99.95 %, and 0.117 % respectively. In [13]: that our algorithm can deal with many common types of artifacts, such as motion artifacts, electrical drift, breathing oscillations, power spikes, environmental noise, signal polarity, and premature beats. Let's also show that its performance is superior to other well-quoted detection algorithms. The problem is whether there is an effect of P wave, QRS complex are Analog to Digital Converter (ADC), which are generally included in microprocessors and microcontrollers.
Cardiac examination results reports using an electrocardiograph are generally in digital form, both for electrocardiogram presentations and information on parameter values. However, the parameter value information presented is limited for amplitude, namely generally for amplitude R, and some for amplitude P, and even then only for one particular cycle or its average value. On the other hand, for the purposes of a more in-depth diagnosis related to ventricular repolarization, information on the amplitude T value in several cycles is needed. It takes several cycles to find out whether from one cycle to the next whether the value increases, decreases or tends to be the same.
In this regard, the study devoted to finding the value of the amplitude T at each cycle on the discrete electrocardiogram is relevant. Computer programs are currently the best way to do this process.

Literature review and problem statement
In [2] electrocardiogram processing and analysis, the detection of the Q, R, and S peaks does not have to be done sequentially, even the R peak can be found first using the threshold voltage. Peak Q and peak S have a minimum value, so that the minimum value can be filtered between the initial position of the cycle and the peak position R to obtain the peak Q value, then between the peak R position and the final position of the cycle, the amplitude value of S will be found. In [3] the detection of QRS, P and T waves will be more meaningful if each wave is filtered for its amplitude, in particular the amplitude T value will be obtained. The problem being studied is to extract the QRS complex based on a certain standard deviation and duration. Procedure for Q, R, and S peak detection sequences for electrocardiogram processing and analysis. Considering that the amplitudes in each cycle are P, Q, R, S, and T, the part of the problem that hasn't been studied yet: is how to extract the P amplitudes and T amplitudes. The reason they haven't been studied is because they don't have data and don't have a way to identify them.
In [4] identifying peak R with a FIR filter will be different from peak R with the help of a pop-up, so only one is used. The problem is how to detect QRS, P and T waves based on differences in noise, baseline drift and abnormal heart beats. The part of the problem that has not been studied is how to get the amplitude T in each cycle. The reason it was not studied was because it did not apply the cycle duration value to get the cycle start and end cycle positions in each cycle. Discrete data to meet this need requires special equipment and large costs [5]. After the peak R value is obtained, the search for the S peak position and the final cycle position is continued. Filtering the maximum value between the peak position S and the final position of the cycle will get the amplitude value T. In [6] the improved sliding window area method has been able to detect the T wave, but it can still be continued to get the amplitude of T by filtering the maximum value. In [7] the second generation wavelet transform has been able to denoise the electrocardiogram signal to get the T wave position, but it can be continued to detect the maximum value as the amplitude value of T. The problem is whether the Pan-Tompkins algorithm using the FIR filter can identify the P-QRS-T peak. Part of the problem that has not been studied is how to be able to detect the position of and T wave noise on heart defects. The unstudied part of the problem is how to detect the amplitude R in each cycle. The reason not studied was the difficulty in obtaining discrete ecg data. In [5]: hierarchical clustering algorithm and discrete wavelet transform for automatic depiction of ECG fiduciary points (R and T peaks). The combination of DWT and MMA analysis helped us detect the T peak with high sensitivity. The results show that our algorithm can solve the problem of T-wave oversensing and effectively reduce the number of R-peak false positive detections. In [6]: an improved sliding window area method for detecting onset and offset T waves for data statistical applications and data mining techniques: 1) k-means clustering for setting search boundaries; 2) a grid search strategy for optimizing parameters. Experiments carried out in the QT database and the European ST-T database showed a better method performance improvement. In [14]: the analysis has a scope of modification to get less error in obtaining the R Peak value (sample) very close to the original. In [8]: research shows that the rate of disorder increases in direct proportion to how intense the activity is. The cause is mostly noise from movement, electrodes, and the heart's chaotic beats. For further research, it is recommended to use better adaptive devices, research on ECG parameters in various types of activities, or use medical distractions in the system. The problem is how to get the position of the T wave electrocardiogram to denoise the signal using the Wavelet transform. The part of the problem that has not been studied is how to get the amplitude value S and the final cycle position in each cycle. The reason it was not studied was because of the difficulty in applying cycle duration values to discrete electrocardiogram waves.
In [15]: an algorithm to detect R wave peaks with the help of BP signals with the condition that ECG and BP signals are recorded simultaneously. The experimental results show that this algorithm can improve the detection rate and detection robustness of the R EKG wave peaks. The problem is that heart rate and inter-lead variability will determine the Tpe interval in each lead. The unstudied part of the problem is the position of the amplitude T in each lead for the same cycle. The reason not studied was due to lack of 12-lead discrete electrocardiogram data.
In [16]: proper selection of R-peaks and DWT RR intervals is used which helps to achieve better classification accuracy. Conclusion [17]: this method significantly improves the classification of the "R" peak in the ECG signal. The proposed method achieves better sensitivity performance of 99.98 %, precision of 99.96 %, DER of 0.06 %, and accuracy of 99.94 % compared to other existing methods.
The difficulty in determining the duration of each cycle, then generally use the peak R to peak R duration [18]. Determining the location of the initial and final positions of each cycle of the waves is still a problem, including in obtaining the amplitude T value for each cycle. The absence of an electrocardiograph device that can store and produce discrete data is a major problem, so researchers generally have difficulty obtaining discrete electrocardiogram data files, especially for standard clinic examination results. Researchers generally use sample text data issued by the Massachusetts Institute of Technology-Beth Israel Hospital (Physionet MIT-BIH) [19]. Researchers can select and download files, but with limitations such as sinus rhythm using two leads (II and V2) with a sampling frequency of 128 Hz, arrhythmia using 12 leads with a sampling frequency of 250 Hz, Malignant ventricular Ectopy (MVE) using 2 leads (II and V2) with a sampling frequency of 250 Hz, Supraventricular Arrhythmia (SVA) uses 2 leads (II and V2) with a sampling frequency of 128 Hz.
This study's main objective was to obtain the amplitude of the T waves in each electrocardiogram cycle on the basis of cycle duration. To achieve this goal, the authors propose methods: 1) find the amplitude value R in each cycle; 2) find the cycle duration from R to R; 3) from the cycle duration obtained, the need for a formula to get the initial position and the final position of the cycle; 4) filtering the minimum amplitude between the position of point R and the end of the cycle position to get the amplitude position S; 5) filtering the maximum amplitude between the position of the amplitude point S and the end of the cycle position to get the amplitude value T and its position.
In order to apply this method, the authors retrieved examination data from the MIT-BIH Physionet and standard clinic examination results from Saiful Anwar Hospital (SAH) Malang.
Periodic propagation of impulses from the pacemaker causes depolarization of the cardiac muscle resulting in cardiac cycles and periodic amplitudes on the electrocardiogram. In one cycle there are atrial depolarization, Ventricular depolarization and ventricular depolarization. It is necessary to know the existence of these cycles in order to know the positions of the depolarization and repolarization waves and their amplitude values. The unsolved problem is how to detect the T electrocardiogram amplitude in each cycle. The availability of discrete electrocardiogram data is very important because the values of the amplitude T are among the discrete data. Publication results of several articles that have been published. The technical approach taken is to obtain the amplitude R by, first, filtering the amplitude value with a threshold of 0.6 mV (the value of 0.6 mV is the maximum limit for the amplitude P and amplitude T so that these two amplitudes will be exceeded) so that there is a group of amplitude values above 0.6 mV. Second, take one maximum value from each group which is the amplitude R of each cycle. The duration of the cycle is obtained from the duration R to R. The duration of this cycle is used to obtain the initial position of the cycle (sc) and the final position (ec) of each cycle. The minimum amplitude value between the amplitude R position and the ec position is the amplitude S. The maximum amplitude value between the amplitude S position and the ec position is the amplitude T value as shown in the flowchart in Fig. 9. Willem Einthoven (21 May 1860-29 September 1927) as the inventor of the electrocardiogram (1903) has given the name of the wave and amplitude used today. The standard names are the initials P wave for atrial depolarization, QRS wave for ventricular depolarization and T wave for ventricular repolarization. The maximum value for the P wave is the P amplitude, the maximum value for the QRS wave is the R amplitude and the maximum value for the T wave is the T amplitude. In addition to the amplitude parameter, there are duration parameters, namely segment duration (PR, ST) and interval duration (PR, QT, QRS, ST).
The hardware used for tapping the biosignal consists of a 12 lead electrode, a discrete ECG module and a laptop. 12 lead electrodes are used for tapping the biosignal from the skin surface, where 6 leads are for tapping the extremities and 6 leads are for tapping the chest. The discrete ECG module is used electronically to convert the analog biosignal output from the lead electrode into a digital signal including frequency filtering, protection and signal conditioning. Laptops are used for storing discrete data (digital text) output from discrete ECG modules and signal processing. The Turbo Pascal programming language is used to process data, process numbers and process graphics to produce an examination report in the form of an electrocardiogram.
The lead that is often used as a reference is lead II because the direction of the impulse corresponds to an angle of 60o and when compared to the other leads the amplitude peak is clearly visible. The peak amplitude in each cycle is identified as the amplitude R and the duration R to R is the duration of the cycle. If the duration of this cycle is applied to the actual wave, the initial position of the cycle (sc) and the end of the cycle (ec) will be obtained from each cycle. The amplitude S position can be obtained from the maximum amplitude value between the amplitude R position and the ec position. If the amplitude position S is known, then the maximum amplitude value between the amplitude S position and the ec position is the amplitude T.

The aim and objectives of the study
The aim of the study is to obtain the amplitude T value for each cycle using discrete electrocardiogram data.
To achieve this aim, the following objectives are accomplished: to get the amplitude R value for each cycle; to get the cycle duration value for each cycle; to get the final position of the cycle each cycle; to get the amplitude S and amplitude T.

1. Object hypothesis of the study
The object of the study is the discrete electrocardiogram lead II data, namely the potential difference amplitude (mV) as an integer function (N). The amplitudes R, S and T in each cycle can be obtained by using the maximum value filtering and minimum value filtering. The amplitude R for each cycle can be obtained in two stages, the first is with a threshold to get a group of values above 0.6 mV, the second is to find one maximum value in each group, where this value is the amplitude R in each cycle. After obtaining the amplitude R in each cycle, proceed to find the duration of the cycle, namely R to R duration. The duration of this cycle is used to get the initial position of the cycle (sc) and the final position of the cycle (ec) for each cycle.
The main hypothesis of this study is that the maximum amplitude value that lies between the amplitude S and end cycle (ec) positions is the amplitude T.
The assumptions made in this work are that one maximum amplitude value in each group is the amplitude R. The duration of the cycle (R-R) is the period of propagation of the impulse from the SA node to the Purkinje fiber, so this cycle duration can be adopted to obtain sc to ec.
The simplification adopted in this work is that the initial position of the cycle is sc=NR N+1 -1.5dR and the final position of the cycle is ec=NR N+1 -0.5dR.
In processing data using a computer, the analog signal must be converted into digital form. Digitizing the amplitude signal can be done by sampling or sampling the amplitude signal with a certain frequency. The results of the signal sampling are called discrete signals, namely the amplitude value as an integer function (N). Discrete electrocardiogram is an analog electrocardiogram wave that has been segmented or sampled with a certain frequency.
The T wave is part of the one cycle electrocardiogram wave which represents the condition of the ventricular muscle when it repolarizes (relaxes). The morphology of normal and abnormal T waves is illustrated in Fig. 1.
Abnormal T waves are T depressed (inversion, negative) or T peaked (>3 mV) [20,21]. If it is followed by an S wave, there will be ST segment elevation (STEMI) and ST segment depression.
The abnormal conditions of ST segment elevation and depression are shown in Fig. 2 and the electrocardiogram parameter values recommended by the American Heart Association (AHA) are shown in Fig. 3.
Cardiac biosignals are analog signals (continuous signals), namely voltage waves (potential difference, mV) versus time (milliseconds, ms). In an analog electrocardiograph, the electrocardiogram is directly presented on a monitor screen and the printing is done using ecg paper. In a digital electrocardiograph, the obtained analog biosignal is first sampled at a certain frequency, then a quantization process is carried out so that it becomes discrete or digital data. Fig. 4 shows an illustration of the process of analog signals into digital signals, through the process of sampling and quantization. The sampling process aims to retrieve analog signal data by sampling according to the sampling frequency so that it becomes a digital number, while the quantization process aims to digitize the amplitude. In the discrete signal, the time function is converted into a sequence of numbers using integer numbers.  The material needed in this study is the text data file of the examination results, which the authors obtained from Physionet MIT-BIH [2] dan Saiful Anwar Hospital (SAH) Malang [3]. The Physionet sample consists of 10 sinus rhythm data samples and 10 text data samples from SAH, both of which are the results of a 10-second examination. Fig. 5 shows one of the samples from Physionet while Fig. 6 shows one of the SAH samples.
The sample from SAH Malang is a database of text data from the results of patient heart examinations that have been carried out at SAH Malang. Each patient was examined according to clinical standards using a 12-lead discrete ecg device (ECGd), which consists of 6 limb data leads (leads I, II, III, aVR, aVF, aVL) and 6 precordial leads (V1, V2, V3, V4, V5 and V6). The number of records in this Physionet sinus rhythm sample for 10 seconds is 1250 records, which means it has a step of 8 ms, which is obtained from 10 seconds divided by 1250.
The number of records in the SAH sample for 10 seconds is 2500 records, which means it has a step of 4 ms, which is obtained from 10 seconds divided by 2500. In this study the number 1250 is used as a sequence of integer numbers starting from numbers 1 to 1250, as well as the number 2500 is used as a sequence of integer numbers from 1 to 2500. These integer-based amplitude values are referred to as discrete data.

2. The method of obtaining the value of the ampli tude of R and the duration of the cycle
The method used to obtain the amplitude R and cycle duration from discrete data is shown in the flow chart in Fig. 7. The discrete lead II data sample is filtered for an amplitude at a threshold of 0.6 mV, so one or several amplitude values will be obtained. These values were then grouped to obtain amplitude groups with values above 0.6 mV. The groups of amplitude values are then filtered for their maximum values, so that one maximum value is obtained for each group, which is the peak amplitude value R of each cycle. The value of the cycle duration (dR) of the nth cycle can be obtained from the Rn+1 position minus the R position in the nth cycle (Rn). The cycle duration value that has been obtained previously, is applied to the actual (according) cycle, while Fig. 8 shows an illustration of determining the value of the amplitude and duration of the cycle The initial A in Fig. 7 is the amplitude to get the R value. Filtering is done on discrete data with a threshold of 0.6 mV will produce a group of data values above 0.6 mV. One maximum value from each group is the amplitude R per cycle. The duration between the amplitude R position and the next amplitude R position is the cycle duration (dR). The initial position of the cycle (sc) is obtained from NR n+1 -1.

3. The method of obtaining the amplitude T
The amplitude S value for each cycle can be obtained by filtering the minimum amplitude value between the peak R position and the ec position. The amplitude T value can be obtained by filtering the maximum amplitude value in the duration between the peak S position and the ec position. The flow chart for obtaining the amplitude T is shown as in Fig. 9, while the illustration is shown in Fig. 10.  Fig. 10 that the amplitude value of T is normally positive, so to obtain it, it is necessary to filter the maximum amplitude value between the amplitude S position and the ec position. Table 1 shows the number of cycles of lead II for sample 16265 at a threshold of 0.5 mV is 16 cycles where the electrocardiogram is shown in Fig. 11. The amplitude R in the 1 st cycle is 2.635 mV at the 85 th integer position, in the 2nd cycle it is 2.675 mV at the 249 th integer position. And so on.  Table 2 shows the number of cycles of lead II for sample SAH 250-1 at a threshold of 1.0 mV is 13 cycles. The amplitude R in the 1st cycle is 1.816 mV at the 184 th integer position, in the 2 nd cycle it is 1.960 mV at the 363th integer position. And so on. Fig. 12 shows the software results for the cycle duration process to obtain the peak amplitude S and T. Display in Fig. 12 are the results for the cycle duration process to obtain the peak amplitude S and T from lead II for sample SAH 250-1 based on the flowchart in Fig.7 and Fig. 9. Lead II is often used as a reference lead because the amplitude limits are more obvious than the other leads.  Table 2 The number of sample cycles of the SAH 250-1 is based on the amplitude R at a threshold of 1.0 mV

2. Get the cycle duration value for each cycle
The cycle duration for each cycle is obtained by R to R, namely the NR N+1 position minus the NR N position. In Table 3, the cycle duration (dR) in cycle 1 is 164 obtained from NR N+1 (249) minus NR N (85), cycle 2 is 162 obtained from NR N+1 (411) minus NRN (249), and so on.  Table 3 shows the data for the number of cycles from lead II for sample 16265 at a threshold of 0.5 mV, it can be seen there are 16 R amplitudes, but what fulfills the requirements as a cycle (having a PQRST amplitude in 1 cycle) is 15 cycles. The 16 th cycle is negative and shown in truncated Fig. 12. Table 4 shows the data for the number of cycles from lead II for sample SAH 250-1 at a threshold of 1.0 mV, it can be seen there are 13 R amplitudes, but what fulfills the requirements as a cycle (having a PQRST amplitude in 1 cycle) is 12 cycles.  Table 4 The number of sample cycles of the SAH 250-1 is based on the amplitude R at a threshold of 1.0 mV In cycle 1, the value of dR=179 is obtained from NR N+1 -NR N , which is 363 minus 184, for cycle 2, the value of dR=176 is obtained from NR N+1 -NR N , which is 539 minus 363, and so on.

3. To get the start and end positions of each cycle
The starting and ending positions of the cycle in each cycle are obtained from the cycle duration value. The initial position of the cycle (Nsc) is obtained from NR N+1 -1.5dR N , and the end position of the cycle (Nec) is NR N+1 -0.5dR N . In Table 5, for cycle 1, the position of the R N value (2,635) is 85 with dR 164 then position Nsc=249--(1.5*164)=3 and position Nec=249-(0.5*164)=167. And so for the next. Table 5 Detect the position of the start of the cycle and the end of the cycle sample 16265 Table 6 shows the position of the starting point (nsc) and the ending point of the wave (nec) in each cycle for lead II sample SAH 250-1. The input of 1.0 mV as a threshold yields 13 peak R, but what meets the requirements as a cycle (having a PQRST amplitude) is 12 cycles, where the dR for the 13th cycle is shown to be negative. Table 7 shows the amplitude values of R, S and T in each cycle for lead II sample Physionet record 16265 application results from the flowchart Fig. 9, according to the results of Table 3, the number of cycles that fulfill is 15 cycles. Table 7 The RST amplitude value for each lead II sample is 16265  Table 8 shows the amplitude values of R, S and T in cycle 5 for all samples from Physionet used in this study. Table 9 shows the amplitude values of R, S and T in each lead for the 5 th cycle of the SAH 250-1 sample. Table 10 shows the peak amplitude values R, S and T of lead II in the 5 th cycle for all SAH samples used in this study.  Table 9 RST amplitude value for each lead for 5 sample cycles SAH 250-1   Fig. 7, 9 for the Physionet sample with the following explanation: Table 1 shows that at a threshold of 0.5 mV using the flowchart Fig. 7 illustrated in Fig. 8 which is applied to the Physionet 16265 lead II sample, the amplitude value R (R) and duration value (dR) can be obtained in each cycle. Note that for the first cycle, the amplitude value R is 2,635 mV, at the 85 th integer (N) position. The initial cycle position (Nsc) of the first cycle is 3, while the final cycle position (Nec) is 167. The cycle duration value (dR) is obtained from the Nec value (167) minus the Nsc value (3). And so on for another cycle. Table 2 shows that the amplitude R in Table 1 and Table 2 has the same value because the sample used is the same, namely sample 16265. Application of the flowchart in Fig. 9 which is illustrated in Fig. 10 which is applied to the 16265 Physionet sample, can find the amplitude values R, S and T in each cycle, where the amplitude value S is obtained from the minimum value that is between the amplitude position R and the position Nec, while the amplitude T is obtained from the maximum value between the amplitude positions S up to the position of Nec. Table 3 shows the R, S and T amplitude values for all Physionet samples in cycle 5.

4. Obtaining amplitude S and amplitude T
Tables 2, 4, 6 are the results of the application of Fig. 7, 9 for the SAH sample with the following explanation: Table 4 shows that at a threshold of 1.0 mV using the flowchart Fig. 7 illustrated in Fig. 8 applied to the SAH 250-1 lead II sample, the amplitude value R (R) and duration value (dR) can be obtained in each cycle. Note that for the first cycle, the amplitude value R is 1,816 mV, at the 184 th integer (N) position. The initial cycle position (Nsc) of the first cycle is 95, while the final cycle position (Nec) is 274. The cycle duration value (dR) is obtained from the Nec value (274) minus the Nsc value (95). And so on for another cycle. Table 5 shows the results of applying the flowchart Fig. 9 which is illustrated by Fig. 10 which is applied to the SAH 250-1 sample, can find the amplitude values of R, S and T in the 5 th cycle for standard clinic leads (12 leads). It should be noted that the method for obtaining the amplitude values R, S and T in Table 5 is identical to the method for obtaining Table 2. It should also be understood that the integer positions R, S and T in the reference lead will be the same for the other leads. Table 6 shows the amplitude values of R, S and T for all SAH samples in cycle 5.

Discussion of the results of the amplitude T detection experiment
In this study, the presence of discrete electrocardiogram sample data is necessary because the wave amplitude and the time function are already in the form of a measured value. The search for the maximum amplitude value group to avoid filtering out the P amplitude values and T amplitude values was carried out with a threshold value of 0.6 mV. Filtering one maximum value from this group of amplitude values is the amplitude R, as illustrated in Fig. 8. The results of this filter will produce several maximum values, which are the amplitude R of each cycle, so that it can be interpreted that the total amplitude R is equal to the number of cycles. Cycle duration (dR) to N is obtained by calculating the duration of R N+1 -R N . The initial position of the cycle (sc) of a cycle to N is obtained by means of NR N+! -1.5dR and the final position of the cycle by means of NR N+1 -0.5dR. Obtaining the amplitude position R and the final position of the cycle, the minimum amplitude value between the two is the amplitude S. Knowing the amplitude position S and the final position of the cycle (ec), the maximum amplitude value between the two is the amplitude value T.
The peculiarity of the proposed method is that it only uses ordinary algebraic methods such as addition, subtraction, maximum and minimum but can detect the amplitude T value in each cycle. Compared to the work of other colleagues, the proposed method is simpler and easier to program.
The results of this study have been able to detect the value of the amplitude T and its integer position in each cycle. This is possible because there are two stages that must be carried out on the discrete electrocardiogram data, namely the stage of obtaining the duration of the cycle and the stage of detecting the amplitude T. The stages are carried out sequentially as shown in Fig. 7, 9 where each stage must be completed in order to proceed to the next stage. Compared to other methods which are generally applied to discrete data, the proposed method is more specific because it uses per cycle, namely the positive value between the amplitude S and the end of the cycle is the amplitude T.
The limitations in this study are (1) the examination results data must be in the form of discrete data, (2) the recommended discrete data is sampled with a frequency of 250 Hz (22), (3) the difficulty of obtaining discrete data from standard clinic examination results, causing the number of samples 12 leads is very limited use.
The weaknesses of this study are (1) no comparison has been made due to the limitations of researchers using discrete data to obtain the amplitude T in each cycle, (2) the SAH sample used in this study has not been tested for comparison with the results of the commonly used electrocardiograph examination. These two weaknesses can be overcome in the future if there is an institution or institution that provides discrete data on the results of standard clinic examinations, which can be downloaded by researchers who need them.
In this study only proposes a method for discrete electrocardiogram data processing programs to obtain amplitude T. This program does not yet exist in commonly used electrocardiographs, so it is necessary to develop a combination of hardware as an examination tool with software for data processing, for example a computer-based electrocardiograph.

Conclusions
1. The amplitude R in each cycle can be obtained through two stages of filtering, namely the amplitude filtering stage with a threshold of 0.5 mV and the maximum amplitude value filtering stage.
2. The cycle duration for each cycle is obtained by R to R, namely the NR N+1 position minus the NR N position.
3. The initial position of the cycle (sc) and the end of the cycle (ec) of a cycle electrocardiogram can be obtained by placing the cycle duration values with the formulas Nsc=NR N+1 -1.5dRn and Nec=NR N+1 -0.5dRn.
4. The amplitude position S in each cycle can be obtained by filtering the minimum amplitude value between the amplitude position R and the position ec. The amplitude T in each cycle can be detected by filtering the maximum amplitude value that is between the amplitude S position and the ec position.