Calculating DC offset - Page 1
Forum section: electronics / projects

author: Ribster
author_rank: Frequent Contributor
timestamp: October 15, 2015, 09:41:26 am
content: I am designing a stage behind an AD9834.This is a DDS where the DAC has a differential current output.Because i want to amplify this sine wave to ~3v3, i need to use some opamps.I am using LTSpice to model this, so i need to know the signals of the DAC.So i made my own board and measured the sine waves that are coming out of the DAC.When i measured the outputs, i get the waveforms on my scope.These are shifted 180 degrees, as it should be. With the yellow one being 568mVpp.I want to know the DC offset of this waveform, so i can use it in my SPICE voltage.I tried calculating the DC offset from the RMS voltage, but the formula's don' t add up.I've used the below theory to calculate it.And idea how i can extrapolate the DC offset from this sine wave ?http://masteringelectronicsdesign.com/how-to-derive-the-rms-value-of-a-sine-wave-with-a-dc-offset/

author: DimitriP
author_rank: Super Contributor
timestamp: October 15, 2015, 10:07:28 am
content: I don't know about extra polating but from your picture it looks like the yellow and light blue traces are riding on (about ) 300mV DC volts.

author: rs20
author_rank: Super Contributor
timestamp: October 15, 2015, 10:15:45 am
content: Just measure the average? "DC offset" isn't as well-defined as you might think it is, it's just the signal you add on to your AC signal to get the complete signal. Since a sinewave (or any AC signal) has an average of 0, the average of a DC offset sine wave is just the DC offset. So just measure the average, and that's the DC offset.

author: Ribster
author_rank: Frequent Contributor
timestamp: October 15, 2015, 10:18:45 am
content: Quote from: DimitriP on October 15, 2015, 10:07:28 amYes, momentarily i am working with ~328mV of DC offsetQuote from: rs20 on October 15, 2015, 10:15:45 amThat's actually not a bad idea. The average IS in fact the DC offset. Thanks!

author: tron9000
author_rank: Frequent Contributor
timestamp: October 15, 2015, 10:26:40 am
content: was about to say: surely the average of a sine wave about 0 is 0, so the average of a sine wave about a0is a0?

author: Ribster
author_rank: Frequent Contributor
timestamp: October 15, 2015, 11:30:17 am
content: Yep, given that the sine is symmetrical..Ah well, i hope my dc offset is good enough...Here you have my completed setup, while testing an RC filter...Time to design the PCB and test the shit out of it!

author: Ribster
author_rank: Frequent Contributor
timestamp: October 15, 2015, 07:39:57 pm
content: Finished the design, and it is working!Yay!

author: rx8pilot
author_rank: Super Contributor
timestamp: October 15, 2015, 07:44:29 pm
content: Did you make the PCB? The construction looks great - clean.

author: Ribster
author_rank: Frequent Contributor
timestamp: October 15, 2015, 07:45:28 pm
content: Quote from: rx8pilot on October 15, 2015, 07:44:29 pmYup, etched it at home today.Ah well thank you

author: tron9000
author_rank: Frequent Contributor
timestamp: October 16, 2015, 11:57:33 am
content: seconded on that! that's pretty good for a home-brew!back to working out the offset, I'm guessing you'd have to find a "zero crossing" in order to work out the average of a sine wave accurately? For fast signals this would be easy as the average of the first period would make little impact on the following one's.But for a very slow signal, it would take much more time wouldn't it? Hence the crossing detection.

author: Ribster
author_rank: Frequent Contributor
timestamp: October 16, 2015, 07:00:27 pm
content: Well, it actually worked out by eyeballing the offset.I needed it for my spice model to simulate my differential amplifier.Since the widget is working, the simulation is no longer needed.Going for some testing on the spectrum analyzer at school soon.One thing that is still bugging me is my ADC section.I've got a sine wave centered around half the VCC.I need to find a way to convert the Vpp of the sine wave to full scale deflection on the ADC.So if the amplitude of my sine is 0, i need to read 0V and 3V3 on sine wave needs to be 2^10.