#59: Basics of a Square Wave signal's harmonic content
Вставка
- Опубліковано 19 сер 2024
- This video (by request) explains the harmonic content of a squarewave signal. It shows that a square wave is composed of a sinewave at the fundamental frequency of the square wave, plus additional sinewaves at the odd harmonic frequencies. The magnitude of the harmonic components is inversely proportional to the harmonic order. The more odd harmonics added, the faster the rising/falling edges are. These concepts are shown graphically as well as practically on an oscilloscope and spectrum analyzer.
Brilliant depiction. Graphics and presentation greatly assist to render a non intuitive concept easy to understand. I have never come across anything so clearly depicted on the subject on the web. Full thumbs up.
This is the crazies shit I watched in all my life. Your grasping and exposition are pure talent
Thanks. I sort of knew this but that was an excellent refresher, I needed that. Thanks
An excellent explanation. I knew that a square wave was a summation of multiple sine waves, but your presentation shows how that comes to be. Fantastic!
Great video, man!! Explained in an easy-to-understand manner, even for laymen, and your comments are helpful too. Keep up the great work :)
Very clear your explanation. Never ever imagined about the content of Square Waveform.
A lesson about the Square Wave! Very Interesting and Very Informative, as all your videos are! Thank You!
THANK YOU!!! Nice explanation. I happened across this concept in an attempt to understand how square-wave based neurostimulation devices actually contain a multitude of frequencies.
Presented in a clear and practical way. I now understand this phenomenon. Thank you very much for the video!
Thanks, and by the way I enjoy your videos. I'm a repair tech for 30+ years, and was still fuzzy on scope triggering; just would fiddle with the controls until I got what I wanted. Your vid on 'scope triggering was very helpful.
Thanks for explaining complex topics in ways that make them easy to understand. Great, informative video.
Ah yes, that was helphul. :)
I now "get" the stuff they taught me at school about square wave harmonics, rather then just remembering and repeating it. Thank you!
Great video.
I hope you keep this up, Ive watched a few of your videos now and they have all been excellent.
You dont only know your stuff, you prepare well beforehand and produce quality teaching vids.
Thanks, being able to see it in this format finely got it across to me. A good lesson. Dave.
Another well illustrated and thought out video, w2aew - well done!
Thanks fo sharing. In depth , clear syntethic class. Congratulations...
So useful, thanks for the explanation. Very, very clear.
Very well done! Made tons of sense!
Thank you! excelent explanation!
That was a very good video on harmonics! Thanks!
This was very helpful, thank you kindly for making this video.
Thank you so much. Excellent video!
Thank you as always great video!!!
A pure square wave is clean with no harmonics.
Harmonics occur when there is extra noise or some type of sound added to the square wave.
NOT true. A pure square wave consists of the fundamental and it's odd harmonics. The number of harmonics present is determined by the rise/fall time of the square wave. The faster the edges, the more (higher frequency) harmonics are present.
A pure SINE wave is clean, with no harmonics...
@ *w2aew*
That happens with digital sources where the square wave is broken up in samples as the “sample rate” is determined.
A pure Square wave is as clean as a sine wave can be but even sine waves are “dirty” in the digital domain.
@@Bassotronics I disagree regarding the squarewave - and so does the math and the Fourier theory - a pure squarewave, even one generated as a clean analog waveform, DOES have spectral content that is composed of the fundamental and decreasing levels of odd harmonics. If you eliminate the harmonics, you are left with a sine wave. en.wikipedia.org/wiki/Square_wave#Fourier_analysis
Thank you, dear man.
Very nice demo. Thank you
Helpful explanation - thank you!
Excellent job!! Thank You very much!
Very illustrative and explanatory video!..I had one question-How does the frequency content change with changes in duty cycle of the square wave and why?
Really nicely done, thanks!
Great job! I'm an electronic engineer and I enjoy a lot your videos! :) Just a question. If the square wave is 1MHz, why the FFT markers are showing the harmonics at 2MHz/4MHz/[...] instead of 3MHz/5MHz/[...]? Is it a settings issue of the scope? Thank you!
Because the markers are set to 'delta' mode rather than absolute value. So, it's showing the offset from the fundamental. I did this to show the relative magnitude of the odd harmonics.
Had the same query as Bernat. Was really confused after seeing the 2, 4 and 6MHz.
That's a good video.
But why do we not consider the even harmonics... i read somewhere a logical explanation for that. Although neither can i recall it nor find the right data online now. Could you please answer this.
Thanks.
I believe the issue with using even harmonics here is that the square pulses are, in essence, symmetrically created. The second harmonic's sinewave would be lopsided within the square pulse. Your question does make me wonder whether we would use the even harmonics to create an asymmetric singal - like a triangle or a ramp.
I've been spending effort at suppressing harmonics. I'm glad I haven't attempted to round out a square wave signal 😊
👍Thank you sir.
Sorry for the dumb question but is this explanation important for HOW we create square waves FROM sine waves? I thought always thought square waves were typically generated simply by switching DC on and off at the desired rate (frequency) and at a duty cycle of 50% for a true square wave. Please explain what I'm missing and again, sorry for not understanding.
cheers buddy, great description!
Thank you so much for this Video.
Thank you for this demonstration! Here you have presented what happens with the 1MHz square wave. Can you make another video where you have a 100KHz square wave with the 10% duty cycle. That way, 1MHz@50% square wave will be exactly the same as the 100KHz@10%. I am curious about what the spectrum analyzer will detect, and why. Thank you!
I wonder if you could show the basics of actually making one of those fancy sine waves, i've heard it can be done with the kind of parallel LC circuit you were explaining in your previous videos which were also very great but I'd have no clue on how to understand how a circuit would make a wave rather than filter it. Great videos again!
very nice
Great demonstration. I can follow the process in this direction and it makes perfect sense.
What I still don't quite get is the reverse process: if I have a light that flashes every second as a square wave pattern, in what sense is it also flashing 3 times a second? Is there a physical manifestation of the 3 flashes per second? How is it picked up by a bandpass filter that's looking for frequencies of 3 Hz?
The key to remember is that these are the sinusoidal components that are adding up in a coherent fashion. The higher order harmonics are lower in amplitude, and the coherent addition of them is what turns the signal into a square wave. If you had a narrow bandpass filter at 3Hz or 5Hz, you would see blips of energy in these bin during the switching edges.
If you had started with 100 Hz rather than 1MHz, we could have heard what happens to the fundamental as harmonics are added.
Thanks.
outstanding video...thx
Great video by the way, just subscribed.
Oh wow, so even if a 'true' square wave with perfectly flat edges and right angles was analysed, it could still be broken down into sine waves? Fascinating.
Mind blown!! thankyou :)
What are the peaks between the harmonics? Are they "real" or a result of the FFT???
Peaks? This grass on the bottom is just noise. Everything around us generate noise. Cosmic rays, radars, radios, wi-fi and stupidly huge amount of other stuff constantly generates it continuously, but it is a lot weaker and we actually consider only strong ones :) FFT is also non-ideal because of hardware limitation etc. and take part in this noise.
This makes sense, but why aren't square waves produced by simply switching a voltage between different levels? For example have a MOSFET switch it's output between 0 and 1 volt, so that the signal would be 1V-0V-1V-0V etc.
Thank you
Does adding a dead band between the positive and negative square wave pulses , result in lesser harmonics? There is something called a "modified sine wave" inverter,which seems to do that,and it is claimed to have lesser harmonics than an ordinary square wave inverter.
By inverter,I meant power inverters for AC outtages.
Thanks for your hi quality content and presentation !
It changes the amplitude distribution of the harmonics - some will go down, but there will still be harmonic energy present.
thank you so much!
Brilliant!
How about harmonics of true sine wave? I know that sine is sine but there are harmonics in sine wave signal too. Is it simply distortion? Maybe thats deflections in transmission line? I have true sine wave generator and there is a few harmonics in spectrum too. When I study this topic on university first time I was so excited. Absolutely any shape is made from bunch of sine waves!
A true or pure sinewave has no harmonics - just the fundamental. Any harmonic content would be considered harmonic distortion. If the harmonic components are -30dBc or lower, then the time-domain waveform will visually look perfect. If you look at the specs of your "true sine wave generator", it will have specs for harmonic distortion or SFDR (spur free dynamic range). Nothing is perfect...
Very cool!
You are so clear :o)
I am assuming that when adding the 3rd, 5th etc harmonics on the computer you did so at the levels specified at the beginning of the video, so as to make a little more "perfect" square?
At timeline 7:49, shouldn't the 3rd odd harmonic of the 1 Mhz fundamental frequency be 3 Mhz instead of the 2 Mhz shown on the spectrum analyzer?
The marker is showing the delta from the reference marker, not the absolute frequency.
Software package name ??
thanks
EDIT
got the name: ArbExpress, it is Tek waveform gen. related
I just wanted to play around with the concept that you were illustrating
thanks
Alan, thanks so much for all the great videos. I think I've watched all of them multiple times and learned a lot. I do have question. What could cause a scope to display distorted square waves, yet perfectly display sine waves? The vertical trace is fine but the horizontal is severely scooped on a known good signal. Looks like really bad probe compensation.Thanks
You mentioned one possibility - improper probe compensation. Another common problem is signal reflections from improperly terminated coaxial transmission lines. A third common problem (when using a probe) is excessive ground lead length leading to ringing/distortion.
@@w2aew Well, I'm using a good quality coax with a 50 ohm terminator and the waveform is good on my other scopes. I was inspired by your 5 transistor curve tracer video to use this old Hitachi scope for that. I was wondering if the problem could be in the vertical amp. Can't find a schematic. Thanks, KJ7CZH.
@@xyloeye It could be that the front end of that scope needs to be calibrated. See my video on analog scope calibration, it shows an example of the compensation adjustments for the front end.
@@w2aew OK, thanks. I'll give that a try.
Really great one! BTW, what's that signal software?
I have a cheap USB scope and a cheap sig gen. Square waves look fine until I start getting above 200kHz. Above that (like up to 1MHz), the square wave no longer looks so square. The rising edge begins looking like a shark fin. Any thoughts would help me! Thanks!
This is most certainly due to bandwidth limitations of either the scope or the signal generator - or both. Limited bandwidth slows the edges. It is likely that the rising/falling edges have the same "shape" as the shark fin when operating at lower frequencies, but since the width/duration of the pulses are so much longer, the effect isn't noticeable.
Are all square waves made from sine waves ? If you just turned on/off the DC power supply would you not get a square wave. Can you explain for me please. Thanks Michael
The frequency content of square waves is always made up of a series of harmonically related sinewaves - but the generation of a squarewave is never really done that way. Just as it takes about two dozen muscles to smile, you don't consciously contract each of these muscles...
awesome
@w2aew if you still have a look at the comments of your older (but amazing!) videos...
QUESTION: why do even armonix (2, 4, 6...) also appear in the spectrum analyzer (even if several db down they are clearly visible and above the noise floor) and not just the odd harmonics?
Mainly because it is a non-ideal square wave (finite rise/fall, rounded edges, etc.), all which mean that there will be other harmonic content in the signal.
i am working on a DFT on the square wave. having plotted the values in c++ i went ahead to display the output on excel, i notice that the values are about the same but not exact. just in the case of 9.7 and 9.5. all my values from the three harmonics have a slide difference. my question is why are they not accurate on my output, as propose by Fourier that it should be 1/3 the first bin frequency. can u explain this plss
Ok I see. But can you give an intuition to imagine why even harmonics are added to vary the duty cycle?
There really isn't an intuitive way to think about this. But it is easy to visualize this practically. Either on paper, or in MATLAB or Excel, create some vectors of a sine wave and it's harmonics. Then add various combinations. I find it instructive to do it by hand graphically. Draw a sine and it's 2nd harmonic. Add them up and you'll see that the duty cycle changes.
why the 1MHz wave have about 4dB gain?
If you cancle out all the harmonics in the ghz range will the amplitude stay up?
Hi sir, and thanks alot for your videos. I have a question : when I analyses a sinus signal with FFT function in LTSpice it show me a lot of harmonics , and also when I analyse square signal it show me a pair harmonics .... any explanation ?
A sinewave should show energy just at one frequency. If you're seeing more, then you're likely seeing artifacts from improper windowing, etc.
I concur, too much humping causes harmonics, some odd.. Hi
73
When measuring rise time on tsb 1032b scope how do I know where to set my time base?
+mark watson Given the short, fixed memory length on the TBS1000 series, you have to set the timebase to something fast enough to put a few samples on the edge. A good rule of thumb is have the timebase fast enough that the rising edge is taking up a few sub-divisions on the display.
Why the even harmonics appear on the spectrum analyzer if the square wave is formed only by odd harmonics?
You'll note that the even harmonics are very far down (more than 30dB down) from the others. The reason they're there is because the square wave isn't perfect (they rarely are), so there are other harmonic component present.
@@w2aew Thanks, I got it. Can this be a way to measure the quality of a function generator? The lower the unwanted harmonics, the better?
@@gearstil That is certainly one measure of quality.
Clicking through the different parts, didn't actually hear any samples. Did I miss them?
+TheSOB88 Samples of what? What were you expecting to hear? This was not an audio demonstration.
Are there any instances where a square wave is purely DC? For instance - if I mechanically throw a switch on and off?
+Digger D When you operate the switch, the voltage rises or falls very quickly, which generates energy at higher frequencies.
***** Thanks, I was thinking along that line but wasn't sure.
yeh good
why is the values on the spectrum not exact? you had 9.7 but should be 9.5. any explanation for this?
coll
what is the name of that PC software? Thank you
The software is called ARBExpress by Tektronix. It is free, and can be downloaded here:
www.tek.com/signal-generator/afg31000-arbitrary-function-generator/afg31021-software/arbexpress-waveform
O_o
what is the waveform generator package you are using?,looks handy.73 m3vuv
It is called ArbExpress, a free download from tek.com
Sorry for the dumb question but is this explanation important for HOW we create square waves FROM sine waves? I thought always thought square waves were typically generated simply by switching DC on and off at the desired rate (frequency) and at a duty cycle of 50% for a true square wave. Please explain what I'm missing and again, sorry for not understanding.
I was just to show that all squarewaves, even those generated by switching DC on and off, can be thought of as being composed of harmonically related sinewaves - where the rise/fall times dictate how high the frequency content is for that square wave. No one would ever really MAKE sinewaves by adding sinewaves together - it is just an illustration of the frequency and spectral content of squarewaves.