square wave harmonic theory (time domain)

Hello, I'm trying to determine if the higher harmonics of a low frequency square wave are actually AM modulated. For instance, I can see the harmonics of a 1 KHz square wave all the way up at 100 MHz if I zoom into them on a spectrum analyzer. Are those harmonics really there when the 1 KHz square wave has finished it's transition and is in a steady state for half a millisecond? If I was to sample this steady state with a ultra fast ADC and FFT the samples, would I see the harmonics extending up through 100 MHz?

It's a bit of a mind bender when converting between the time and frequency domain in the case of a square wave.

Thanks, Thomas Magma

Reply to
Thomas Magma
Loading thread data ...

I thought a square wave could be broken down into a sum of many sine waves?

Reply to
Marra

Assuming an ideal constant-frequency square wave, all the (odd) harmonics are there all the time, invariant in phase or amplitude. It is mind boggling.

In real life, any square wave has a little frequency modulation (jitter, in the time domain) and that makes higher harmonics jump around, essentially amplitude modulated sort of at random.

It would be hard to sample and FFT such as to resolve the 100,000th harmonic of any waveform.

John

Reply to
John Larkin

Fourier's theorem is correct, yes.

Maybe it's easier to see in the case of a delta-function, whose transform is 1 (i.e. unit amplitude, zero phase at all frequencies). If you imagine starting with a lowpass filter and gradually widening it, you'd see the central spike getting taller (because all the frequency components add in phase there), and narrower, because they all cancel out everywhere else, once you turn the bandwidth up sufficiently.

Now make a periodic alternating sequence of those delta-functions, which gets rid of the frequencies that aren't harmonics of the rep rate--you'll be left with individual unit-strength spikes in the spectrum, placed at all the odd harmonics of the rep rate.

Now integrate. That multiplies all those spikes by 1/(j omega), and presto, a square wave.

HTH,

-_-_-_Phil-_Hobbs-_-_-_-_-_

Reply to
Phil Hobbs

No, they aren't.

Of course you would.

Yes it is, but if you have any programming skills, try working the other way round. Start with a sine wave at 1 kHz, then add the appropriate level of 3rd, 5th, 7th etc. harmonics and see the sum of the components gradually turning into a square wave. You'll see that each frequency term is present continuously.

HTH

Jim

--
Jim Backus running OS/2 Warp 3 & 4, Debian Linux and Win98SE
bona fide replies to j  backus  jita  
demon  co  uk
Reply to
Jim Backus

I was only kind of talking a theoretical ADC. Even though there are ADC's up in the Giga samples per second, lets talk about a theoretical test with an ADC that samples at 1Gsps with 24 bit resolution (kick-ass ADC). If I took a

1 KHz square wave and triggered my ADC on the rising edge of the pulse...delayed a bit waiting for the transistor to settle (say 200uS)...then took 65536 samples (65uS) of the steady state and did an FFT on them...what would I see? In the time domain it would appear I was sampling DC. If the FFT shows high frequencies relating to 1KHz where are they coming from?

Thomas

Reply to
Thomas Magma

The fundamental assumption for the FFT is that the data taken during your sampling interval repeats from negative infinity to positive infinity. If you take 65K samples of an unchanging DC level, you will get only DC energy in the result, (plus all the artifacts from windowing, roundoff, etc.)

So as John pointed out - the harmonics are really there if you sample the entire 1 kHz wave and it has instantaneous rise/fall times. But if you only look at a piece of the signal, you get a completely different result.

To minimize the sampling artifacts, make the sample interval an exact multiple of your waveform's period, so that the "repeating to infinity" assumption is valid. Since its not usually practical to do that exactly, window functions are used to reduce the artifacts that will appear when the FFT algorithm "assumes" its seeing an integral number of periods of an infinitely repeating waveform.

Steve

Reply to
Steve

In theory, an ideal square wave should generate infinite frequencies in harmonics. But then again, we don't exist in a ideal world! .

--
"I\'m never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
Reply to
Jamie

So now I'm really confused, are you saying that during certain times of a square wave there is no harmonic content? Would that not imply that the high frequency harmonics are stronger at certain instances of time compared to others?

Thomas

Reply to
Thomas Magma

A square wave is forever. If you examine a little time slice of a square wave, it's not a square wave... it's a rise, or a fall, or DC.

John

Reply to
John Larkin

As a general rule, if you modulate the fundamental, you modulate the harmonics.

Digitize it and run a Fourier Transform.

Otherwise, phase lock to a harmonic and see what demods out.

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"

** They simply do not exist in the " time domain".
** Sorry, that is not a " time domain" instrument.
** There is the sudden step change in voltage followed by a steady voltage until the cycle repeats.

YOU asked for the " time domain" (ie real life ) view, so you cannot simultaneously crap on about imaginary harmonics.

** No - it is just a fixed voltage.
** Has no-one ever informed you the " frequency domain " does not really exist - except as an abstract mathematical conception.

Albeit, a very useful one.

....... Phil

Reply to
Phil Allison

Really? How about the domain of an optical Fourier plane? Seems pretty real to me:

formatting link

-- Joe

Reply to
J.A. Legris

"J.A. Legris Cunt Brain" "

** Yep.

....... Phil

Reply to
Phil Allison

What I am saying is that if you only look at a small piece of the wave period, you do not get any information about what frequencies are required to produce the parts you aren't looking at. The FFT cannot analyze portions of a waveform it never saw. If all 64K samples are at 3.34578 volts, then the FFT has to say its looking at a 3.34578 DC voltage. How can it know anything else? That's why I pointed out that the assumption of infinite periodicity must be considered when you interpret the results. Otherwise it's garbage in garbage out analysis.

Steve

Reply to
Steve

On May 30, 1:50 pm, John Larkin [....]

Here's how I first go a grip on the idea in a time domain sense. It may help others.

Imagine you have a tuned circuit with a very high Q being driven by the squarewave. On each edge, the tuned circuit will be "shock excited" and then start to ring down. This is like a bell being struck, if you want to imagine a sound for it.

If the Q is high enough, when the next edge comes along, the circuit is still ringing. If the tuned circuit is tuned to an odd harmonic, the next edge will be timed perfectly to pump the ringing up.

Now imagine the shape of the envelope. It jumps up and decays and jumps up and decays. The decay rate decreases for higher Qs. In your mind crank the Q up. Luckily, you can imagine better inductors than you can buy. At a stupendous Q value, there is no longer any modulation and the signal is a good sine wave.

We know that the tuned circuit is a filter so it doesn't invent frequencies just selects them. This means that the sine wave we see on the output must have been in the input.

Reply to
MooseFET

On May 30, 1:50 pm, John Larkin [....]

Here's how I first go a grip on the idea in a time domain sense. It may help others.

Imagine you have a tuned circuit with a very high Q being driven by the squarewave. On each edge, the tuned circuit will be "shock excited" and then start to ring down. This is like a bell being struck, if you want to imagine a sound for it.

If the Q is high enough, when the next edge comes along, the circuit is still ringing. If the tuned circuit is tuned to an odd harmonic, the next edge will be timed perfectly to pump the ringing up.

Now imagine the shape of the envelope. It jumps up and decays and jumps up and decays. The decay rate decreases for higher Qs. In your mind crank the Q up. Luckily, you can imagine better inductors than you can buy. At a stupendous Q value, there is no longer any modulation and the signal is a good sine wave.

We know that the tuned circuit is a filter so it doesn't invent frequencies just selects them. This means that the sine wave we see on the output must have been in the input.

Reply to
MooseFET

I'm not sure if this is a good analogy to help answer the original question...if you strike a bell, it will ring at the resonant frequency of the bell structure and not generate harmonic frequencies relating to the rate in which you strike it.

Thomas

Reply to
Thomas Magma

Thanks Steve I appreciate the input and I can totally see what you are saying. I'm just have troubles dealing with the concept of harmonics not existing in certain portions of the time domain but continuously existing in the frequency domain.

Thomas

Reply to
Thomas Magma

Kill file him, like everyone with a real newsreader does.

--
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

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.