# 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.. May 28, 2014 at 15:32
• a sinewave clamped positively has no negative part. but is it DC?? May 28, 2014 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. May 28, 2014 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. May 28, 2014 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? May 28, 2014 at 23:00

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. Aug 31, 2014 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. Jan 17, 2016 at 18:38
• Many nebulous EE terms, and no one ever addresses things like this. This question always leaves my head spinning because the way you're taught, for something to be AC, the current needs to actually alternate. A square wave still have current going in one direction when its flowing, so I always think of that still as being a DC signal. Even though, I can see the case for calling it an AC signal since the signal isn't constant the entire time but I feel like that should have a different name. EE definitions are always so muddy, and everyone answers questions like this differently. Frustrating. Sep 28, 2021 at 15:19
• @in70x wrote "EE definitions are always so muddy,". That's quite a broad brush you're painting with. Oct 1, 2021 at 23:49

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.