square wave harmonic theory (time domain)

I get your point, but it's tough when it's a response to your own thread.

It's like trying to close your ears.

Thomas

Reply to
Thomas Magma
Loading thread data ...

The edges.

And, yes, counterintuitive as it might seem, all of the frequency components are there all of the time - but because of the way they're added together in phase, everyplace but at the rising and falling edge, they add up to either +peak or -peak.

Imagine, say, five cars in a weird race:

They each have a different starting line, but they all have the same finish line. Car A's starting line is at, say, 100 yards; car B's is at 200 yds, car C at 300 yards, and so on.

Start them simultaneously, with car A going one MPH, car B going 2 MPH, car C going 3 MPH, and so on.

Nothing much happens until they all reach the finish line simultaneously, where they all come together at the same time - Crash! - that would be the rising edge of the square wave, where all of the harmonics converge in phase.

That's one way to visualize it, anyway.

With the sine waves, it's not their speed but their phases that do the trick; this is also why square waves have such a wide bandwidth.

Hope This Helps! Rich

Reply to
Rich Grise

Well, I just posted another post, but the point is, the components are, in fact, there all of the time - it's the changing phase relationships over time that make them add up to what looks like DC, for awhile, then the opposite polarity of DC, for a while.

I don't know the ratios, although it's probably easy to look them up - oh, heck....

Hey! Wiki's got an animation! It shows exactly what you're asking about:

formatting link

Cheers! Rich

Reply to
Rich Grise

If you kill file him, you won't even know he responded.

--
Service to my country? Been there, Done that, and I've got my DD214 to
prove it.
Member of DAV #85.

Michael A. Terrell
Central Florida
Reply to
Michael A. Terrell

OK, make your filter "infinite"-Q and tunable. Feed it with, say, a 100Hz square wave. Tune your filter to 100Hz, and you get a 100Hz sine wave out. Tune your filter to 300Hz, however, (with the same 100Hz input) and you get a 300Hz sine wave out, at 1/3 the amplitude of the 100Hz. Tune the filter to 500 Hz, and you'll get a 500 Hz sine wave out, at 1/5 the amplitude of the 100 Hz, and so on.

You could do this with as low a frequency of a square wave as you want - I picked 100Hz because you can view it on a scope in real-time.

But, the facts are, even with a .01Hz square wave, you have the same effect - 5.01Hz will be there, just at 1/501 of the amplitude of the .01Hz, and so on.

Hope This Helps! Rich

Reply to
Rich Grise

Here's another graphic:

formatting link

Cheers! Rich

Reply to
Rich Grise

How about the tuning dial on a radio? >:->

And the FCC allocation chart is certainly in the frequency domain!

formatting link
**CAUTION: 93KB PDF**

Cheers! Rich

Reply to
Rich Grise

I have generated a square wave many times on my graphics calculator and using Goldwave's expression evaluator with expressions like:

sin(2*pi*f*t) + sin(2*pi*f*t*3)/3 + sin(2*pi*f*t*5)/5 + sin(2*pi*f*t*7)/7 + sin(2*pi*f*t*9)/9 + sin(2*pi*f*t*11)/11 + sin(2*pi*f*t*13)/13 + sin(2*pi*f*t*15)/15 + sin(2*pi*f*t*17)/17 + sin(2*pi*f*t*19)/19 + sin(2*pi*f*t*21)/21 + sin(2*pi*f*t*23)/23 + sin(2*pi*f*t*25)/25 + sin(2*pi*f*t*27)/27 + sin(2*pi*f*t*29)/29 + sin(2*pi*f*t*31)/31 + sin(2*pi*f*t*33)/33 + sin(2*pi*f*t*35)/35 + sin(2*pi*f*t*37)/37 + sin(2*pi*f*t*39)/39 + sin(2*pi*f*t*41)/41 + sin(2*pi*f*t*43)/43 + sin(2*pi*f*t*45)/45 + sin(2*pi*f*t*47)/47 + sin(2*pi*f*t*49)/49 + sin(2*pi*f*t*51)/51 + sin(2*pi*f*t*53)/53 + sin(2*pi*f*t*55)/55 + sin(2*pi*f*t*57)/57 + sin(2*pi*f*t*59)/59 + sin(2*pi*f*t*61)/61 + sin(2*pi*f*t*63)/63 + sin(2*pi*f*t*65)/65 + sin(2*pi*f*t*67)/67 + sin(2*pi*f*t*69)/69 + sin(2*pi*f*t*71)/71 + sin(2*pi*f*t*73)/73 + sin(2*pi*f*t*75)/75 + sin(2*pi*f*t*77)/77 + sin(2*pi*f*t*79)/79 + sin(2*pi*f*t*81)/81 + sin(2*pi*f*t*83)/83 + sin(2*pi*f*t*85)/85 + sin(2*pi*f*t*87)/87 + sin(2*pi*f*t*89)/89 + sin(2*pi*f*t*91)/91 + sin(2*pi*f*t*93)/93 + sin(2*pi*f*t*95)/95 + sin(2*pi*f*t*97)/97 + sin(2*pi*f*t*99)/99

You can still see the harmonics in the time domain.

But I've also made perfect square waves with logic expressions like:

int(2*f*t)%2*2-1

Similar to how one would generate them is say a micro or clock counter. Where there is no harmonic content whatsoever in the time domain.

Thomas

Reply to
Thomas Magma

You are mixing your domains, sir.

The above sum of sins IS in time domain, assuming that t is the independent variable. The only reason you can see "harmonics" in your graph is that you have truncated an infinite series after

Reply to
J.A. Legris

I was going to post something longer when I realized we're going around in circles. Then again maybe you're NOT going around in circles when you should be ;-)

Go read up on Fourier Series, then Fourier Transform and then Discrete Fourier Transform.

-- Joe

Reply to
J.A. Legris

I did an RPM counter for cars using an FFT.

The car drove onto a plate with a piezo in it. The operator input the number of cylinders and the software worked out the RPM without lifting the bonnet.

Microchip did a good apllication note on this.

formatting link

Reply to
Marra

The "domains" are just ways of looking at exactly the same thing, a square wave. If you really have a square wave, the harmonics are present all the time, no matter how you think about them.

If you bought a ticket to a NASCAR race, and showed up late, and walked into the stands just when the pack was over there, behind some trees, I suppose you could instantly turn around and demand your money back, because you didn't see "a race." Same idea: if you insist on looking where the square wave isn't, you won't see a square wave.

John

Reply to
John Larkin

Your hired!! But I'm not too sure why you handed me your resume.

:) Thomas

Reply to
Thomas Magma

Imagine that you had a black box containing two power supplies (or batteries) in series and that series connection was made available to a couple of terminals on the box. If one of them was a 1,000,000 volt supply and the other was a -999,999 volt supply, then you would measure 1 volt at the terminals.

But, there could also be a 10 volt supply in series with a -9 volt supply in the box, and you would also measure 1 volt at the terminals.

So, if you had a box with 1 volt out, you could "decompose" that 1 volt in many ways, and there would be no way to determine what was actually in the box just by measuring the 1 volt out. But an external circuit connected to the box terminals would behave the same way no matter what was actually in the box.

A given time-varying waveform can be decomposed in many ways also (Fourier series, Walsh functions, etc.). You could connect a trillion (an approximation to infinity) signal generators in series with their frequencies, phases and amplitudes adjusted to provide the well known 1 kHz fundamental plus odd harmonics with amplitude varying as 1/n. You would see a passable square wave, but you wouldn't be able to tell whether it came from all those generators, or from a flip-flop. And, as far as circuit behavior goes, it doesn't matter.

Fourier's great discovery was that *any* time varying waveform could be decomposed into a sum of sine waves whose amplitudes are constant. This doesn't mean that the waveform was actually generated by means of a lot of sine wave generators. But if you wanted to generate it that way, he tells you what the amplitudes, frequencies and phases of the sines should be.

The real value of his decomposition for electronics is that linear RLC networks respond to time varying waveforms *exactly* as if the waveform

*were* composed of all those harmonics. So, if you analyze circuit behavior on the assumption that a waveform was created as a sum of sine waves, you will get the right answer. If it's easier to analyze that way, then do so.

Note that if a 1 kHz square wave were generated with a trillion sine wave generators in series, on a scope it would look the same as if it had been generated with a flip-flop. And a circuit driven with it would behave exactly the same as if it came from a flip-flop. In this case, there would be *actual* sine waves adding up to form the square wave.

If you apply the waveform to a bunch of tuned circuits (very high Q LC resonators), and wait long enough (infinite time?), each resonator tuned to a particular harmonic will behave the same way if the waveform is created with a bunch of sine waves added together or with a flip-flop (in the case of your square wave).

Since a spectrum analyzer is just a device for emulating the behavior of a bunch of resonators, it shows you the amplitude, etc., of the various sine waves, which, when added together, would give the waveform being examined; this *is* the Fourier decomposition. It can't tell whether the waveform was actually generated with a trillion sine wave generators or not. It could have been, but it doesn't matter as far as circuit behavior goes; the circuit behavior is the same either way.

Now you can see that the reason the top of the square wave seems to have no sine waves there is that they "cancel", except for the constant amplitude of the top of the square wave. If the square wave had some

*dead* time (zero amplitude over a subinterval, such as some power inverters put out), the constant amplitude sine waves making up the Fourier decomposition would still be there; they would just "cancel" to give zero on that subinterval. The Fourier decomposition sees to it that it happens that way. They're still there (in the Fourier decomposition) but you can't see them in the time domain because they add up to zero over that interval.
Reply to
The Phantom

Try this for a surprise:

F(t) = 1.22860622406 * sin(2*pi*t)

  • .307151556015 * sin(2*pi*t*3)
  • .102383852005 * sin(2*pi*t*5)
  • .0292525291443 * sin(2*pi*t*7)
  • .0062050819397 * sin(2*pi*t*9)
  • .000846147537231 * sin(2*pi*t*11)
  • .0000550746917725 * sin(2*pi*t*13)

What do you see in the time domain? You will have to plot it on a PC rather than a calculator to see how good it really is.

Reply to
The Phantom

Detailed plots at

formatting link

also see

formatting link

--
Many thanks,

Don Lancaster                          voice phone: (928)428-4073
Synergetics   3860 West First Street   Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml   email: don@tinaja.com

Please visit my GURU\'s LAIR web site at http://www.tinaja.com
Reply to
Don Lancaster

"Thomas Magma"

** You are one smartarse prick - Tom.

** The only "kook" in sight is YOU - ASSHOLE.
** You dumb opinion does not count - FOOL.

Question askers do ** NOT ** get to decide who is right and who is not.

** You are one colossal jerk - Tom

Piss the hell off.

....... Phil

Reply to
Phil Allison

"Don Blow it out his Arse Bowey"

( snip brain dead drivel)

** Look - nothing left.

As always from the Bowey bullshit artist.

........ Phil

Reply to
Phil Allison

"Rich Grise"

** Total BOLLOCKS.

Kill file the mentally retarded Grise FOOL NOW !!

........ Phil

Reply to
Phil Allison

"John Larkin"

** More brain dead BOLLOCKS.

Classic grossly autistic engineer think.

Larkin sure as hell is an autistic.

....... Phil

Reply to
Phil Allison

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.