Experimental Study for Determining the Parameters Required for Detecting ECG and EEG Related Diseases During the Timed-Up and Go Test

: The use of smartphones, coupled with different sensors, makes it an attractive solution for measuring different physical and physiological features, allowing for the monitoring of various parameters and even identifying some diseases. The BITalino device allows the use of different sensors, including Electroencephalography (EEG) and Electrocardiography (ECG) sensors, to study different health parameters. With these devices, the acquisition of signals is straightforward, and it is possible to connect them using a Bluetooth connection. With the acquired data, it is possible to measure parameters such as calculating the QRS complex and its variation with ECG data to control the individual ’ s heartbeat. Similarly, by using the EEG sensor, one could analyze the individual ’ s brain activity and frequency. The purpose of this paper is to present a method for recognition of the diseases related to ECG and EEG data, with sensors available in off-the-shelf mobile devices and sensors connected to a BITalino device. The data were collected during the elderly ’ s experiences, performing the Timed-Up and Go test, and the different diseases found in the sample in the study. The data were analyzed, and the following features were extracted from the ECG, including heart rate, linear heart rate variability, the average QRS interval, the average R-R interval, and the average R-S interval, and the EEG, including frequency and variability. Finally, the diseases are correlated with different parameters, proving that there are relations between the individuals and the different health conditions.


Background
Currently, the world's population is increasingly aging, promoting research in several medical areas [1]. Due to the increase in life expectancy, the research studies focused on the elderly population are essential to improve the quality of life of the elderly. There are 157 elderly persons per hundred young people, so we can verify that the number of older adults is around 64% higher than young people [2][3][4][5]. Commonly, older adults have different types of pathologies. The automatic identification of these diseases based on the data acquired during the Timed-Up and Go test may allow different preliminary treatments [5][6][7]. The future generation of older adults will use mobile devices intensively [8,9], allowing the possibility of recognizing different types of diseases with these devices [10][11][12][13][14][15]. The evolution and high proliferation of the technological equipment with varying kinds of sensors allow the growth of the development of novel medical solutions [16], promoting the elderly to independent living with remote medical control [17].
Several sensors are embedded in mobile devices, but other sensors may be used in conjunction with the internal sensors to provide different measurements related to various physical and physiological parameters [18,19]. Regarding the analysis of different variables of the Timed-Up and Go test, the accelerometer and magnetometer sensors embedded on mobile devices may be used in conjunction with external sensors to perform complementary measurements [20][21][22].
Previous works show that the accelerometer and magnetometer sensors may support the analysis of the individuals' functionality, including the gait [23,24]. However, one of the significant problems in this type of study consists in the synchronization of the acquisition of the different types of data from the sensors embedded on mobile devices, and the other sensors connected by over-theair connection, including Electrocardiography (ECG) and Electroencephalography sensors (EEG) [25][26][27][28][29]. In addition to this challenge, data processing may include the fusion of the data acquired from different sources.
One of the most common tests for the assessment of the performance of the lower limbs is the Timed-Up and Go test, where the analysis of the data acquired from different sources allows the recognition of several healthcare problems, including balance, mobility, fall risk, Parkinson's disease, amyotrophic lateral sclerosis, and other orthopedic, cardiovascular and brain pathologies [30][31][32][33][34][35].
The use of ECG and EEG sensors in conjunction with Timed-Up and Go tests allows cardiac problems and other problems associated with the nervous system to be monitored for the first analysis of emergency [25][26][27][28][29]. One of the low-cost solutions that may be used in conjunction with mobile devices is the BITalino device and its sensors [36]. The BITalino device is an example of biomedical equipment that is scalable and versatile, used for the acquisition of different biosignals transmitted by Bluetooth. The ECG sensors detect the duration and variation in size of the ECG waves used for the abnormalities of heart rate. Furthermore, the EEG sensor is used for the capture of the brain activity and it is positioned in a bipolar configuration with two measurement electrodes for the detection of electrical potentials. Combining smartphones with these devices and sensors may allow for the acquisition of cardiac signals, realizing the relationship of these signals with diseases associated with the heart, and the recognition of different healthcare problems.
In this work, we build upon previous studies [37,38] related to the acquisition of data from the accelerometer and magnetometer sensors available on the off-the-shelf mobile devices, pressure sensors available in the back of the chair, and ECG and EEG sensors, for the detection of different types of movement, and cardiac and brain problems. This paper aims to design and develop a method for the acquisition, analysis, and identification of different patterns of diseases with low-cost sensors. To facilitate this, the proposed solution uses embedded smartphone sensors and additional ones connected to a BITalino device [36] to identify patterns in measured ECG and EEG signals during Timed-Up and Go test and find their relation to existing illnesses of patients. We show that such correlation exists and that it can be used to identify emerging medical conditions, so they can be treated from early on.

Motivation
This research is supported by the ability to accurately identify various parameters during the Timed-Up and Go test [39]. However, the use of mobile devices to help the capture of the various sensors poses several additional restrictions associated with the memory, power processing, among others [40,41]. The data captured during the Timed-Up and Go test are essential for further measurements, where we intend to create a large dataset from different sensors used for additional measures of various diagnostics in medicine.
Different diseases may be recognized by the use of the Timed-Up and Go test [42], allowing healthcare professionals to assess different healthcare conditions of older adults. This implementation may be first aid or preliminary detection of various diseases in an initial state [43]. As it is an easy test, it may be performed with people with neurological disorders [44], allowing the pattern recognition of different diseases. Several parameters may be measured for the detection of cardiac diseases, including the heart rate, linear heart rate variability, the amplitude of complex QRS, and amplitudes of R-R and R-S intervals, for the detection of different diseases.

Prior Work
The ECG and EEG signals have been used in the past for the recognition of different diseases. The authors of [45] filtered the acquired ECG data and applied a differential transfer function to the signal. The authors of [45] also squared the ECG signal to obtain information about the waveform and to calculate the heart rate. According to the authors of [45], a heart rate below 60 bpm is related to the presence of a bradycardia disease. A tachycardia is identified with a heart rate higher than 100 bpm. In continuation, the premature ventricular contraction is recognized for an amplitude of the QRS complex higher than 120ms [45]. Bradycardia and tachycardia diseases are not identified, but the heart rate is not between 60 and 100 bpm, the premature atrial contraction may be recognized [45].
The detection of different diseases, including normal sinus rhythm, premature atrial beat, atrial fibrillation, supraventricular tachyarrhythmia, pre-excitation, premature ventricular contraction, ventricular bulge, ventricular triplet, ventricular tachycardia, idioventricular rhythm, fusion ventricular block beat of the left branch, block beat of the right branch, were recognized with neural networks with features related to the normalization, maximum pooling, flattening, density, among others, related to several sliding windows [46]. The measurement of the P-R interval and the amplitude of QRS were also used for the recognition of cardiovascular death [47].
In [48], the authors recognized primary and secondary pulmonary hypertension with the amplitude of the P wave in the II derivation, the frontal mid axis of the QRS complex, duration of the QRS complex, deviations of the R and S waves in leads I and V6 and the T wave configurations in the precordial leads, where the best correlation was obtained with the value of the frontal mid-axis of the QRS complex.
The authors of [49] developed a method to detect atrial fibrillation based on the absence of P wave, irregular heart rate, and other variables related to the atrial activity. The implementation of the Pan Tompkins algorithm was used to detect arrhythmias with features related to frequency and time domains [50]. The detection of the coronary artery disease was recognized by the amplitude of QRS interval, and depressions S-T and T wave [51].
With the use of neural networks, the authors of [52,53] also detected various cardiac diseases, including left bundle branch block, right bundle branch block, premature ventricular contraction, Wolff-Parkinson-White syndrome, myocardial ischemia, and myocardial injury, with the duration of P, S, T and QRS, P-R and Q-T intervals, P, R and T amplitudes, and S-T segment.
Parkinson's disease may be detected with different features, including R-R, P-R, QRS, and Q-T intervals, and the heart rate measured and corrected by Q-T interval, analyzing the Spearman correlation coefficient [54]. Based on different features, including heart rate, P, T and QRS intervals, P durations, and P-R, QRS, Q-T and corrected Q-T intervals, ventricular activation time, and frontal plane axis, the authors of [55] recognized left and right ventricular hypertrophies.
Related to the EEG signal, the authors of [56] implemented machine learning methods for the recognition of various diseases, including Alzheimer's disease, with different statistical, amplitude, and frequency-based features. On the other hand, the authors of [57] implemented machine learning methods with time-domain features. Epilepsy is detected by various studies with machine learning methods, including Support Vector Machine (SVM), adaptive neuro-fuzzy inference system, and linear classifier, based on different features based on wavelet coefficients, including 2nd order cumulants (mean ± standard deviation), asymmetry, kurtosis, spectral, Renvi, Kolmogorov-Sinai, variance, energy, and the maximum and minimum values of the power spectral density [58][59][60][61].
Based on signal strength, window strength, and sample entropy, Alzheimer's disease is correctly recognized with linear discriminant analysis [62]. Finally, acute ischemic stroke is detected by the densities of the power spectrum acquired by different devices [63]. As presented in Table 1, the diseases recognized by the ECG and EEG sensors are distributed by the number of the studies analyzed. [63] 1

Purpose of the Study
The hypothesis of this research is that Android smartphones complemented by affordable external ECG and EEG sensors can provide a reliable method for the identification of different diseases. In particular, the paper aims to identify the different waves from the ECG and EEG sensors, calculate various metrics based on them, and verify that each disease has distinct features that can facilitate its identification.
The presentation of a method for recognizing the diseases related to ECG and EEG data with sensors, available in off-the-shelf mobile devices, and sensors connected to a BITalino device during the performance of the Timed-Up and Go test is the main contribution of this paper. This document presents the measurement of different features to create a reliable dataset for the recognition of the various diseases present in the sample in analysis. Additionally, this paper presents a state-of-the-art review of the methods used in the literature to identify illnesses related to ECG and EEG signals. The use of mobile devices proves its usability in these types of studies.
The data were previously acquired from people aged between 60 and 97 years old with several diseases. Clinicians already identified the disorders of each participant for the success of this study related to automatic identification, including arterial hypertension, depression, cardiac arrhythmia, coronary artery disease, and Parkinson's disease. These diseases are only recognized with ECG sensors, where the EEG sensor is only used to detect possible abnormalities. The data acquisition was performed by institutionalized people in the Centre region of Portugal, explicitly in the municipalities of Fundão and Covilhã.
The data acquisition was performed during the performance of the Timed-Up and Go test with Android devices. The accelerometer and magnetometer data from the embedded sensors feature on the mobile device, pressure sensor data are placed on the back of the chair, and the EEG and ECG sensors are connected to the individual for the data acquisition. The mobile application simultaneous acquire the data from the different sensors, where, after data acquisition, the various text files were uploaded to the Cloud by using the FireBase service.
Commonly, ECG and EEG data are captured while the subject is stationary. Contrary to that, The Timed-Up and Go test involves movement. Be that as it may, there are approaches such as [63] which show that, even in cases when the subject is moving, recognition of different diseases related to ECG and EEG data [64] is still possible. This would be convenient for the users to perform these measurements while having light movement during other tests. Moreover, there also be some advantages to this approach because it can emphasize some emerging medical conditions that may become more apparent during movement. This subject is related to Internal Medicine, and the recognition of different diseases in an early stage is excellent for the treatment of different diseases [65,66].
After the data acquisition, the ECG and EEG data were processed, and the different features were extracted. The features extracted from the ECG sensors were the heart rate, the linear heart rate variability, the average QRS interval, the average R-R interval, and the average R-S interval. Next, the features extracted from the EEG sensor were frequency and variability.
The different features were correlated with the institutions, and the diseases present in the sample. Initially, the correlation between the values extracted from the sample and the diseases identified by the healthcare professionals was performed, verifying that they are commonly determined by different parameters, except the coronary artery disease and bilateral gonarthrosis. Applying different statistical tests, we also proved different correlations between diseases, and parameters extracted, as presented in Section 4.1.

Structure of the Study
The remaining sections of this paper are organized as follows: Section 2 presents the methods used for the analysis of the data acquired from ECG and EEG sensors during the performance of the Timed-Up and Go test by older adults. The study design and participants' description of the Timed-Up and Go test, the data processing and acquisition processing, and the statistical analysis are presented in Section 3. In continuation, Section 4 discusses the main findings and limitations of the study. The comparison with prior work is also shown in Section 4. Finally, the conclusions of this study are presented in Section 5.

Study Design and Participants
For the acquisition of data related to the Timed-Up and Go test, this study is designed to use one mobile device with accelerometer and magnetometer sensors, and two BITalino devices with pressure, ECG, and EEG sensors. The mobile device is used for data acquisition and to send the collected data to the server. Several environments may be recognized, but our focus is related to healthcare. This study is a trial to check if, during the performance of the test, we can identify different types of diseases.
This study's target is related to the population with cardiac and brain problems institutionalized in retirement homes and aged between 60 and 90 years. The sample for the analysis was selected in collaboration with the people responsible in the retirement homes. The requirement is related to the possibility of having mobility capabilities to perform the test. The volunteers were informed of all the rules to complete the test and the instrumentation. They signed the ethical agreement to publish the results of the experiments in an anonymous form.
The tests were performed with a XIAOMI MI6 with the Android operating system, but the different environment variables vary between the various institutions, which influences the data acquisition. The different individuals performed the test between October and December 2019 several times. Initially, the test was performed by 40 older adults, however, due to the over-the-air connection constraints, the ECG and EEG signals were only reliable acquired from 14 individuals with mean age 83.1 and a standard deviation of 7.4. The various healthcare diseases were presented in Table 2. The different volunteers have different types of diseases, including multiple sclerosis, diseases related to the heart, such as arrhythmia, or illnesses associated with mental health, such as Parkinson's disease. Of the participants, 50% had a chair with supports and also 50% of them had good mobile network coverage. Only 14% of the patients were monitored by a physical therapist. The physical condition of 14% was good, 43% were narrow and tight, and 43% had a slope. Thus, the acquired data are heterogeneous. Parkinson's disease is commonly classified as an illness related to mental health, but the derivations of ECG sensors frequently detect it.
The sample selected has different cardiac and brain problems that result in the creation of a dataset with varying types of data that will be processed, as presented in Section 2.2. The essential diseases analyzed were arterial hypertension, depression, cardiac arrhythmia, coronary artery disease, and Parkinson's disease. The mobile application acquired the data from different sensors with different delays. The accelerometer and magnetometer sensors receive the data every 1 ms, and the pressure, ECG, and EEG sensors acquire the data every 10 ms. The EEG and ECG values taken into account in this study are related to the alpha channel of the sensor. The electrodes of the EEG sensors were placed in the electrically neutral location (left) and measurement electrodes (right), and another electrode in a region of low muscular activity as reference. The two electrodes of ECG sensor were placed at the wrist of the individual. The ECG and EEG sensors connected to the BITalino device has only one channel for the acquisition of the data [36]. The data acquisition process starts with an acoustic signal, which signals the start of the data acquisition.

Description of the Timed-Up and Go Test and Data Acquisition and Processing
In 1991, the Timed-Up and Go was created to help the healthcare professionals for the measurement of the risk of falls [60]. The Timed-Up and Go test is composed of various phases: sitting on the chair, lifting from the chair, walking for three meters, reversing the direction of walking, walking another three meters towards the chair, and sitting on the chair.
During the test's performance, some technical issues influence the acquisition of signals by the BITalino device, such as the failure of the sensors data acquisition, the Bluetooth connection is lost, among others. This makes it more complicated to perform realistic studies on the field with actual patients, therefore the number of valid data points was reduced. The acquisition of different types of data was performed with a mobile device and two BITalino devices. The sensors used for the measurement of the results of the test and other complementary sensors may be used for the analysis of different parameters of healthcare diseases.

Statistical Analysis
After the acquisition of the data from the sensors, available in off-the-shelf mobile devices, and the sensors connected to the BITalino device, the data analysis was performed. The main goal is to analyze the data acquired from the ECG and EEG sensors during the performance of the Timed-Up and Go test for helping in recognition of the diseases associated with these sensors. Firstly, the ECG data were processed for the extraction of heart rate, linear heart rate variability, the average of QRS interval, the average of R-R interval, and the average of R-S interval. Finally, the EEG sensor as processed for the extraction of its frequency and variability.
After measuring the different variables, descriptive statistics, normality tests, and detection of outliers were performed. In addition, a statistical comparison between them was performed, analyzing and comparing the results by the averages of each institution, person, age, and healthcare diseases.

Data Acquisition
The data were acquired by a mobile application installed in an Android device. It was developed with Android Studio. As presented in Figure 1, the mobile application is composed of components for data acquisition, storage, and send it to a FireBase server. The mobile application acquired data from the onboard sensors, i.e., accelerometer and magnetometer, and two BITalino devices connected by Bluetooth. The BITalino devices receive different sensors' data at a sampling rate of 10 kHz and 16 bits of precision. The data acquired by onboard sensors are collected with a sampling rate of 1 kHz and 16 bits of precision. Firstly, the ECG sensor was attached to the user in three positions with electrodes on the arm. Finally, the EEG sensor was positioned on the head with two electrodes. This position of the sensors was discussed with healthcare professionals related to medicine and physiotherapy subjects.
On the one hand, this mobile application performed a continuous data collection using the builtin magnetometer and accelerometer sensors. The data were collected with a sampling rate of 1 kHz and 16 bits of precision. On the other hand, the mobile application handled the communication technologies required to receive data through Bluetooth from the BITalino device with a pressure sensor. Still, it was also responsible for sending the collected data to the FireBase service for storage.

Requirements
The requirements for performing the experiments were related to the environment and the individual. The individual must have the mobility to complete the test. For the performance of the Timed-Up and Go test, the material and equipment needed consists of a chair, a tape measure to identify the distance to walk, adhesive tape to mark the end of the three meters, where the individual should reverse the gait, two sports belts, where one is for the mobile device and another one for the BITalino device to measure ECG and EEG data, two BITalino devices and one mobile device. The ECG and EEG sensors consisted of the use of electrodes placed in the individual before the test (i.e., three electrodes for ECG sensor, and two electrodes for EEG sensors).

Validation
The data acquired from the ECG and EEG sensors allowed us to measure different parameters found in the literature, namely: • ECG sensor: Heart Rate; Linear Heart Rate Variability; Average of QRS interval; Average of R-R interval; Average of R-S interval. • EEG sensor: Frequency; Variability.
In the subsequent sections, the results of the comparison between age and the different variables measured (Section 3.3.1), finalizing this section with the descriptive statistics of the experiments by diseases (Section 3.3.2).

Results by Age
The average age of this group of individuals is 83 years old, varying between a minimum of 71 and a maximum of 97 years of age. The standard deviation is approximately 7 years old, and the respective coefficient of variation (CVs) is 9%, so we can consider the average as a good central indicator of the sample. Thus, in order to study the parameters analyzed by age, we started by organizing individuals into two groups separated by the average sample value, namely individuals aged 83 years or less and individuals aged over 83 years. The age frequency distribution can be seen in Table 3 as <= 83 years old and >83 years old. For the analysis of the signification differences between the averages of age groups, the Student t-test was used to compare the average values. The assumptions of normality were validated, and the equality of variances was tested using the Levene F-test, and it was concluded that the variances between the two age groups for all parameters under analysis are equal (Pr (F > F-test) = p-value > 0.05) ( Table 4).
Initially, we processed the ECG and EEG sensor data to identify the different variables. In Table  3, we can also observe the results of the Student's t-test, through the respective limited probability associated with the test statistic (p-value) and the mean values for the different age ranges for the heart rate, linear heart rate variability, the average of QRS interval, the average of R-R interval, and the average of R-S interval variables obtained with the ECG sensor, and the frequency, and variability obtained with the EEG sensor, of the 11 individuals separated by age. Following the results by age, there are no homogeneous groups found in the sample.
Through the results of the t-student test, we can conclude that, statistically, there are no differences between the means of the two age groups for someone of the analyzed parameters ((Pr (|T|> t -test) = p-value > 0.05); that is, age is not discriminating anything within each parameter Finally, we processed the ECG and EEG sensor data to identify the different variables. In Table  5, the average values are presented for the heart rate, linear heart rate variability, the average of QRS interval, the average of R-R interval, and the average of R-S interval variables obtained with the ECG sensor, and the frequency, and variability obtained with the EEG sensor of the individuals separated by disease. This analysis was performed with the disorders present in more than one person. Following the results by illness, there are no homogeneous groups found in the sample.

Main Findings
During the performance of the Timed-Up and Go test, we used ECG and EEG sensors to acquire the data and correlate the presence of mental and cardiac diseases. The sample of this study includes a diversity of people with different disorders. Thus, the experimental set was composed of sensors available in the off-the-shelf mobile device, i.e., accelerometer and magnetometer, and a pressure, ECG, and EEG sensors connected to a BITalino device. These sensors are practical to use and noninvasive, allowing the acquisition of different types of data. The data were acquired since the individual gets up from the chair and returns to the initial position.
This test was applied to older adults, who anonymously provided their age and information about their diseases for further analysis of the data acquired. The study of the data was performed considering three viewpoints: the viewpoint by age, by the institution, and by diseases related to cardiac and neurological problems. Between the persons analyzed, none of them reported neurological disorders. They reported illnesses that can be detected with ECG and EEG sensors, including arterial hypertension, arrhythmia, heart failure, coronary artery disease, Parkinson's disease, and others. By the end, the environmental conditions may have also affected the results of the test. The ECG values for the arrhythmia and heart failure are similar, and the values for identifying Parkinson's disease, and bilateral gonarthrosis are identical.
Therefore, we performed two types of analysis. These are the relation of the data acquired by the different sensors and the diseases reported by the individuals. After that, the statistical correlation between the data obtained and the disorders said.
Starting with the analysis of the data reported by the individuals, and based on the information related to the previous works, arterial hypertension may be identified with the amplitude of QRS interval lower than 700 ms, where most of the analyzed individuals reported this disease, except the persons 4 and 11.
In continuation, the identification of persons with arrhythmia or heart rate failure is identified by the irregularities of the heartbeat. Thus, the linear heart rate variability may be used to recognize these types of diseases, verifying if it is higher than 100%. Most of the persons reported these diseases, such as the persons 2, 6, 7, 8, 10, and 11.
Finally, the identification of Parkinson's disease and Bilateral gonarthrosis can be performed with the high average of QRS interval and an average R-R interval of more than 2000 ms, allowing the easy recognition of persons 4 and 11. However, person 10 also has bilateral gonarthrosis, but it is not very well recognized because other diseases are present in this person. In this case, the differences in the data related to the Bilateral gonarthrosis and other diseases are minored.
Due to the different conditions of the test's performance, arterial hypertension is more verified in persons of different ages, except the persons with 76 and 97 years old. Additionally, comparing the different ages, arrhythmia, or heart rate failure is only verified with the increasing, where the persons with age equal to 81, 83, 84, 89, and 97 years old. A pattern of persons with coronary artery disease cannot be identified with the comparison of the different ages. In addition, analyzing the different ages, Parkinson's disease, and Bilateral gonarthrosis can be verified in persons aged 76 and 97.
Generally, the difference is correctly identified with the various parameters and constraints during the data acquisition. There are no diseases related to the EEG reported by the population, but it is verified that the variability of brain activity increases with age. Additionally, brain activity is lower in people with Parkinson's disease.
For the diseases and parameters, the two-way analysis of variance test (two-way ANOVA) was performed with the aim of verifying the interaction between the two factors, in order to understand the presence of a disease affected by the values recorded by ECG and EEG sensors.
The model that includes the sources of disease variation and the interaction parameters vs. diseases is highly significant (Pr (F > F test) = 0 for both sources of variation), which means that there is an interaction between both parameters and disease factors.
Through the analysis of the confidence intervals for the mean of interaction between Heart Rate with Diseases, it is possible to conclude that there are no significant differences between the mean values of this interaction (Figure 2)   Figure 2. The 95% confidence interval for mean of interaction between Heart Rate with Diseases.
Through the analysis of the confidence intervals for the mean of interaction between Linear Heart Rate Variability with Diseases, it is possible to conclude that there are no significant differences between the mean values of this interaction (Figure 3).  Through the analysis of the confidence intervals for the mean of interaction between Average of R-R interval with Diseases, it is possible to conclude that there are significant differences between the average values of this interaction. In fact, the average values recorded in patients with Bilateral gonarthrosis is statistically higher than the values recorded in patients with arterial hypertension, depression, Diabetes mellitus Type II, Osteoarthritis and Osteoporosis ( Figure 5). On the other hand, in the case of these last two diseases, the averages of QRS interval values are expected to be statistically equal but lower, followed by depression. Figure 5. The 95% confidence interval for mean of interaction between Average of R-R interval with Diseases.
Through the analysis of the confidence intervals for the mean of interaction between Average of R-S interval with Diseases, it is possible to conclude that there are no significant differences between the average values of this interaction ( Figure 6). Even so, the average value of this parametron in vertigo syndrome is highlighted. On the other hand, we highlight similar intermediate values for arterial hypertension, cardiac arrhythmia, heart failure, osteoarthritis, osteoporosis and hyperuricemia, as opposed to depression with a lower value. Through the analysis of the confidence intervals for the mean of interaction between Frequency of EEG with Diseases, it is possible to conclude that there are no significant differences between the average values of this interaction (Figure 7). Even so, the average value of this parametron n in vertigo syndrome disease stands out with higher values, followed by osteoarthritis and osteoporosis. In contrast, cardiac arrhythmia, hyperuricemia, and arterial hypertension.  Figure 7. The 95% confidence interval for mean of interaction between Frequency of EEG with Diseases.
Through the analysis of the confidence intervals for the mean of interaction between Variability of EEG with Diseases, it is possible to conclude that there are no significant differences between the mean values of this interaction ( Figure 8). In Figure 9, we can verify the estimated marginal averages resulting from the interaction between parameters and diseases. The parameters of heart rate, linear heart rate variability, average of QRS amplitude, and EEG variability are practically constant for the diseases analyzed.
In the case of arterial hypertension, cardiac arrhythmia, Diabetes mellitus Type II, Vertigo Syndrome and Hyperuricemia, the values of Average of R-S interval are higher than the values of Frequency EEG. For depression and Bilateral gonarthrosis, the reverse is true.
We can also verify that when these two parameters are the same, we are in the presence of heart failure, osteoarthritis or osteoporosis.
Following the Average of R-R interval, we observed that a large difference between this parameter and the Average of R-S interval can mean the presence of Bilateral gonarthrosis disease, cardiac arrhythmia or arterial hypertension. Lower differences can mean the presence of osteoporosis, osteoarthritis, depression or hyperuricemia.  Figure 9. Marginal estimated means of the interaction between diseases and parameters.

Limitations
In carrying out the experiments, the capture and calculation of the different features posed some challenges. Thus, the elderly had very different health states, which meant that the acquired values showed high heterogeneity. The environment for the performance of the test also varies, causing different variations on the data.
As the acquired data were stored in the FireBase service, which needs an available Internet connection that sometimes is not possible in real-time. Additionally, as we were using the BITalino device to acquire the data from pressure, ECG, and EEG sensors, the use of the over-the-air connection, i.e., Bluetooth, failed sometimes, causing some inconsistencies in the data. If detected, the individuals repeated the experiments to obtain reliable data. Commonly, all participants performed the experiments three consecutive times.
Finally, another limitation present in the different experiments was related to data processing and storage, which may be difficult to perform in real-time on the mobile device. The BITalino device does not include the timestamps, but it includes a control bit every 10 ms, where we consider its capture after the start of the data acquisition. The data acquisition was started with an acoustic signal, where the data started to acquire. The major challenge was related to the synchronization of the data acquisition, which was sometimes not possible.

Comparison With Prior Work
Based on the studies analyzed in Section 1.3, 24 diseases were recognized in the 17 research studies, but the majority lack the presentation of detailed parameters for the detection. Still, the majority (20 diseases) does not present the details about the recognition, providing only information about the use of artificial intelligence. Between the diseases reported in the literature, Cardiovascular death [47] is detected by the measurement of the P-R interval, and the amplitude of QRS complex. Next, the Primary and secondary pulmonary hypertension [48] is detected with the Frontal mid-axis of the QRS complex. Coronary artery disease [51] is detected by the Amplitude of QRS complex, and depressions of S-T and T-wave. A couple of diseases, i.e., Left and right bundle branch block, premature ventricular contraction, Wolff-Parkinson-White syndrome, myocardial ischemia, and myocardial injury are detected by the authors of [53] with durations of P-wave, S-wave, T-wave, QRS interval, P-R interval, Q-T interval, and S-T segment, and the amplitudes of P-wave, R-wave, and Twave. Parkinson's disease and Bilateral gonarthrosis are detected by the authors of [54] with the duration of R-R interval, P-R interval, QRS interval, and Q-T interval. In [55], left and right ventricular hypertrophies are detected with the measurement of heart rate, amplitudes of P-wave, T-wave, and QRS interval, and durations of P-wave, P-R interval, QRS interval, Q-T interval, and corrected Q-T interval. In continuation, Alzheimer's disease [56,57,62] is commonly detected with statistical, amplitude and frequency-based features, and signal strength, window strength, and sample entropy. Acute ischemic stroke [63] is detected with densities of the power spectrum. Finally, Epilepsy [58][59][60][61] is detected with the 2nd order cumulants (mean ± standard deviation), asymmetry, kurtosis, spectral, Renvi, Kolmogorov-Sinai, variance, energy, and the maximum and minimum values of the power spectral density. Between the four diseases that have details about the recognition, i.e., Bradycardia, Tachycardia, Premature ventricular contraction, and Premature atrial contraction, one of them was available in our dataset as presented in Table 6. We also verified the normal values of the different parameters for further comparison [67][68][69].
However, the diseases highlighted in Table 6 were present in our dataset, which verified different conditions for its recognition. Considering the values available in Table 6, it is possible to verify the effects of different diseases and the age of people analyzed in the different studies. The values presented by the authors of [45] are correlated between older adults and healthy adults. The values presented by the authors of [49] are not comparable as the authors did not present the values obtained. The authors of [50] also did not present the values of heart rate variability, but a pattern was verified with our study. Comparing the values reported in other studies to the ones reported in our study, it is evident that the durations of R-R and QRS intervals are higher in older adults. This is an interesting observation that could have policy implications. For example, some policies might be enhanced to include additional analysis with ECG and EEG during Timed Up and Go tests to hopefully detect some emerging medical conditions before they become too serious. However, in some cases, our dataset may not be enough for the identification of the right patterns, as verified in the recognition of Coronary artery disease. To do that, more individuals with different disorders are needed. Likewise, if some medical condition is identified with the proposed approach, it should be validated with a more traditional clinical method to avoid false positives.

Conclusions
The use of functional tests with systems that allow the acquisition of biological signals presents an optimal combination when we want to conclude investigations of this type, and the main goals of this study were to design and develop a method for the acquisition, analysis, and identification of different patterns of diseases with low-cost sensors.
As it was included in research on the results of the Timed-Up and Go test, it was only possible to collect the ECG and EEG signals from a small number of individuals. In the future, this study should be extended to a larger sample to investigate other dependencies. The reported values are in line with other studies in the literature.
In this sense, the Timed-Up and Go test, with all its phases and aspects, presents itself as a great example because it allows the analysis of data related to movement and therefore applied to physiotherapy. On the other hand, the measurement of physical effort and the measurement of signals related to the cardiac and neurological systems can also be calculated and analyzed.
The ECG and EEG data allow us to know and analyze the functioning of the heart and brain during the effort. The use of statistical methods of analysis based on the variance in each individual, considering their physical state, allows us to know and build a set of relationships and patterns for each of the diseases related to the cardiac and neurological system.
The presented results show that it is possible to find correlations between existing diseases and different features extracted from ECG and EEG signals collected during Timed-Up and Go tests. The applied statistical methods suggest that investigation of this type can be critical in helping doctors and in the first analysis of a patient. It shows patterns in the analyzed diseases, showing that people with the same diseases have very similar values, which is very encouraging considering the aim of the study-to detect emerging medical conditions early on. The main contribution of this paper is that the proposed solution was developed end-to-end and uses affordable sensors and devices, and computational methods that are easily deployed on mobile devices with limited computing power and battery capacity.
In the future, and as the development of this research, it will be important to apply artificial intelligence and machine learning methods to allow the calculation and identification of diseases automatically.