Discrete Fourier transforms - a primer with examples 

This program takes an input file of x- and y-coordinates describing a line drawing (in the style of “join the dots”) and calculates its Fourier components before drawing it out using these. It finishes by removing Fourier components, starting with the smallest amplitude and continuing until there remains only a single circle. 

The criterion for the input figure is that it is composed of a single, closed curve (though it is allowed to cross over itself). A convenient way of generating a data file for such a figure is to use GRABIT (see https://ch.mathworks.com/matlabcentral/fileexchange/7173-grabit). I include a couple of possible files you could use, but it’s more fun if you generate your own! The input data set is first put through an interpolation algorithm (https://ch.mathworks.com/matlabcentral/fileexchange/34874-interparc) in order to distribute the data points evenly along the curve. 

For background mathematical information and to gain a deeper insight, I recommend 




Also check out my own YouTube contribution, especially for you groovy oldsters out there!