Based on my limited knowledge, it is my understanding that square waves can be mathematically broken down into an infinite sum of sinusoidal waves (of different amplitudes, frequency, etc) . This is very interesting, and mathematically it makes sense, however, this concept starts breaking down for me when I start hearing about how all square waves (no matter how they are generated) abide by that rule.

For example, sometimes, I stumble upon articles about electronics where the author mentions how a square voltage wave being impressed into a circuit will be felt by the circuit as a bunch of sinusoidal waves of multiple amplitudes, frequencies, etc. Really? How can this be? I understand that if a square wave is built using sinusoidal waves then it makes sense that the circuit will feel all the sinusoidal waves that the square wave is made of, however, some square waves are made from just “on” / “off” transitions (nowhere do we inject sinusoidal waves to that square wave) so I don’t see how those particular square waves can be felt by the circuit as any type of sinusoidal waves.

So what is going on here? Could someone please help me understand this a little better?


3 Answers 3


The general principle here is that when your systems are linear, as in often the case in electronics, you can decompose your signal any way you want. Specifically, if $f(t) = g(t) + h(t)$, then the response of your system to $f(t)$ is equal to the sum of the responses to $g(t)$ and $h(t)$.

For example, if you put in a voltage signal $f(t)$, then we can always write $$f(t) = g(t) + \left( f(t) - g(t) \right)$$ where $g(t)$ is a function that looks like the outline of an elephant, and compute the response of the signal from its response to $g$ and $f-g$. This is valid even though you might have never meant to put in an elephant, and it's even useful, if you happen to have a circuit element that tries to detect elephants in the waveform. The question of whether $f(t)$ "really" contains an elephant just doesn't make sense.

The same is true for the Fourier analysis of a square wave. When we decompose a signal into a sum of sinusoids, it doesn't matter how the signal was made. The decomposition is useful either way, especially if you have circuit components that only "listen" to one frequency.


You can decompose a square (or any-other-shape) wave into components of any complete set of functions. When that set's sines and cosines the decomposition's called a Fourier transform, and there are other kinds of transforms (e.g., Laplace) based on other complete sets of functions as well.

So you can more-or-less mentally picture your square wave almost any way you like. But what does the wave really look like? That is, consider a plucked string rather than a voltage. If you deform it into a square wave shape and then let it go, what happens to that initial shape as a function of time? Answer: it stays square...

Here's an illustration. Sorry you have to click a url, but that imgur stuff doesn't seem to like animated gifs. Here's an img link, followed by an explanation...


You're initial conditions consist of a tensioned string with both endpoints fixed, plucked with two square waves. They travel along the string and just reflect at both ends, retaining their square-wave shape forever. And I used two so you can see what happens when they intersect, which is that they simply become one larger-amplitude square wave.

Likewise, here's a single triangular waveform extending across the entire string, fixed-endpoint to other fixed-endpoint, retaining its shape as the string vibrates...


In both cases, you can clearly see the shape's the shape, period. Our decomposition into sines and cosines is very, very convenient for mathematical purposes. And the re-composition of those sines and cosines perfectly accurately re-produces that original shape. So no harm, no foul. And the first sentence of your question, "...mathematically broken down..." is exactly what's going on in our heads. But it's arguably not what's happening in the real world. You can argue about that either way you like.


I don’t see how those particular square waves can be felt by the circuit as any type of sinusoidal waves.

I don't know if you'll find this illuminating or not but I did find it so when I was asking more or less the same question to myself when I was an undergraduate electrical engineering student.

Consider the all-pass filter, an electronic circuit that passes all frequencies with equal amplitude but unequal phase. If a square wave (approximation), whether produced by a switch or not, is the input to an all-pass filter, the individual frequency components at the output have the same magnitude as at the input but have a different phase relationship.

Remarkably, this produces an astonishingly different output waveform.

enter image description here

Google books credit

The output waveform certainly doesn't look like a square wave but it has the same frequency components in the same proportion (just different phase relationships) as a square wave. Indeed, this output waveform could be the input to another all-pass filter that is the inverse of the first and its output would be (ideally) the original square wave input to the first filter.

Take some time to think about the implications of this.

Below is a comment I posted earlier and then realized it should be at least part of an answer:

Square waves are just mathematical abstractions, e.g., there is no voltage (current, pressure etc.) waveform that is a square wave.

For that matter, nor is there a voltage (current, pressure, etc.) waveform that is a sine wave.

For that matter, nor is there a voltage (current, pressure, etc.) that is 'DC', i.e, constant over all time.

These are all mathematical abstractions that turn out to be very convenient for, e.g., linear systems.

However, there are no genuinely linear systems but linear systems turn out to be very convenient since many physical systems are approximately linear.

The point of that somewhat rambling comment is to drive home the fact that one must be aware of and keep in mind, at some level, the difference between the ideal and the physical.


Your Answer

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

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