Square wave DC vs AC coupling - Page 1
Forum section: electronics / beginners

author: hgg
author_rank: Frequent Contributor
timestamp: May 05, 2016, 10:56:16 am
content: Hi.I am using a cheap ebay signal generator to display a 1Vpk 1Khz square wave to my oscilloscope.When the scope is in DC coupling the signal goes from +500mV to -500mV from 10% to 90% dutycycle and its vertically centered.I then change the scope to AC coupling and when the duty cycle is less or greater than 50% thesignal is offset positive or negative on the display. Shouldn't the signal remain vertically centereddespite the changing duty cycle?Is this normal ?Thanks.

author: tautech
author_rank: Super Contributor
timestamp: May 05, 2016, 11:06:58 am
content: No it doesn't look right.Could Trigger level settings have something to do with it?They're hidden by the measure menu.Can you re-check trigger levels for AC coupling?tautech rushes off to get a SDS1102 to check for himself.......

author: hgg
author_rank: Frequent Contributor
timestamp: May 05, 2016, 11:11:43 am
content: Hmmm.Triggering is set to rising edge/auto and the vertical centering does not changewith different trigger levels. Only the horizontal centering.Could that be a problem with the signal gen?

author: JPortici
author_rank: Super Contributor
timestamp: May 05, 2016, 11:14:32 am
content: why am i not surprised by this? what am i missing?

author: Zero999
author_rank: Super Contributor
timestamp: May 05, 2016, 11:20:09 am
content: Quote from: hgg on May 05, 2016, 10:56:16 amYes it's perfectly normal and to be expected.When AC coupled the DC bias will change as the capacitor charges/discharges due to the net DC in the signal. Try setting the 'scope to DC coupled and connect a 1nF capacitor in series with the probe and signal generator.

author: hgg
author_rank: Frequent Contributor
timestamp: May 05, 2016, 11:29:49 am
content: Confused...I just did what Hero999 suggested and when I connect a 1pF capacitor in line with the signaland with DC coupling, I get the same result.So, is it normal or my AC coupling has a problem(a posting was just deleted? eevblog ghosts)

author: hgg
author_rank: Frequent Contributor
timestamp: May 05, 2016, 11:36:07 am
content: QuoteIs this the oscilloscope's AC coupling capacitor?Can this be solved or is it observed in all oscilloscopes?

author: tautech
author_rank: Super Contributor
timestamp: May 05, 2016, 11:38:49 am
content: Here's 1KHz 1V p-p from a SDG1010, BNC fed (1:1) AC coupled into a brand new SDS1102CML triggering and displayed on Ch 1. Trigger level moved slightly to be visible.Same as yoursBased on Hero's comments it does seem normal based on 50% DCObviously basic stuff that I've never encountered before.Off to check with another.....

author: JPortici
author_rank: Super Contributor
timestamp: May 05, 2016, 11:39:13 am
content: when you high-pass filter or AC-couple a waveform you remove the DC component of the signal and something above it until the cutoff frequency.This is a periodic waveform so the DC value is its mean value (which in the case of a pulse wave it depends also on the duty cycle).high pass filter -> the mean value is zero -> the waveform can no longer be centered around +/- .5V or its mean value wouldn't be zero.this is not a problem, it's math, it's how the universe works.

author: Zero999
author_rank: Super Contributor
timestamp: May 05, 2016, 11:43:09 am
content: Quote from: hgg on May 05, 2016, 11:29:49 amWell 1pF may be a bit too small.When the duty cycle is nearly 100%, the AC coupling capacitor charges up to 1V and it's in series with the 'scope input so you see the signal, -1V.When the duty cycle is near 0%, the AC coupling capacitor charges to -1V so you see the signal +1V.Quote from: hgg on May 05, 2016, 11:36:07 amIt's perfectly normal and can be seen in any AC coupled signal.

author: hgg
author_rank: Frequent Contributor
timestamp: May 05, 2016, 11:47:17 am
content: You are right.Can the scope display this offset as a live parameter?

author: hgg
author_rank: Frequent Contributor
timestamp: May 05, 2016, 11:58:20 am
content: Correction:"I just did what Hero999 suggested and when I connect a 1pF capacitor in line with the signaland with DC coupling, I get the same result.with the AC coupling"

author: hgg
author_rank: Frequent Contributor
timestamp: May 05, 2016, 12:11:43 pm
content: I can measure the DC offset with the multimeter, which shows -478mV when at %1 and +478mV when at %99duty cycle.I was wondering if there is a way to display the same offset on the scope.

author: hgg
author_rank: Frequent Contributor
timestamp: May 05, 2016, 12:29:20 pm
content: I searched the Siglent SDS1102CML and I could not find any built in parameter to show that offset.Anyway, I've just upgraded to the latest firmware and I was looking for changes.Thanks for the help!George.

author: Zero999
author_rank: Super Contributor
timestamp: May 05, 2016, 12:36:02 pm
content: I doubt you'll be able to find an oscilloscope which can measure the DC offset because the AC coupling capacitor is before the ADC.The easiest way is to just use a multimeter.

author: macboy
author_rank: Super Contributor
timestamp: May 05, 2016, 12:49:37 pm
content: The signal is no longer centered because it is no longer symmetric. The AC coupling doesn't somehow look at peak voltages and choose a position based on them. It is much simpler, it removes the DC component. A square wave with amplitude of +/- 1 V (i.e. 2 Vpp) with 80% duty cycle has a DC component of 0.6 V. Imagine adding an offset of -0.6 V to that square wave and it will appear exactly in the same position as when you AC couple. Another intuitive way to think about it is that using AC coupling ensures that the area under the waveform is equal for positive and for negative portions of the waveform, illustrated like:

author: PA0PBZ
author_rank: Super Contributor
timestamp: May 05, 2016, 12:50:14 pm
content: Quote from: Hero999 on May 05, 2016, 12:36:02 pmFirst I was thinking the same but since the scope knows the capacitor value, the frequency and the duty cycle (waveform), I wonder if it could calculate the offset.QuoteNo doubt about that.

author: tautech
author_rank: Super Contributor
timestamp: May 05, 2016, 12:52:15 pm
content: Quote from: hgg on May 05, 2016, 12:29:20 pmMy screenshots were with the latest FW.....forgot to mention that.

author: macboy
author_rank: Super Contributor
timestamp: May 05, 2016, 12:57:30 pm
content: Quote from: hgg on May 05, 2016, 12:11:43 pmDisplayaverage voltage, withDC coupledinput.

author: hgg
author_rank: Frequent Contributor
timestamp: May 05, 2016, 01:04:40 pm
content: Yep, you are right! Thanks.

author: Zero999
author_rank: Super Contributor
timestamp: May 05, 2016, 01:11:28 pm
content: Quote from: macboy on May 05, 2016, 12:57:30 pmYes, that will work but there is no way to get both simultaneously, without using two channels to monitor the same signal.

author: dmills
author_rank: Super Contributor
timestamp: May 05, 2016, 02:08:37 pm
content: An interesting observation is that over a cycle and once things have settled down, you will find that the area under the trace where the trace is above zero is equal to the area under (over!) the trace when the trace is below zero!this is because the integral of voltage over a cycle is equal to the DC level, and your AC coupling removes the DC, so the areas above and below the line must become equal.This is entirely to be expected, and has been the case for AC coupled circuits since the things were invented.Regards, Dan.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: May 06, 2016, 04:38:41 am
content: Quote from: dmills on May 05, 2016, 02:08:37 pmExactly. Another way of looking at it is that the AC-coupling setting moves the _average_ value of the signal up (or down) to the channel's baseline (0 voltage) reference level.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: May 06, 2016, 04:51:56 am
content: Quote from: hgg on May 05, 2016, 11:29:49 amActually Hero suggested using a 1nFcapacitor, a thousand times more capacitance than your 1pFcap. Since the probe's capacitance all by itself is likely in the 30 pF range... I am suspecting a typo in your capacitor value.Even 1 nF is probably smaller than the actual AC-coupling capacitor in your scope. One scope (analog) that I can easily get to uses 22 nF, another (digital) uses 47 nF.Your AC coupling is doing exactly what it is supposed to do.(I think confusion over the use and function of AC and DC coupling is probably the most misunderstood aspect of basic scoposcopy. So don't feel too badly, every scope user probably goes through this stage in the beginning.)

author: hgg
author_rank: Frequent Contributor
timestamp: May 06, 2016, 04:55:56 am
content: Indeed, 1pF was a typo...

author: vk6zgo
author_rank: Super Contributor
timestamp: May 06, 2016, 09:25:32 am
content: Quote from: hgg on May 05, 2016, 10:56:16 amSome generators produce square waves which arenotsymmetrical around zero volts,The signal from these will approximate to zero volts on one half cycle,so you will see one half cycle at (near as dammit) zero volts,& the other half cycle elevated to+or-whatever voltage is set by the generator controls..Go to AC coupling,& the square wave will be displayed symmetrically about zero volts.If you now change the duty cycle of the signal,(incidentally,it is then no longer a square wave,it is a "rectangular wave"),the signal distribution above & below zero volts will change------this is normal.This case is fairly straight forward,but many generators produce a square wave symmetrical about zero volts.In this case,the same thing happens with AC coupling as before,but it can be a bit more difficult to discern.Itisexactly the same process---the AC coupling circuit doesn't really care!