“Additive Synthesis of a Square Wave,” 2013. I prepared this illustration to accompany Jon Thompson’s Arduino sound synthesis article from MAKE Vol 35. It was published as Figure K. It shows how a more complex waveform (a square wave, in blue) can be synthesized as a sum of sine waves. The black wave is the fundamental, which has the same frequency as the synthesized wave, and the gray-valued waves are the various odd harmonics up to the 15th; lighter-valued waves are more attenuated and contribute less to the synthesized curve.
I used Google Sheets to compute the values of the various sine waves at 1,000 positions along one cycle, multiplied them by their attenuation factors, and added the results together at each point to produce the synthesized wave. Then I plotted the waves, right-clicked on the plot in my browser, and manually copy-pasted the SVG text of the curves from the raw HTML into a text editor. Then I saved the text file with a .SVG extension and imported it into Illustrator to tweak the colors and add the labels. A handy trick if you ever need to generate vector art from plotted data.