| Electronics > Projects, Designs, and Technical Stuff |
| Square wave harmonic content |
| (1/6) > >> |
| taydin:
Somebody asked me a question about harmanic content of a square wave, and even though I have been dealing with FFT and such for quite some time, I was kinda baffled by it. The question basically is this: For some signal sources, it makes quite sense that there is multiple harmonic content, because that is how the signal is produced. For example, if you pick a guitar string, that string vibrates at multiple sinusoidal frequencies, so it is quite normal that we see that harmonic content when we do an FFT on the sound. But let's say we are switching current through a resistor on and off using a MOSFET. In this case, we obtain a squrewave, but there is nothing that ACTUALLY produces sinewaves. So where does the harmonic content of this squarewave that we see in the FFT come from? |
| taydin:
I thought about this for a while and the only explanation I can come up with is this: In the resistor switching case, the switching speed, or the RISE TIME of the current through the resistor is the important factor here. In order for the circuit to allow that rise time to happen, it needs to be designed such that it can also pass through a sine wave with the same rise time. So, we basically take the FFT to find out what frequency sinewave the circuit has to pass through without attenuating it too much. And this frequency allows us to determine the rise time that the same circuit will allow. So a high rise time requires that the circuit passes a lot of the higher order harmonics of the square wave. So in this case, even though the FFT spectrum tells us that there is the 3rd harmonic, 5th harmonic etc, those are just mathematical representations, just like we use complex numbers to model RLC circuit behavior. The FFT basically looks at the various dV/dt points (or rate of instantaneous change, which is the derivative at that point) in the waveform and tells us what frequency they correspond to. I wanted to have this discussion here to get the opinions of the experts. Tried to do a search, but for some reason, only one page of search result is returned, and I didn't see this discussed in that one page. |
| drussell:
Just like an infinitely fast single pulse, a perfect (theoretical) square wave would have an infinite series of harmonics at every frequency. It is impossible to create a perfect pulse or square wave, though. |
| RoGeorge:
--- Quote from: taydin on September 28, 2019, 01:17:20 pm ---But let's say we are switching current through a resistor on and off using a MOSFET. In this case, we obtain a squrewave, but there is nothing that ACTUALLY produces sinewaves. So where does the harmonic content of this squarewave that we see in the FFT come from? --- End quote --- There is a bidirectional mathematical equivalence between a time domain representation and a spectral representation of the same signal. Search about Fourier for more details. You can either say/think about the square wave is a square wave, or you can say/think as well it's a sum of sinusoidal waves of certain frequencies and amplitudes. It doesn't make any difference at all. The resistor have nothing to do with that, and those harmonics do really exist there, same as 2 apples and 3 apples also exist in a basket with 5 apples. There is nothing virtual there, Fourier it's for real. Many, many moons later (2021 edit): Changed my mind. Now I think those sinusoids are not physically there. |
| drussell:
--- Quote from: RoGeorge on September 28, 2019, 01:28:23 pm ---You can either say/think about the square wave is a square wave, or you can say/think as well it's a sum of sinusoidal waves of certain frequencies and amplitudes. It doesn't make any difference at all. --- End quote --- Well, except that the sum of the sinusoids is only ever a close approximation of the square wave. Perfectly usable for real-world applications, though, of course! |
| Navigation |
| Message Index |
| Next page |