This is a 12 lead electeocardiogram of a 26 year old male: enter image description here

This is the graph of function $5sin(7x)sin(.5x)cos(3.25x)$ enter image description here 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?

  • 7
    $\begingroup$ "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 $\endgroup$
    – user24284
    Sep 15, 2017 at 8:42
  • $\begingroup$ The links are broken or I can't open them from my android $\endgroup$ Sep 15, 2017 at 11:42
  • $\begingroup$ 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. $\endgroup$
    – vkehayas
    Sep 15, 2017 at 12:09
  • $\begingroup$ @Mockingbird the links are up. $\endgroup$
    – user24284
    Sep 15, 2017 at 12:34
  • $\begingroup$ 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. $\endgroup$
    – user22020
    Sep 15, 2017 at 12:40

2 Answers 2


Yes a function could be assigned to an ECG diagram. I don't know if that would be helpful in any kind of research. Anyway I believe that from a mathematical point of view that if you manage to include all the equations shown in the picture into a single one you should get what you are looking for.
Decomposition of the ECG signal

I have not made the diagram it was taken from this paper https://www.researchgate.net/publication/286584223_Design_of_a_synthetic_ECG_signal_based_on_the_Fourier_series by Radana Kahankova.

  • $\begingroup$ I was a high school back then when I asked this question. Obviously I had no emphasis on the graphical analysis being useful. haha $\endgroup$ Apr 27 at 14:22

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$

  • 1
    $\begingroup$ Er, how does anyone know whether this is right or not? $\endgroup$
    – David
    Dec 28, 2018 at 15:42
  • 1
    $\begingroup$ Just copy the tex and paste it here: desmos.com/calculator $\endgroup$
    – Amad
    Dec 29, 2018 at 22:12
  • 3
    $\begingroup$ 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. $\endgroup$
    – Bryan Krause
    Jan 23, 2019 at 18:45
  • $\begingroup$ @Amad I see what you did here. You ploted a graph that slightly resenbles an ECG (Only QRST). Appreciate your intend to answer but I am afraid this is not what the author of the question's looking for. $\endgroup$
    – kartlad
    Apr 26 at 20:51
  • $\begingroup$ @BryanKrause Haha I was a teenager back then when I asked this question and had no interest in the biological importance of the graphical analysis $\endgroup$ Apr 27 at 14:29

Not the answer you're looking for? Browse other questions tagged .