0
\$\begingroup\$

I have a hard time understanding the concept of frequency in square waves. With sine waves, it is straightforward. You increase the frequency and the signal appears more often in the same time interval. That can apply to square waves too. But I know that in order for a pulse to appear immediately (for example 0V to 5V in lim(time)->0) the frequency must be infinite.

So what's going on here?

On one hand we have the straight forward frequency that you increase it and you see more square waves over the same time.

On the other hand we have the frequency harmonics that are almost infinite.

What is true?

What would fourier analysis give us?

\$\endgroup\$
4
  • 1
    \$\begingroup\$ I am afraid, you are mixing repetition rate ("frequency" of squarewave) with Fourier analysis. \$\endgroup\$
    – LvW
    Commented Sep 23, 2014 at 12:44
  • 1
    \$\begingroup\$ en.wikipedia.org/wiki/Square_wave \$\endgroup\$
    – Majenko
    Commented Sep 23, 2014 at 12:45
  • 1
    \$\begingroup\$ Also risetime/slew \$\endgroup\$
    – user16222
    Commented Sep 23, 2014 at 16:15
  • \$\begingroup\$ It is a reasonable question. You are looking at rate of change as in dv/dt and yes, a perfect square wave (of any frequency) requires infinite slew, or dv/dt on the edges. So, they are never perfect. Mathematically this is handled by proofs that the various transforms are valid for "piece-wise continuous functions" and the math centers around the Heavyside Function (a step) and the Dirac Delta Function (a spike). But for frequency of a square wave we really mean how often it happens. How close to perfection is bandwidth. \$\endgroup\$ Commented Sep 23, 2014 at 21:32

5 Answers 5

6
\$\begingroup\$

You're confusing bandwidth with the fundamental frequency, or repetition rate.

A square wave behaves the exact same way as a sine wave, in that as its fundamental frequency increases, you will see more cycles in a given amount of time.

Square waves theoretically have infinite bandwidth. (I seem to recall seven times the fundamental as a practical rule of thumb from school.) Intuitively, more higher harmonics are needed to sharpen the rising and falling edges.

Plotting it out as a summation of sines is easy and will help with your understanding.

\$\endgroup\$
2
\$\begingroup\$

Forget Fourier analysis. The fundamental frequency of a square wave, as measured for example by a frequency counter, an oscilloscope with a frequency measurement capability, or a microcontroller with a input capture module is simply one over the period (time measurement between successive peaks of the signal). The period may be measured from one rising edge to the next as shown in the first diagram below, or from one falling edge to the next. This works with symmetrical square waves (50% high and 50% low), but also pulses where the on duty cycle is much less than the off duty cycle (or vice versa), as in second diagram below.

enter image description here

Actually this is true for any kind of periodic wave (e.g. sine waves, triangle waves) -- just measure the period from one positive (or negative) peak to the next and take the inverse. In the case of sine waves or other slowing rising signals, a Schmitt trigger may be needed to create a suitable rising edge to measure.

\$\endgroup\$
0
\$\begingroup\$

In theory a square wave has an instantaneous rise and fall. But it has a dwell time based on the frequency. Lets take a 1 hz square wave. The signal goes from zero to 100% [1] in an instant. Then will remain at 1 for 1/2 of the wave length or 500ms. Then it goes negative to -1 and remains there for 500ms. And the cycle repeats. So, it is + for half the time and - for the other half. It's the rise/fall that must be infinite. Of course in real life that is impossible, but the lower the frequency, the less relevant the rise/fall time become. Also, the power level will be calculated differently. a logic based flip/flop circuit is one way to produce a fair square wave BTW.

\$\endgroup\$
0
\$\begingroup\$

I think it is more correct to speak of the period of a square wave instead of a square wave frequency. A square wave is a periodic signal, where the period is the time interval after which the signal repeats the same pattern of values.
Moreover, we have the Fourier analysis. This mathematical tool allows us to express a signal that meets certain conditions, such as a series whose terms are trigonometric functions.

In the case of a square wave, the Fourier series representation contains infinite terms, of which the lower frequency corresponds to the fundamental frequency of the square wave, and the period is the same as for the square wave.
The point of the speed at which a square wave grows, is unrelated to the fundamental frequency of the same, but rather with limited bandwidth. What does this mean? If all the infinite terms of the Fourier series are not included in the representation of a square wave, the sum represents "roughly square" signals; few more terms we include, the more "square" is the signal represented.

A band-limited signal is one that does not include all the harmonic components (the terms of the Fourier series), or rather, has a maximum value for the frequency of the harmonic components to consider. This limit, usually due to system conditions.
Then, in a real system, a "square wave" can not include all the harmonics that should theoretically include. This means that the signal is "not so square" and needs a certain interval to go from one value to another.

\$\endgroup\$
0
\$\begingroup\$

Any periodic wave can be expressed as a combination of sine waves of the basic frequency plus harmonic frequencies of sine wave shape.

A square wave can be expressed as a combination of a basic sine wave of same frequency plus other sine waves of higher frequencies of odd number.

That is, a square wave of 60Hz can be simulated by a combination of sine waves of: 60 Hz + 180 Hz + 300 Hz + 420 Hz +.....

For approximation of square wave, you can get a reasonable shape using the first few harmonics. As you keep on adding more harmonics, the shape tends to become nearer to a perfect square wave.

\$\endgroup\$

Your Answer

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

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