A Discrete Fourier Transform converts a finite list of equally spaced samples of a function into the list of coefficients of a finite combination of complex sinusoids, ordered by their frequencies, that has those same sample values. It is usually said that a discrete Fourier tranform converts the sampled function from its original domain to the frequency domain.
This animation helps visualize how a linear combinations of sinusoids can approach any periodic function.
Based d3.js.