# Is a square wave still considered DC?

Say I have a logic-level square wave, where 0V is "low" and 5V is "high". I'm pulsing this at a constant 60Hz, 50% duty cycle. My intuition says that since the voltage never goes negative, it's a DC signal, regardless of how fast I'm pulsing it. Is that correct?

Furthermore, when considering op-amps to amplify signals from sensors that again produce 60 Hz square waves between 0 and 100mV, can I also consider this a DC signal, and not worry too much about my gain-bandwidth product?

• The way I think of it is that for a signal to be considered DC it should never change. So a square wave is AC in my opinion.. – m.Alin May 28 '14 at 15:32
• a sinewave clamped positively has no negative part. but is it DC?? – nidhin May 28 '14 at 15:40
• Is a -5 V power supply not DC? When a signal has a non-zero average value, we say it has a dc component, whether the average value is positive or negative. But having a dc component doesn't make it a dc signal. – The Photon May 28 '14 at 16:50
• I do not agree at all. If what you say is correct then just changing the reference node in a circuit can change whether a particular signal is DC or AC. – Vladimir Cravero May 28 '14 at 17:16
• DC means constant for practical purposes. What has the GBW product have to do with your measurement? Are there stability issues? Does the opamp need to be compensated? – copper.hat May 28 '14 at 23:00

## 6 Answers

Brief answer to both questions:
No, that's not correct.
No, you do need to worry about that.

Let's start from the beginning. There is no way you will ever deal with a literally 'DC' signal. Let's say you have a bench power supply, you use it to power your circuits, that's maybe some 5V DC, right? And what about when you turn it off? What about power outages? What about when that particular bench supply didn't even exist?
My point is: a real (existing) signal can never literally be DC. At some point in time it didn't, and it won't, exist.

But there's hope: we can give a somewhat less strict definition of DC signal, and we're calling in our old friend Fourier. I am assuming you know what the Fourier Transform is, you can read it up or just believe me: there is this particular mathematical transform that takes in a signal that is a function of time and spits out a signal that is a function of frequency. And that works in both way, so your nice signal can be either represented in its time domain form or in its frequency domain form.
But what do we need this frequency thing for? Well that's easy, let's say you have: $$x(t)\rightleftharpoons X(f)$$ where $x(t)$ is your signal in the time domain, while $X(f)$ it's the same signal in the frequency domain. Now, if you compute $x(t_0)$ you get the value your signal has in the instant $t_0$, so what about $X(f_0)$? Well, you get the value your signal has at the frequency $f_0$, plain and simple. Let's say that you record a bass drum and a violin, you have the time domain signals, you transform them then plot them: the bass drum will be very high for low frequencies, while the violin will be very high for high frequencies. That's because the bass drum has plenty of low frequency components, while the violin has plenty of high frequency ones.

So let's go back to DC definition. We could say that a signal is DC if "most of its components are at very low frequencies". That's better than "it never changes", having low frequencies components can actually happen. That's not a precise definition but let's take it as is now.

What about your square wave? Let's have a look at the plot of a square wave frequency components (also called spectrum): (source: wikipedia)
That's a 1kHz square wave: as you can see the function plotted is very high at 1kHz, but also at 3, 5 and so on... And (trust me) the height of the peaks goes down as 1/f, that's slow. And please note I did not made any assumption on whether the wave is going or not below zero.

So your square wave is far, far away from being DC.

Now to your second question: that's a completely different one. If and only if your square wave amplitude is very very small compared to other signals you have around you can say "well let's just pretend it's not there". But that's not your case, your square wave is the signal you want to amplify. And as you just learned that's not DC at all... You better look carefully at the specs of the op amp you are going to choose then.

'The answer' is that it depends on what one means by DC.

I believe that it is safe to say that, for most, "DC" no longer stands for Direct Current which is defined as a current that does not alternate in direction as opposed to Alternating Current which does.

In most contexts, "DC" is a synonym for constant. For example, a (good) 5 VDC power supply produces a (more or less) constant 5V and not, for example, a varying but positive voltage.

Another example is the "DC component" of a signal which means the (constant) time average of a signal.

Yet another example is the "DC solution" for a circuit; the solution for which all the voltages and currents are constant.

Still, in some cases, "DC" is used to mean non-alternating or unidirectional such as, for example, the unfiltered output of a rectifier which is sometimes called pulsating DC.

So, in the first sense, your square wave is not DC since it is not constant.

But, in the second sense, your square wave is DC since it is non-alternating.

• This answer seems more complete than the accepted answer. It points out that DC can refer to any current which is not "alternating" (changing direction/polarity) including "pulsating DC", while also pointing out that this "pulsating DC" can also be called "AC" because its voltage is fluctuating, whether it's square, sin, or non-waveform. – etherice Aug 31 '14 at 16:17
• I think the point to be made is that this squarewave is non-negative-going (below zero volts) or a positive DC bias. So it is not "AC" in the traditional sense, however it is an alternating waveform, and does exhibit all of the characteristics of AC signals. So it can be looked at in both ways - as two DC voltages varying with time, and also as an AC squarewave, just with a DC bias that happens to place the lower edge at 0 volts. – rdtsc Jan 17 '16 at 18:38

If you made DC approximations when analyzing a circuit with a square wave input, you would be missing a substantial portion of the response. Therefore, you should not make DC assumptions. If it helps you the think of the square wave as AC, then it helps you. I suggest its more helpful to think about why you're trying to put the signal into a drawer in the first place, and that should help generate the answer.

negative is relative to a reference.

If you move your reference to 2.5V, you'll have a -2.5/+2.5 alternating current.

Watch a battery discharge over time, it is an exponential decay.

Wait even longer, all potentials in the universe approach zero.

If a CPU cycle was equal to one second, then your 60Hz square wave would appear to remain 5V for about 20 years.

...but really, what Vladimir said.

A square wave that remains on the positive plane is a switching DC supply switching between on and off, 0v d.c full voltage d.c.

A.c voltage goes beyond 0v to the negative plane you have an alternating current a.c 0v, full voltage positively 0v and negative full voltage back to 0v one complete cycle ac waves can be rectified to be perfectly sinusoidal wave commonly referred to as a sine wave.

You also have other forms of ac that would almost look the same as the square wave you mentioned earlier how ever it goes full voltage+, straight to full voltage- and back to full voltage the difference is the time it takes to get from full to 0v when compared to a sine wave this time is referred to as frequency measured in hertz which is cycle per second. In my country our normal operating frequency is 50hz or 50 complete cycle in one given second. Again 0v to + to 0v to to - back to 0v

A method to display what is happening and gives you a visual look at what is happening by displaying a sine wave would be to use an oscilloscope.

• If you use a Pulse width modulator it is essentially chopping the dc correct so it applies full voltage ov full voltage repeats this cycle so fast you dont know its happening to adjust brightness of lights or speeds when used for a motor this is the same effect when viewed through an oscilloscope as a square wave dc signal correct? It is not AC it is a intermittent DC signal lets not confuse this more than it needs to be hook this up to a diode it will flow hook ac up to a diode it will blow if it flows through a diode it is DC. Simple. – Muteki89 Jun 26 '14 at 10:06