# dc offset

#### joka2188

Joined Nov 10, 2006
9
is there an equation for calculating the dc offset of a square wave?

#### hgmjr

Joined Jan 28, 2005
9,027
Can you be a little more specific?

hgmjr

#### Papabravo

Joined Feb 24, 2006
19,570
is there an equation for calculating the dc offset of a square wave?
Rich (BB code):
(Vmax + Vmin) / 2

#### joka2188

Joined Nov 10, 2006
9
Rich (BB code):
(Vmax + Vmin) / 2
thanks 4 dat, much appreciated

#### pebe

Joined Oct 11, 2004
626
thanks 4 dat, much appreciated
That formula assumes equal mark/space ratio.

#### Papabravo

Joined Feb 24, 2006
19,570
Last time I looked a square wave had a 50% duty cycle or equal mark space ratio as you so quaintly put it.

#### Dave

Joined Nov 17, 2003
6,969
I agree that a typical square wave has a 50% duty cycle. I think the case pebe is refering to is important for digital signals where the duty cycle may be anything between 0-100% for a given period. For example:

If the total time period of the digital signal is x

The digital signal is at Vmax for y periods of x

And the digital signal is at Vmin for z periods of x

Where x = y + z

Then the DC offset is calulated by:

(x*Vmax + y*Vmin)/x

This is a general solution of which the one Papabravo gave above is a spcial case where the duty cycle is 50%

Dave

#### hgmjr

Joined Jan 28, 2005
9,027
When I asked joka2188 for a few more specifics, I was looking for a confirmation that the square-wave in which he was interested had a 50% duty-cycle.

While all answers thus far provided are accurate, the general case that Dave has provided covers all contingencies nicely.

hgmjr