1. Separate the graphics into distinct line segments. 2. Take from each line segments a few points and do a (cubic) interpolation of the line segment. 3. Cut the line segment into two half, and redo 2. if you are not satisfied by the lines.
If you look at the formula, then you will see that something quite similar happens. The formula is always a sum of several sines, times two Heavyside step functions. [2] The trick here is, that the product of two Heavyside functions will give you a function that is one for some interval and zero otherwise. Effectively switching off the part of the sum outside of the interval. And the sum of sines is essentially a Fourier transform of the line drawn.
They can be created in Mathematica: http://mathematica.stackexchange.com/questions/17704/how-to-...
Which may be how they did it.