Author Topic: Calculating DC offset  (Read 7248 times)

0 Members and 2 Guests are viewing this topic.

Offline RibsterTopic starter

  • Frequent Contributor
  • **
  • Posts: 250
  • Country: be
  • Electronics prototyper. Design. Prototype. Consult
    • Ash Labs
Calculating DC offset
« on: October 15, 2015, 09:41:26 am »
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/
www.ashlabs.be
Design and manufacturing of embedded hard- and software
 

Offline DimitriP

  • Super Contributor
  • ***
  • Posts: 1360
  • Country: us
  • "Best practices" are best not practiced.© Dimitri
Re: Calculating DC offset
« Reply #1 on: October 15, 2015, 10:07:28 am »
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.




   If three 100  Ohm resistors are connected in parallel, and in series with a 200 Ohm resistor, how many resistors do you have? 
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: Calculating DC offset
« Reply #2 on: October 15, 2015, 10:15:45 am »
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.
 

Offline RibsterTopic starter

  • Frequent Contributor
  • **
  • Posts: 250
  • Country: be
  • Electronics prototyper. Design. Prototype. Consult
    • Ash Labs
Re: Calculating DC offset
« Reply #3 on: October 15, 2015, 10:18:45 am »
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.

Yes, momentarily i am working with ~328mV of DC offset

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.

That's actually not a bad idea. The average IS in fact the DC offset. Thanks!
www.ashlabs.be
Design and manufacturing of embedded hard- and software
 

Offline tron9000

  • Frequent Contributor
  • **
  • Posts: 423
  • Country: gb
  • Still an Electronics Lab Tech
    • My Hack-a-day project page
Re: Calculating DC offset
« Reply #4 on: October 15, 2015, 10:26:40 am »
was about to say: surely the average of a sine wave about 0 is 0, so the average of a sine wave about a0 is a0?
Partsbox.io - orangise your parts!
"If you're green you can only ripen. If you're ripe you can only rot!"
 

Offline RibsterTopic starter

  • Frequent Contributor
  • **
  • Posts: 250
  • Country: be
  • Electronics prototyper. Design. Prototype. Consult
    • Ash Labs
Re: Calculating DC offset
« Reply #5 on: October 15, 2015, 11:30:17 am »
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!
www.ashlabs.be
Design and manufacturing of embedded hard- and software
 

Offline RibsterTopic starter

  • Frequent Contributor
  • **
  • Posts: 250
  • Country: be
  • Electronics prototyper. Design. Prototype. Consult
    • Ash Labs
Re: Calculating DC offset
« Reply #6 on: October 15, 2015, 07:39:57 pm »
Finished the design, and it is working!
Yay!
www.ashlabs.be
Design and manufacturing of embedded hard- and software
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3639
  • Country: us
  • If you want more money, be more valuable.
Re: Calculating DC offset
« Reply #7 on: October 15, 2015, 07:44:29 pm »
Did you make the PCB? The construction looks great - clean.
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline RibsterTopic starter

  • Frequent Contributor
  • **
  • Posts: 250
  • Country: be
  • Electronics prototyper. Design. Prototype. Consult
    • Ash Labs
Re: Calculating DC offset
« Reply #8 on: October 15, 2015, 07:45:28 pm »
Did you make the PCB? The construction looks great - clean.

Yup, etched it at home today.
Ah well thank you :)
www.ashlabs.be
Design and manufacturing of embedded hard- and software
 

Offline tron9000

  • Frequent Contributor
  • **
  • Posts: 423
  • Country: gb
  • Still an Electronics Lab Tech
    • My Hack-a-day project page
Re: Calculating DC offset
« Reply #9 on: October 16, 2015, 11:57:33 am »
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.
Partsbox.io - orangise your parts!
"If you're green you can only ripen. If you're ripe you can only rot!"
 

Offline RibsterTopic starter

  • Frequent Contributor
  • **
  • Posts: 250
  • Country: be
  • Electronics prototyper. Design. Prototype. Consult
    • Ash Labs
Re: Calculating DC offset
« Reply #10 on: October 16, 2015, 07:00:27 pm »
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.
www.ashlabs.be
Design and manufacturing of embedded hard- and software
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf