Noob here, I read that any signal can be made by putting together sines and cosines, it always shows some kind of basic harmonic wave with constant amplitude such as square wave.

I understand that constant amplitude, constant frequency square and triangle waves can be made from sines, but what about square wave that sweeps its frequency or even suddenly jump to other frequency, what about square that has its amplitude changed?

What about noise, lets say I have 1 minute long 48KHz 16bit PCM signal that is just white noise, that can be reconstructed from bunch of sines too?

And what about transients, either the sudden square wave like ones or the gentle slow fade in type ones. Lets say I have signal that is silence and then square wave slowly and smoothly rises in amplitude, how can sines, which are constant in amplitude ever recreate it?

Basically, my point is these sines are constant in amplitude, frequency, and phase and they run the entire lenght of whatever signal we want to reconstruct, signals can have silence, transients, periods where amplitude and frequency is constant and periods where they change. I dont understand how can bunch of sines that run the entire lenght of complex signal ever reconstruct it. How can 1000 sine waves sum up into perfect silence and then suddenly sum into noisy square wave sweep?

  • 1
    $\begingroup$ Hi: slutsky-yule effect says that you take can noise, perform transformations ( e.g.; calculate moving sums of the noise ) and get cyclic behavior ( sines to some extent ). So, I imagine it's possible to go the other way around also. Check out Yule-Slutsky because it seems that you might find it interesting. $\endgroup$
    – mark leeds
    Nov 13, 2019 at 15:03

2 Answers 2


A sum of sines/cosines (with frequencies that are integer multiples of a fundamental frequency) will always result in a periodic function (that's what Fourier series are about). But you can of course approximate any function with finite support by choosing the length of the function's support as your period (if you don't mind that the approximation will be a periodic continuation of the given function).

Note that the approximation by a Fourier series is a least squares approximation, not a point-wise approximation. So if the desired function has discontinuities there will always remain some error of fixed magnitude, no matter how many sinusoids you use for the approximation. This oscillatory behavior near discontinuities is called Gibbs phenomenon.


Big question. Joseph Fourier proposed this series circa 1807-1822, although there were many earlier predecessor developments. Historically, it took several following decades in the development of mathematical analysis to prove that the Fourier series actually converged. See: https://en.wikipedia.org/wiki/Convergence_of_Fourier_series and https://en.wikipedia.org/wiki/Fourier_series#Convergence

Thus, a complete answer to your question might be several university level textbooks.

For PCM waveforms, the discrete form of Fourier "deconstruction" is a DFT.

Now a DFT is just a (complex arithmetic) square matrix basis transform. Turns out all the sines and cosines (or the equivalent complex exponentials) make up a full orthogonal basis set for the matrix transform. Thus, any data vector (valid quantities, no NaNs) can be multiplied by this type of square transform matrix, and result in another vector, representing sines and cosines (or complex exponentials). That's just a property of square matrix multiplication (given that basis set).

This square matrix transform has a proper inverse. Use the inverse transform, and you get your original arbitrary waveform (noise, impulses, steps, etc.) right back (minus numerical noise) from the sines and cosines representation. What else would an inverse matrix transform do?

Thus, for PCM data, it's just a matter of understanding linear algebra (with perhaps a bit of trig and complex number stuff mixed in).

  • $\begingroup$ What does convergence in terms of DFT mean? $\endgroup$
    – Sweeper
    Nov 14, 2019 at 1:52
  • $\begingroup$ The sines and cosines as components of the basis vectors produce a non-degenerate square matrix. A degenerate DXT matrix would not have a proper inverse, and thus a IDXT(DXT()) would not be able to recreate (converge on) the original input, as does a IDFT(DFT()) $\endgroup$
    – hotpaw2
    Nov 14, 2019 at 4:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.