MOBILE PHONE APPLICATION FOR SOMEONE FITNESS MONITORING WITH FAST FOURIER TRANSFORM ALGORITHM

The development of science and technology besides facilitating human life in various daily activities. These conditions will cause the body to not fit and the emergence of various health problems. Heart rate is one of the parameters that are useful for providing medical information. Heart rate measurement is very important in the medical world and is one of the standards for knowing one's fitness level. ECG is a medical test to detect abnormalities by measuring the electrical activity produced by the heart. ECG recordings are used to determine the condition of a person's fitness level. Heart rate monitoring can be done using Arduino Uno, AD8232, and Pulse Sensor. The results of heartbeat delivery can be seen through the Android application that was created. A person's fitness level data is sent via DataBase which is then forwarded to the Android application. The value range of a person's fitness level is 49-85 BPM for the male category, while for women with a range of values from 54 to 89 BPM. The error value of detection of a person's fitness level with Sensor Pulse and manual is 2.043%, the sensitivity value is 97.63%, the specificity value is 5.82%, and the accuracy value is 50.35%. In addition, ECG waves are also sent to Matlab for extraction using the FFT algorithm.


INTRODUCTION
The development of science and technology in addition to facilitating human life in a variety of daily activities also brings humans into a lifestyle that is less healthy and lazy to move [1]. This condition will cause the body to not fit and the emergence of various health problems, such as obesity, high blood pressure, diabetes mellitus, and coronary heart disease [2]. Therefore, heart rate measurement is very important to do in the medical world and is one of the standards for knowing one's fitness level [3]. Medical devices that are often used to carry out heart rate measurements namely electrocardiogram (ECG), stethoscope, etc. [4].
ECG is a medical test to detect heart abnormalities by measuring the electrical activity produced by the heart, as the heart contracts [5]. The heart functions to pump blood throughout the body. The heart produces a series of electromagnetic pulses that work continuously with time intervals between each pulse varying dynamically and complex [6]. This ECG recording is used by doctors or medical experts to determine the heart condition of patients, namely to know things such as frequency (rate) of the heart, arrhythmias, myocardial infarction, atrial enlargement, etc. [7].
Heart rate is one of the parameters that are useful for providing a person's medical information, such as psychological, physical, and cardiovascular conditions. With the development of technology, heart rate measurement can be done in real-time and efficiently, one of them is by using a smartphone [8].
From the description above, it proves that it is important to maintain one's health by taking heart rate measurements at any time. Therefore Mobile Phone-Based Applications for Monitoring the Fitness Level of Someone with the Fast Fourier Transform (FFT) Algorithm is one of the innovations that are needed in the medical field. Later this tool will detect a person's fitness level that can be easily accessed using an Android-based mobile phone application.

FFT ALGORITHM
The algorithm used in this study is the Fast Fourier Transform algorithm. FFT is applied in a variety of fields from digital signal processing and solving partial differential equations to algorithms for multiplying large numbers of integers [9].
FFT is an algorithm for calculating discrete Fourier transforms quickly and efficiently. Because many signals in a communication system are continuous, so for the case of continuous signals we use the Fourier Transform. Fourier transform is defined by formula.
and is a constant of the value of a signal, f is the frequency and t is time. FFT uses the concept of calculation which is often called the butterfly method. FFT operates starting with decomposing the time domain N point signal into the N time-domain signal until each one consists of one point [10]. Next, calculate the N frequency spectrum that corresponds to the N time-domain signal. Finally, the N spectrum is synthesized into a single frequency spectrum. The FFT Butterfly Method is shown in Figure 1.

HEART RATE CRITERIA
The criteria for male and female heart rate based on age can be seen in Table 1 [11].  Table 1 explains the range of BPM obtained through male and female heart rate criteria. A person's fitness can be known through one's activities and exercise. In addition, the ECG chart with the category of fit people will be stable at each wave of R-R.

AD8232 module
AD8232 is a module used to measure the electrical activity of the heart. This electrical activity can map as an ECG and output as an analog reader. AD8232 acts as an op-amp to help get clear signals from PR and easier QT intervals [12].
The AD8232 module that has been connected to the Arduino Uno R3 board will be tested if it is given certain treatments such as affixed to the hands and chest. There are several points that can be attached to the ECG Electrode as shown in Figure 2.  Figure 2, a person's heart rate can be detected based on the ECG Electrode attachment point that has been connected to the AD8232 module. The LED indicator light on the module will pulsate with the beat of the heartbeat. The rhythm of the heartbeat obtained from the AD8232 module can be seen in Figure 3.

Fig 3. Heartbeat Rhythm
In Figure 3 it can be seen that the interval R-R is relatively constant from beat to beat with a fit state. The heartbeat condition looks normal because the PQRST waveform matches the ECG signal parameters.

ESP8266-01
Espressif Systems Smart Connectivity Platform (ESCP) is a set of tools that work with high capability, high integrase Wireless SOC networks, designed for mobile which is limited by distance and power. Data from Arduino IDE to Thingspeak is sent via the ESP8266 module that has WiFi enabled through the Arduino IDE program. The sensor sends the data via the ESP8266-01 WiFi module. The results of sending Arduino IDE data to Thingspeak can be seen in Figure 4.

FFT Algorithm
FFT is a Fast Fourier Transform that is the source of an algorithm to calculate the Discrete Fourier Transform (discrete Fourier transform or DFT) quickly, efficiently and inversely. FFT testing is done by recording ECG signals taken from a person's body. The signal is sent via Arduino IDE to Matlab R2017b which is stored in Excel format. The record will be filtered using the FFT algorithm. The FFT extraction listing used can be seen in Listing 1.

Listing 1. FFT Program on Matlab
In Listing 1 we can take an ECG signal that has been recorded and displayed again using Matlab R2017b. The display of the original ECG signal and extraction signal with FFT can be seen in Figure 5.
Fig5. Filter the ECG signal with a sampling frequency of 100 Hz Figure 5 is the pattern of the original heart waveform and has been extracted using the FFT algorithm using Formula 2.1. The results of extraction describe a pattern that is simpler than the original waveform. The FFT algorithm is used to separate signals from ECG waves into frequency compiler components. While other data will be displayed as a frequency spectrum whose magnitude is very small or close to zero.

Fitness Level Detection Results
The BPM value can be detected using a Pulse Sensor by attaching a finger to the sensor. Reads the BPM value based on the condition of the sensor being touched or not. The results of detection of fitness levels displayed on the LCD can be seen in Figure 6.  These results are obtained from a Pulse Sensor that detects the heartbeat on one's thumb. In addition to appearing on the LCD, these results are also displayed on the Android application that was created. The display of heart rate detection on Android can be seen in Figure 7.
The process of data retrieval is done using modules created and manually. Retrieving data using a Pulse Sensor using a finger attached to the sensor. The results of a comparison of heart rate detection can be seen in Table 2. From Table 2, data was collected by taking 10 respondents using two categories, namely diligent exercise and not. The average error value of the comparison is 2.043%. The comparison of Pulse Sensor and manual charts in the unfit category can be seen in Figure 8.
In Figure 8, BPM values above the average are found to be in a state of inadequate condition, this occurs because respondents who have detected a heartbeat rarely move so that the condition is obtained. Comparison of Pulse Sensor and manual charts with fit categories can be seen in Figure 9.

CONCLUSION
Based on the results of testing and retrieval of data on tools and applications made by researchers, it can be concluded several things as follows: 1. Monitoring someone's fitness level can be done by using an Android application that is already connected to the webserver. 2. The BPM value range of a person's fitness level is 49-85 for men, while women with a BPM value of 54-89. 3. Comparison of data using Sensor Pulse and manual has an error value of 2.043%.