scieee AI-readable full text Open interactive document viewer

FEX3-ECG/MS01,v1.0.4: Least Squares Approximation of ECG Signals with Rational Functions

Kobzos, Laszlo

Abstract

We introduce a new algorithm for "Least Squares Approximation of ECG Signals with Rational Functions". This version (1.0.4) only differs from the very first one (1.0.0): - (1.0.1) in that its filetype is now pdf and not rtf, - (1.0.2) there are already URLs in [2], [3] and [4] of "7. References", and - (1.0.4) there are already 1 example Figures from [2r].There are no Figures in the MS01v102.pdf ("Project milestone") description below. Figures are contained in [1r] and [2r], referred to in the description as FEX3-ECG/Charts01 and FEX3-ECG/Charts02. The reason for this is that they contain — among other things — 50 large-sized (~1800×800 pixels) gif images. Therefore, we recommend downloading and extracting the 2 zip files into 2 directories.In the future, we also plan to upload the programs and their descriptions. DURING THIS TIME, ALL PROGRAM DESCRIPTIONS HAVE BEEN COMPLETED. ALL OUR ARTICLES ARE EASILY ACCESSIBLE, IN CHRONOLOGICAL ORDER:https://zenodo.org/search?q=creators.name%3AKobzos&l=list&p=1&s=10&sort=oldest References:[1r] Kobzos, Laszlo. (2022). FEX3-ECG/Charts01: Least Squares Approximation of ECG Signals with Rational Functions. Zenodo. https://doi.org/10.5281/zenodo.6479410[2r] Kobzos, Laszlo. (2022). FEX3-ECG/Charts02: Least Squares Approximation of ECG Signals with Rational Functions. Zenodo. https://doi.org/10.5281/zenodo.7365661 Kobzos, Laszlo Location: HU (Budapest) email: [email protected]

Full text

Least squares approximation of ECG signals with rational functions Kobzos, Laszlo [email protected] 1. Abstract Our purpose: feature extraction from one period of leads of ECG signals for AI (artificial intelligence), mainly for screening tests purposes. Method: approximation of the signal by changing the parameters of the rational function written in the form below (product of factors), using the Levenberg-Marquardt method. Results: the first 95 signals of the database were all successfully approximated. The drawback is that our procedure is currently time consuming. The reason is the non-automatic generation of the initial parameter sets of the approximations: “view the drawing – select next step – mark points on the drawing”. However, this method has the advantage of not requiring full medical expertise. 2. Introduction In the 1970s, one of the departments of the Research Institute for Telecommunications (TKI, Távközlési Kutató Intézet, Budapest, Hungary) was also involved in the digitisation, transmission, storage and computer processing of ECG signals. Medical expertise was provided by a department of the National Institute of Cardiology (OKI, Országos Kardiológiai Intézet, Budapest, Hungary). Work phases were regularly reported at the Neumann Colloquia in Szeged. The following description is a late continuation [2, 3, 4, 5] of these old works [1]. A lot has changed since then, including the advent of PCs, the Internet, e-mail, GNU SW, and databases. The TKI has ceased to exist, and the name of the OKI has changed, now: Gottsegen National Cardiovascular Center (Gottsegen György Országos Kardiovaszkuláris Intézet). Although a diagnosis cannot be made on the basis of an ECG alone, its findings provide a strong support for the diagnosis. The analysis of the signal is made difficult by noise due to several causes (such as muscle tremors and respiration), and filtering these out by frequency can distort the useful signal. The original signal, even if digitised (sampling and quantization), is generally not suitable for machine learning procedures. In principle, the aim is to determine those parameters of the signal that contain all the biologically useful information, but with as few parameters as possible. Of course, this is only possible with trade-offs, and unfortunately, the ECG signal does not contain such natural parameters. Since cardiologists are very good at evaluating ECG signals by analysing their shapes on the basis of the expertise they have accumulated over almost a century, we also consider the shapes to be important. A common method is to approximate the signal using a function with parameters that can be set, so that the difference between the signal and the shapes of the function (in the biologically relevant parts) is small. Then the parameters of the function that approximate the signal will be considered to be characteristic of it. For this purpose, we have chosen rational functions. 3. Objective Our goal is to extract the feature data (FEX, Feature Extraction) from one period of ECG signals needed for artificial intelligence (AI) and more narrowly for machine learning (ML), and even more narrowly for supervised learning (SL). Given the wide variability of ECG signals, we believe it would be useful to first develop a method of classification into three categories, similar to medical screening tests. These categories are: “healthy”, “needs to be seen by a cardiologist”, and “intermediate”. Of course, even when machines will learn to classify into several categories, it would still not be about a machine replacing the cardiologist. The decision is always the responsibility of the medical doctor! Similarly, the result of a laboratory test is also evaluated by a doctor together with a lot of other information (such as symptoms, other findings and anamnesis). Rational functions were chosen to approximate the waves in a period from one lead of the ECG signal. Narrowed down: the coefficients are real; the fraction is a proper fraction (the degree of the denominator is greater than that of the numerator); and the denominator has no real roots. If you look at these functions, you can see that they behave similarly to the waves of the ECG signal (P, QRS, and T): they have negligibly low values before and after the wave. 4. Method 4.1. The approximation function For the approximation, the rational function was written in the following form (~shape with a root factor): where · indicates multiplication. It is known about polynomials that: "any polynomial with real coefficients is a product of linear and/or irreducible quadratic factors with real coefficients." For example here:[12] All parameters are real-valued, and the possibility of multiple roots can be ignored. In this form, the parameters to be determined are the values of d c g a h b and not the coefficients of standard form of a polynomial. Each wave of the ECG signal is approximated separately. Therefore, the approximation of the whole period will be the sum of the approximations of the individual waves (plus the baseline). When the approximation of a wave is complete, it will be subtracted from the signal approximated until that point, and the difference will become the new signal to be approximated. In the final step, the difference will be the sum of the noise and the error of the approximation. 4.2. Here the notations are as follows t: time, the argument of the function d: the leading coefficient c: the root of the linear factor in the numerator. This factor may be missing. Quadratic factors may also be missing in the numerator. If any of the quadratic factors in the numerator contains the "–" value (of the "±" signs), then the form of the complex conjugate root pair will be g±a.i; if it contains the "+" value, then the two real roots will be g±a. In the denominator, in all cases the complex conjugate root pair will be h±b.i. The denominator never has a real root, since b² is always non-negative (in practice, it is always positive). The roots of the denominator and the numerator are called poles and zeros, respectively. For complex conjugate root pairs, the root locations are h and g, while b and g are shape parameters. 4.3. Properties of the above function form The real roots of the numerator can be very well determined, but not accurately because of the noise, since at these locations (times) the signal is 0. Their number depends on whether there is a linear factor; if their number is odd, and then the answer is yes. From an even number of real zeros, we combine each pair into a single quadratic factor. The real parts (place, time) of the poles and zeros are within the given wave (P, QRS, T) or in the immediate vicinity of the wave. All parameters - except for the leading coefficient d - are time unit, and are almost of the same magnitude, unlike the coefficients of powers of t in the standard form of polynomials. Below we also write about other properties of the rational fractional function written in the above form. 4.4 The norm and tools used for approximation Because of the noise in the ECG signal, it was practical to use the standard l2 norm (square root of the sum of the squares of the deviations) to minimize the deviation. The functions written in the form above do not form an orthogonal system of functions, and the standard linearisation method cannot be applied, so we had to use a different, non-linear tool. For the minimisation, we used the MINPACK library downloadable from the Netlib Repository [8]. MINPACK employs a modified Levenberg-Marquardt method (This directory contains the double-precision versions). Choosing the lmdif.f subroutine from MINPACK was significantly convenient when we had to modify our own approximation program (progr1-123). This meant that we did not have to use derivative functions, but instead the difference quotient, which is computed by the routine itself using the subroutine that calculates the value of the above function. To use the lmdif.f routine from MINPACK, you need a few more routines, they can be downloaded together. The minimum value achieved is local. We ran the approximation program (progr1-123) under Windows 7. Clarity was an important aspect when the program was developed, as it had to be modified frequently due to its experimental nature. For this reason, and since the subroutines of the MINPACK package are written in Fortran, we also used Fortran. Within this, we chose Gfortran (in MinGW environment) [10]. Gfortran was developed by the GNU Fortran project. It is a “free” Fortran compiler, part of the GNU Compiler Collection. 4.5 Data Our ECG data comes from the PhysioNet database [7]. From this database, 549 anonymised ECG data of 290 individuals can be accessed by selecting PTB [11]. In addition to the signals, the “PTB Diagnostic ECG Database” contains other data, as well (such as: age and diagnosis of the individuals). Signals are sampled at 1 kHz (i.e. 1 sample per millisecond), and a 1mV signal corresponds to a quantisation level of 2000. Although our method is independent of the lead system, we have mainly investigated 3 leads of the Frank system (vx, vy and vz; sometimes only x, y and z). Using Dower or inverse-Dower matrix transformations, the data of the conventional 12-lead system can be calculated from the Frank lead system data, and vice versa [13, 14]. 4.6. The coordinate system used The x-axis (t-axis) of a period of a lead was determined with a method usually used in cardiology. That is, in the signal-free part before the P wave of the period, we identify a location where the noise is limited, or filter out the noise by “looking”, and we mark the starting point of the baseline. The other point of the baseline is similarly determined at the next P wave. The line passing through these two points is called the baseline. The time value of the maximum point of the signal energy (proportional to the square of the voltage) was chosen as the origin. This point is always within the QRS-complex. In more detail: In the case of a Frank lead system, since it is orthogonal in space, we used the Pythagorean Theorem to determine the curve of the voltage vector length from the vx vy vz leads. Its maximum indicates the maximum activity of the electrical signal of the heart. Because of the noise on the leads, we instead cut the curve at 95% of the maximum voltage vector and choose the middle point between the two intersections as the time value of the origin. Since this does not usually coincide with the location of the sampling point, we round to the nearest location. If we do not use a Frank lead system, but a 12-lead system, then the location of the origin can be determined in the same way using the (nearly perpendicular) V6, II and -0.5×V2 leads [6]. 4.7. Method of approximations The program (progr1-123) that performs the approximation, using the above-mentioned lmdif.f, in a single step (one run) of approximating 1 wave of 1 period of 1 lead, gradually modifies the initial parameters of the function to minimise the deviation until the stopping criteria are met. In this program (progr1-123), the number of parameters does not change [FEX3-ECG/Charts02: Charts02.zip\s0021_p005-vy\]. The most precisely known parameters are the real zeros. The least precisely known parameter is the leading coefficient. (We will return to complex conjugate poles and complex conjugate zeros later in the description.) The above parameters will define the 3 sub-steps of the approximation: 1k. At first, only the leading coefficient d will change. At this point, the nature of the approximation curve (i.e. its poles and zeros) will not change, but the deviation can be substantially reduced. 2k. Then the denominator parameters (h and b), and the leading coefficient d will change. 3k. Finally, all parameters will change. 4.8. Individual waves Ta wave: The segment between the end of the P wave and the beginning of the QRS complex is isoelectric (here: no signal, 0) or nearly isoelectric. Even if it is the latter, the signal is usually so small that it cannot be detected on a standard ECG recording because it is significantly smaller than a small cube of 1 mm (with a height of 0.1mV), i.e. the difference is comparable to the thickness of a hair. This short segment is part of the Ta wave (i.e. atrial repolarisation). If the Ta wave is seen in this lead, it starts slightly after the P wave (the beginning of the depolarisation) and usually ends after the QRS wave. The end of a bigger Ta wave may also slightly affect the ST segment [9]. Although Ta is probably not of significant diagnostic value in general, it reduces the accuracy of the approximation if it is not taken into account. To approximate the Ta wave, we use only 3 parameters: the leading coefficient d and a single factor in the denominator (i.e., an h parameter and a b parameter). P wave: The accuracy of the approximation can be significantly affected by the signal-to-noise ratio. In the case of small P waves and higher noise levels, it is difficult to distinguish accurately between signal and noise. T wave: The next step in our processing is the T wave. According to signal theory, a signal is generated (when it leaves the baseline), followed by the signal phase, which finally disappears (when the signal returns back to the baseline). It is quite common when the T is not zero at the junction of the T wave and the QRS complex, i.e. the T is generated below the QRS complex (similarly to Ta and P). In this case, the wave to be approximated is missing on this segment. However, we have two pieces of information regarding this segment of the T wave: - the ventricular repolarisation cannot start before the beginning of the ventricular depolarisation, and - what is its shape after the QRS complex ends. During the QRS complex, only the sum of the two signals is known. This segment is short and the T wave is usually already small here, so in general we can estimate the shape of this segment of the T wave well, based on the above two pieces of information (see section 4.11). We checked this with T waves that we were completely familiar with. As a test, we only approximated a longer segment of the T wave and looked at how the approximation behaves on a segment unknown to the program. Even on this segment, the deviation was relatively small. This also depended on the noise of the signal, i.e. this deviation was larger in case of a noisier signal. In the following section, we will therefore slightly depart from the naming system used by cardiologists, because we will collectively refer to the entire signal according to the signal theory as the T wave, that is, together: the part within the possible QRS; the S-T segment; according to the traditional notation, T; and the possible U wave. Although - regardless of the name - the point is: in the end, the calculated full approximation curve should approximate the entire period well. The QRS complex: Lastly, we approximate the QRS complex and this usually requires a relatively large number of parameters. 4.9. Tools for approximating a wave In general, approximations require an initial set of parameters, which will be corrected in the “single step”, we described in the above 4.7 section. In the following sections, multiplying the numerator or denominator of an existing approximate function, or both, by new factor(s) is called expansion. These expansions are not done by the program that performs the approximation (progr1-123). The approximating program (progr1-123) will change all old and new parameters after an expansion, when approximating with the new initial parameter set. The accuracy of the values in the initial parameter set is therefore not very important. 1e. Real zeros: The case of real zeros is the simplest. If there are an odd number of zeros, then linear expansion will also be a factor. From an even number of real zeros, we combine each pair into a single quadratic expansion factor. Let the two real roots be tt1 and tt2, in that order. Then, in the expansion factor in form of (t-g)2-(+a2), where g = (tt2 + tt1)/2 and a = (tt2 - tt1)/2. 2e. The signal intersects the baseline at two nearby points, or the signal almost reaches the baseline: In the case where the noise makes it unclear whether the signal intersect the baseline at two nearby points, or will only almost reach it, then either case can be chosen for the new pair of zeros. Because they can be automatically transformed into each other (two real zeros <==> complex conjugate zero pair) by the program that performs the approximation (progr1-123). If we choose the “almost reach” case, we have to find the timepoint g when the difference between the signal and the baseline is the minimum, the value of this difference is denoted by pp. Then we have to find the time when this distance doubles, i.e. it will be 2·pp. The difference between these two times is denoted by ttt. Thus, in the expansion factor (t-g)2-(-a2), where a2 = ttt2. If one chooses the case of two real roots, see point 1e. 3e. Poles: A general quadratic expansion factor is used as the new factor of the denominator. In this case, we take advantage of the fact that, looking at the ECG signal waves, it can be determined that they start from zero and eventually arrive back there. In practice, the following expansion factor with the form (t-h)2+b2 was appropriate: location h is the middle of the wave to be approximated, while b is 1.25 times the width of the wave to be approximated. At the same time, the leading coefficient d should be multiplied by b2. Thus, in the middle of the wave, i.e. at location h, the value of this expansion factor will be 1, and at the edges of the wave, will be 0.86. Therefore, the expansion does not significantly distort the shape of the previous approximation even at the start of the approximation step, i.e. the deviation only increases slightly. Running the program that performs the approximation (progr1-123) generally improves the approximation compared to the previous one. If this multiplier of 1.25, chosen on the basis of experience, would be increased, the initial bias would be smaller, but the approximation would converge more slowly (in several internal steps). 4e. Complex conjugate zeros: The expansion of complex conjugate zeros is done together with the expansion of complex conjugate poles. This is usually only necessary for short signal segments, often only at the end of wave approximation for minor corrections. The following section describes two types of cases. One is the case where there is a unidirectional difference between the signal and the approximation, and the other is the case where there is a bidirectional difference (i.e. a valley and a hill follow each other). The easiest way to show these extensions is through examples. In both cases, the existing parameters change only slightly, as the expansion factor approaches 1 when moving away from the position of the pole-zero pair [FEX3-ECG/Charts02: Charts02.zip\Unid-Alte\]. Unidirectional differences [FEX3-ECG/Charts02: Charts02.zip\Unid-Alte\unidir_rajz.gif]: For example, let's assume that with the existing approximation, the signal is larger than the approximation curve throughout a short segment. At the maximum of the deviation, the signal is 40% greater than the previous approximation; so at this point, the previous approximation should be multiplied by a multiplication factor of 1.4 (denoted by pppp). Find the point in time where the signal is only half pppp (20%) larger than the approximation, so here the multiplier should be 1.2. We denote the time difference between this latter location (20%) and the location of the maximum deviation (40%) by tttt. Using this data, a pretty good expansion factor can be created for the function so far. In this case, the poles and zeros are at a timepoint, one above the other on the complex number plane. The expansion factor of the numerator, which is (t-g)2 - (-a2) where g is the location of the maximum deviation and a2 is equal to tttt2 · pppp, (i.e. a = |tttt|·√¯pppp). The expansion factor of the denominator, which is (t-h)2 + b2 where h is also the location of the maximum deviation and b2 is equal to tttt2, (i.e. b = |tttt|). Further, away from the location of the maximum, the expansion factor approaches 1 (~1/t2). Of course, this is a general relation, so it applies even if it is about a maximum location, but a minimum location. It is also independent of whether the signal and the approximation are either both positive or both negative. During the approximation, the initial locations (g and h) of both the numerator and the denominator, which are assumed to be identical, do not usually remain identical. That is, this expansion requires 4 new parameters. Bidirectional differences [FEX3-ECG/Charts02: Charts02.zip\Unid-Alte\altern_rajz.gif]: For example, suppose that for the existing approximation, the signal is smaller than the approximation curve throughout a short segment and then larger after the intersection (alternating). So, in the first segment, the approximation obtained up to that point should be multiplied by numbers less than 1. The minimum of this multiplication factor should be, for example, 0.7, and this is denoted by u (u<1). The distance between the timepoint of this minimum location and the timepoint of the intersection should be, for example, 5 ms, denoted by tttt (tttt>0). Finally, denote the timepoint of the intersection by q. In this case, the zero and pole will have the same shape parameter (the imaginary part of the roots), a = b, that is, they will be located next to each other on the complex number plane, symmetrically on the vertical line that can be drawn through the q-point. After point q, the signal is larger, so the approximation must be increased, staying with the example, at the maximum of the deviation here, it will be multiplied by a factor of 1/0.7 = ~1.42 (1/u). Two more calculations are required to determine the required parameters. The first is to calculate an auxiliary variable v = tttt · (1-u)/(1+u). With the data of this example: v = 5 · (10.7)/(1+0.7) = 0.88. The second calculation, the calculation of the a (imaginary part): a = √¯(tttt2 - v2). With the data of this example: a = √¯(52 - 0,882)=4.9. Using this data, a pretty good expansion factor can be created for the function so far. The expansion factor of the numerator is (t-g)2-(-a2), where g = q - v and a = √¯(tttt2 - v2). With the data of this example: (t-q + 0.88)2-(-4.92). The expansion factor of the denominator is (t-h)2 + b2, where h = q + v and b = √¯(tttt2 - v2). With the data of this example: (t-q - 0.88)2+ (4.92). Further, away from the location of the intersection, the expansion factor approaches 1 (~1/t). In our example, the zero is first in time, followed by point q, and finally the pole. If the situation is reversed (i.e. if “the signal greater for a short segment than the approximation curve”), then the pole is first, followed by point q, and finally the zero; in this case, the values of g and h would be swapped. (The expansion factor will be the reciprocal of the former one.) During the approximation, the values of both the numerator and the denominator (a and b), which are assumed to be identical, do not usually remain identical. So this expansion also requires 4 new parameters. 4.10. Using these tools Unfortunately, we have not found an exact, programmable method for when and which expansion device to use. After each run of the approximation program (progr1-123), we plot the signal to be approximated and the approximate signal, then look at these and select the next tool 1e - 4e based on the deviations, and finally we stop the program. Of course, after any step, it is possible to backtrack. • To start with, the P, QRS and T waves are approximated using 2, 3 and 2 pairs of poles, respectively (i.e. the denominator is of 4, 6 and 4 degree, and in the numerator only the leading coefficient d will change). • This is usually followed by the entry of zeros 1e, 2e. This is also possible later. • Then we increase the number of poles in a cycle up to a given value 3e, after which we look at the completed drawings in order and select the one with a fairly good approximation, but the number of parameters is not yet too large. If there is no such, we have to find the reason by looking at the drawings. The section below describes in detail the possible causes of the problems and some methods that have been developed in practice to eliminate these causes. 4.11. Problems and their practical solutions - If the approximation at the two edges of the wave (at the baseline) is not good enough, the number of poles should be increased 3e. - If the approximate curve between two peaks is farther from the baseline than the original signal, then complex zero is required 4e. Before expansion, in this case it is worth performing a couple of steps backtrack with the number of poles increased in the cycle, so that there are no more poles than necessary. - If the deviation is a narrow “bulge” or “indentation”, or if it is bidirectional (i.e. a valley and a hill follow each other in succession), then the same applies 4e. In such cases, it is also recommended to return a few steps before expansion. - If the approximation of a wave is only slightly better than the previous one, and that step was a pole expansion 3e, then it may be that the pole moved far away from the wave during the approximation. In this case, newer pole expansion 3e usually helps. The reason is usually that the two parameters of the pole are not enough to obtain a better approximation, but a second expansion can lead to a significant reduction of the four parameters. - If the start of the T wave falls below the QRS, do not choose an approximation of T where one of the roots falls within this common segment. Because here we only know the sum of T and QRS. In this case, we apply the “simplest is the most probable” rule (~Occam’s razor). - If we do not find an approximation corresponding to the above rule for a “dome-like” T (in the case of a Frank lead, this can also be negative), we classify it in the “needs to be seen by a cardiologist” category, because the "dom-like" T belongs there from the start. If the imaginary part of a root (conjugate complex pole or zero) is much larger than the others, then the factor containing the root can probably be omitted; of course, this must be checked. - If we want to improve the approximation on a signal segment (e.g. 4e), but the program that performs the approximation (progr1-123) reduces the deviation elsewhere, although the former would be a more important location. For example, if we want the program to make a “nicer” approximation on the ST segment than perhaps on the U wave. In this case, it may be useful to increase the weighting of the deviations in this segment (the default value is 1 everywhere). In practice, after one approximation step (one run), the increased weighting can usually be reset to 1. We already use the approximation tools 1e-4e through a framework program (ppp.m) written in the GNU Octave language. (GNU Octave: "The Octave syntax is largely compatible with Matlab".) This framework, which runs in a cycle, sets the starting parameters of the approximation program (progr1-123) based on answer choices and selections with the mouse on the approximation drawings. It then calls the approximation program (progr1-123). Exit from the cycle is not triggered by the reduction of the numerical error of the approximation to a suitable value, but rather by looking at the segments that are important from a diagnostic point of view, the approximation is correct [FEX3-ECG/Charts01]. 4.12. Preparation We use a preparatory program (prep) to cut out the desired period of the signal to be approximated from the raw ECG signals. First, we - temporarily - remove baseline fluctuations and higher frequency noise with frequency filters. Then, similarly to a method described above, we find the locations of the QRS (the time values of the maximum activity point of the ECG signal). Then, by marking the beginnings of the P waves, we get the initial baseline segments of each period. Finally, after omitting noise filtering - we plot the periods of the signal and their initial baseline segments with MS Excel. Now, the entire baseline can be moved by grabbing a point on the baseline segment using the mouse. It is advisable to first choose the captured point close to the beginning of the baseline segment, then - in response to an Excel question - the beginning of the line will move and the end will remain in place. Then the same will happen at a point close to the end. This way we can accurately set the standard final baseline used in cardiology. In what follows, we use the original signal without the temporary filters. 5. Results The signals tested are denoted as follows: s.... = serial number, p... = patient number. For example "s0025_p005". If we want to be more precise about the location within the record, we also indicate the lead and the location of the QRS. For example “s0025_p005, V3, 7009”. In the section below, the two numbers after the wave letter are related to the number of approximation parameters. For example: P35 stands for wave P, 3 is the number of parameters of the numerator (including the leading coefficient d), while 5 is the number of pole pairs (factors) of the denominator. Thus, the number of parameters of the approximation is 3 + 2×5=13. Ta means: there is wave Ta. The 2×6 digit number (for example in the filename: yymmdd hhmmss) means “year month day hour minute second” (time stamp). After our initial trials, we first approximated all 125 periods of the s0177_p050 signal vx vy vz (Frank lead) (location of the first QRS: 1627 ms). The goal was to test the stability of the parameters. The results of the approximations show that the stability of the parameters is adequate. An example of this is the histogram of one of the location parameters (h) for the denominator of the T wave on the vz lead [FEX3-ECG/Charts02: Charts02.zip\Histogram\]. This is the location of a pole near the peak of the T wave. To do this, after omitting two outliers (in QRS Periods 47 and 56), the histogram of the remaining 123 values was plotted, which was similar to a bell curve. The mean was 257 (with all the values between 251 and 263), or 257±6 ms. For a conventional recording paper speed, this is equivalent to ±0.15 mm. The accuracy of the other parameters was similar to this one. Then we looked at approximations of some of the more important shape types (not necessarily just with Frank lead)[FEX3-ECG/Charts02: Charts02.zip\Shapes\]: s0025_p005, V3, 7009 Under several names: dómszerű T, dome-like T, T-en-dôme, ST en dôme, Coved ST segment elevation, domed shape, pierre tombale (fr), tombstone (en), scaphoid Ta P32 T34 QRS34 [FEX3-ECG/Charts02: Charts02.zip\Shapes\s0025_p005_V3\] s0047_p015, II, 2758 Under several names: sajkaszerű, spoon-shaped, boat-like, navicular, digitalis effect, digoxin effect, reverse tick, shape of Dali’s moustache P22 T33 QRS34 [FEX3-ECG/Charts02: Charts02.zip\Shapes\s0047_p015_II\] s0146_p044, V4, 3725 Under several names: koronária T, coronary T, Coronaria T Ta P22 T22 QRS23 [FEX3-ECG/Charts02: Charts02.zip\Shapes\s0146_p044_V4\] s0508_p269, aVR, 5019 Under several names: Blokk, Block, Bundle branch block Ta P12 T12 QRS24 [FEX3-ECG/Charts02: Charts02.zip\Shapes\s0508_p269_aVR\] s0542_p283, vz, 2581 Under several names: QRS W alakú, QRS W shape (atrial fibrillation, no P) P-- T22 QRS34 [FEX3-ECG/Charts02: Charts02.zip\Shapes\s0542_p283_vz\] Next, we approximated all ECG signals (except for 6) in sequence from s0001 to s0035, all successfully. In detail, complete with patient numbers: s0001_p119\ s0002_p196\ s0003_p110\ s0004_p152\ s0005_p138\ s0006_p125\ s0008_p193\ s0009_p175\ s0010_p001\ s0011_p178\ s0012_p114\ s0013_p108\ s0014_p001\ s0015_p002\ s0016_p001\ s0017_p003\ s0019_p140\ s0020_p004\ s0021_p005\ s0022_p006\ s0025_p005\ s0026_p007\ s0027_p006\ s0028_p008\ s0029_p007\ s0030_p106\ s0031_p005\ s0034_p163\ s0035_p009\ Five example drawings [FEX3-ECG/Charts02: Charts02.zip\From_series\]. Except for the following 6, because it was immediately obvious (without any examination) that these signals fall into the “needs to be seen by a cardiologist” category: s0007_p146------- arithmia s0018_p113------- atrial fibrillation, no P (in either lead) s0023_p115------- arithmia s0024_p164------- arithmia s0032_p168------- arithmia s0033_p168------- arithmia Since there was no healthy patient among the first 35 signals, we also approximated the ECG signal of a healthy patient: s0306_p104 Summarising the above, we have approximated 95 {5×1 + (35-6+1)×3} ECG curves so far using the tools described above 1e-4e, in our opinion all of them of appropriate quality. 6. Conclusions The process of approximating a wave (P, QRS, or T) usually consists of applying the above tools 1e-4e in the sequence of our choice. It is relatively rarely necessary to revert to a previous approximation, and so far no approximation has ever required returning twice. It is often difficult to decide what level of accuracy is needed. What part of the signal from the database is noise and what part is the signal generated by the electrical activity of the heart. The number of approximation parameters also depends on this. The biggest problem at the moment is processing time. This is of course related to the desired accuracy of the approximation and the number of parameters. When running the approximation program itself (progr1-123),