# Can a mathematical function be assigned to ECG diagram?

This is a 12 lead electeocardiogram of a 26 year old male: This is the graph of function $5sin(7x)sin(.5x)cos(3.25x)$ This graph look quite similar to the ECG diagram.After sketching this graph, I thought whether ECG diagram could be assigned roughly to a mathematical function.

Question: Has anyone ever tried to even roughly assign the diagram to a mathematical function? Is it even possible?

• "Has anyone ever tried to even roughly assign the diagram to a mathematical function?" Yes, it was done before, using Fourier series (kind of what you have in your graph). The result is far from beautiful, see here: intmath.com/fourier-series/ecg-fourier-quartic-plusT.pdf. And here a detailed explanation: intmath.com/blog/mathematics/math-of-ecgs-fourier-series-4281 – user24284 Sep 15 '17 at 8:42
• The links are broken or I can't open them from my android – Mockingbird Sep 15 '17 at 11:42
• Fourier series was my first guess, too. Is there any particular reason you would like to do that? I'm asking because if fitting is your concern, wavelet decomposition may be easier to work with. By the way, the links work for me. – vkehayas Sep 15 '17 at 12:09
• @Mockingbird the links are up. – user24284 Sep 15 '17 at 12:34
• Yes, this would require Fourier series, in which case you would then desire to establish the number of terms needed to best fit your data, and, at the same time, find the value for each term's coefficient. If you have the raw data, you can upload to it Wolfram alpha and it will generate a function that fits. For example, WA can generate a function for Obama's signature; #26 on the list. – user22020 Sep 15 '17 at 12:40

## 1 Answer

Try this:

$$f(x)=-20(e^{\left(\operatorname{mod}\left(x-10,\ 20\right)-10\right)}*(e^{5\left(\operatorname{mod}\left(x-10,\ 20\right)-10\right)}-57*e^{4\left(\operatorname{mod}\left(x-10,\ 20\right)-10\right)}+302*e^{3\left(\operatorname{mod}\left(x-10,\ 20\right)-10\right)}-302*e^{2\left(\operatorname{mod}\left(x-10,\ 20\right)-10\right)}+57*e^{\left(\operatorname{mod}\left(x-10,\ 20\right)-10\right)}-1))/(e^{\left(\operatorname{mod}\left(x-10,\ 20\right)-10\right)}+1)^7$$

• Er, how does anyone know whether this is right or not? – David Dec 28 '18 at 15:42
• Just copy the tex and paste it here: desmos.com/calculator – Amad Dec 29 '18 at 22:12
• To be clear, there is really no biological reason to do this. ECGs are not collections of these sorts of functions. Fitting something like this is just a curiosity and gives you no understanding that you can't find in the original signal. – Bryan Krause Jan 23 '19 at 18:45