Square Wave

Status
Not open for further replies.

Basra123

Member
How to Find the RMS and THD of a +1, -1 volt square wave of fundamental frequency 60 Hz. The wave is symmetric in the sense +1 for 1/120 s, and -1 for 1/120 s
 

spsnyder

Senior Member
Re: Square Wave

I think the RMS would be ((1^2)+(-1^2))^.5 or sq-rt of 2=1.4142.

I am not sure of the other term you are asking about. What is it not abreviated? Is it Total Harmonic Distortion?

[ February 03, 2006, 11:38 AM: Message edited by: spsnyder ]
 

charlie b

Moderator
Staff member
Location
Lockport, IL
Occupation
Retired Electrical Engineer
Re: Square Wave

I agree with 1.414 as being the RMS, and with the meaning of THD. But I do not know how to calculate THD.
 

charlie b

Moderator
Staff member
Location
Lockport, IL
Occupation
Retired Electrical Engineer
Re: Square Wave

In this example, the RMS of the square wave is 1.414. The RMS of a pure sine wave is also 1.414. Are you saying that the THD of this signal is 100%?
 

steve66

Senior Member
Location
Illinois
Occupation
Engineer
Re: Square Wave

Usually, THD is the ratio of the noise to the signal. For example, this is somewhat like the THD used for specifying the performance of audio equipment.

So if you want your signal to be a square wave, the THD is zero, because you have a square wave.

But if you are looking for a pure 60Hz sine wave, then THD would be defined as the ratio of the amplitude of all the noise to the amplitude of the 60 Hz sine wave. This is probably what you want. (I will assume we are talking about a voltage signal, and not power).

A perfect square wave is made up of an infinite number of sine waves, all odd multiplies of the fundamental. In your case, the fundamental sine wave is 60Hz, and it has a peak amplitude of 1 volt. The other frequencies are;

180 HZ at 1/3 volt
300 Hz at 1/5 volt
420 Hz at 1/7 volt
540 Hz at 1/9 volt
660 Hz at 1/11 volt

and on and on forever, with each one getting a smaller amplitude. (The nth term is n*60Hz in freq, and 1/n in amplitude.)

The RMS value of the square wave is actually 1. I'll leave the proof to Rattus, but basically you should have divided by 2 before taking the square root. Notice that the RMS value can't be larger than the peak value of the square wave.

So to get THD, we use the RMS value of our 60Hz wave, (which is a sine wave with a peak of 1v) to get .707. Subtract this from the total RMS of 1 to get a noise RMS value of 0.293. So I think the total THD is 0.293/.707 = 0.414 or 41.4% THD.

I'm not 100% sure of that answer. Maybe THD is sometimes defined as the noise over the total signal, which would be 29.3%.

Steve
 

charlie b

Moderator
Staff member
Location
Lockport, IL
Occupation
Retired Electrical Engineer
Re: Square Wave

Originally posted by steve66:The RMS value of the square wave is actually 1. I'll leave the proof to Rattus, but basically you should have divided by 2 before taking the square root.
You are right. I missed that. The "M" word in "RMS" is "mean." You take 1 squared plus 1 squared, then divide by 2 to get the average before extracting the square root. One attaboy for Steve, :) one oops for me. :(
 

rattus

Senior Member
Re: Square Wave

The way I see it:

The peak value of the fundamental in this case is 4/pi = 1.273V, then the RMS value of the fundamental is 0.9V.

Total power is 1/R. Fundamental power is 0.81/R. Noise power is 0.19/R. Then,

THD = 0.19/0.81 = 0.235 or 23.5%.

An easy way to compute the RMS value of a square wave is to rectify it in your mind with an ideal full-wave rectifer which yields in this case 1Vdc which has by definition an RMS value of 1V.
 

Basra123

Member
Re: Square Wave

Rattus,

How did you come up with pi/4 as the peak value? also this is voltage THD and not power? so how to calculate the THD in this case?
 

steve66

Senior Member
Location
Illinois
Occupation
Engineer
Re: Square Wave

The peak value of the fundamental in this case is 4/pi = 1.273V,
Oops, I was thinking the peak of the 60 Hz signal was 1 since its coeficient is 1/1. If we are strictly talking about voltage, then the THD is 0.1/0.9 or 11.1%.

Steve
 

rattus

Senior Member
Re: Square Wave

Originally posted by Basra123:
Rattus,

How did you come up with pi/4 as the peak value? also this is voltage THD and not power? so how to calculate the THD in this case?
4/pi not pi/4. This value is the result of evaluation of the first term of the Fourier series which involves integration of the square wave over one cycle. See your math books for an explanation of the Fourier series.

To my knowledge, distortion is expressed in terms of power ratios, not voltage ratios.
 

spsnyder

Senior Member
Re: Square Wave

Steve, That makes sense that the RMS of a square wave should be larger than that of a sin wave. When I got the answer I was scratching my head. Thanks for the clarification.
 

charlie b

Moderator
Staff member
Location
Lockport, IL
Occupation
Retired Electrical Engineer
Re: Square Wave

Originally posted by rattus:To my knowledge, distortion is expressed in terms of power ratios, not voltage ratios.
My very thick and heavy dictionary of scientific and technical terms does define THD in terms of a ratio of power levels. It also says it is expressed in dB, not in %. But I have only seen it expressed in %.
 

rattus

Senior Member
Re: Square Wave

C.B.,

I believe the electronics guys express THD in dB. I doubt that the typical power engineer ever uses dB.

Now if I recall correctly, THD is the ratio of the summation of all the harmonic powers and the fundamental power.

I have to ask though, "Why would anyone want to know the THD of a square wave?"
 

physis

Senior Member
Re: Square Wave

This looks like a fun thread. I only have about 15 minutes though. That wont be enough. :(
 
Status
Not open for further replies.
Top