Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Can offset voltage be added?

Status
Not open for further replies.

bananasiong

New Member
Hi,
Is there any way to add DC offset voltage to the analog signal?
Since audio signal goes +ve and -ve, if I use a PIC to do sampling, the -ve cycle will be read as 0. I just found that the reference voltage low (VrefL) for some PIC is 2 V minimum, and Vss-0.3 V for some PIC. That is not enough for the audio signal, let's say it swings from 1 V to -1 V.
Is there any solution besides using external A/D device that allow -ve cycle?

Thanks
 
Hi Banana,
Capacitor-couple the audio signal to a input that has a DC offset. Then it swings above and below the offset voltage.
 
audioguru said:
Hi Banana,
Capacitor-couple the audio signal to a input that has a DC offset. Then it swings above and below the offset voltage.
Thanks!!
Is that what you mean? It looks okay in LTSpice.
How about the -ve offset? I need to shift back to the original position at the other end of the output. Same method and the supply voltage inverted?
 

Attachments

  • audio offset.GIF
    audio offset.GIF
    2.9 KB · Views: 658
THe capacitor needs to be much larger (hundreds of microfarads perhaps, 100uF, 200uF, or 470uF would probably work) and you want only the left capacitor, not the right one. THe right capacitor would just remove the DC offset that you just added (in the same way the left capacitor stops the DC from feeding back into the audio source).

I would also think you could increase the resistors (maybe by a factor of two) to reduce the load the audio source has to drive.
 
Last edited:
As dknguyen mentioned, the cap may have to be larger. It depends on how low of a frequency you want to couple. Notice how I placed the DC offset into the PIC at 2.5V. This will allow you to take advantage of the full dynamic range of the ADC and avoid clipping if the input waveform goes above 2Vpk-pk:
 

Attachments

  • audio offset.GIF
    audio offset.GIF
    4.2 KB · Views: 322
Last edited:
Yes, I got it. With my original circuit, the output is the same as input. What I want is before the output coupling cap.
Thanks everyone.
If the signal frequency is as low as 20 Hz, the the capacitor value will be..? How much reactance should the capacitor be?
 
The output is down -3dB (half power) when the reactance of the capacitor is equal to its load resistance. So your 0.1uF capacitor feeding 1k and 4k resistors has a -3dB frequency of 2kHz. Like a tweeter.

The 0.1uF capacitor feeding two 10k resistors has a -3dB frequency of 320hz. No bass.

You also must look at the input impedance of the ADC which is in parallel with the two resistors.
 
Just quick read the datasheet of the PIC under electrical characteristics. The recommended input impedance of ADC is 2.5 k:eek:hm:
So I can use 3.3 uF capacitor to feed two 5 k:eek:hm: resistors to allow the signal as low as 20 Hz at -3 dB and above?
 
Another question, with the load of 8:eek:hm: (speaker), to allow 20 Hz of low frequency, 1000 uF coupling capacitor is needed right? That is usually electrolytic type, how about the connection polarity?

Thanks
 
bananasiong said:
Another question, with the load of 8:eek:hm: (speaker), to allow 20 Hz of low frequency, 1000 uF coupling capacitor is needed right? That is usually electrolytic type, how about the connection polarity?
If you don't want very deep bass then a 1000uF capacitor feeding an 8 ohm speaker will reduce 20Hz to half power and will reduce frequencies up to about 100 Hz noticably.
If there is DC at the output of the amplifier then the polarity of the capacitor is obvious. If the amplifier has a dual polarity supply or is bridged then a coupling capacitor is not needed.
 
Am I right that with a 1000 uF capacitor feeding an 8 :eek:hm: speaker at 100 Hz, the output down to -0.167?
If I don't want to have much loss at low frequency, then I should use higher value of capacitor.
With a 10,000 uF capacitor, the output power loss is only 0.5 % (-0.0432 dB).
Can I know how much loss is allowed (either in dB or the modulus of the transfer function) if the signal at the frequency is wanted?

Thanks
 
Hi Banana,
-3dB (half-power) is not much loss to the ears. Most people don't notice a loss of -1dB.
An FM radio station must not have a loss of more than -3dB at 50hz but I think some go flat down to 20Hz.
 
Thanks audioguru. Then I will stick with -3 dB as my lowest reference at 20 Hz.
For the audio amplifier IC such as LM386, the input resistance is 50 k:eek:hm:, with the potential meter of 10 k:eek:hm:, the total input resistance has the approximate range from 880 :eek:hm: to 2380 :eek:hm:. Then the input coupling capacitor will be around 9 uF. Am I right to consider both of the resistance?
 
bananasiong said:
For the audio amplifier IC such as LM386, the input resistance is 50 k:eek:hm:, with the potential meter of 10 k:eek:hm:, the total input resistance has the approximate range from 880 :eek:hm: to 2380 :eek:hm:. Then the input coupling capacitor will be around 9 uF. Am I right to consider both of the resistance?
No, your math is wrong.
When the volume control is max then the total input resistance is 10k in parallel with 50k= 8.3k and whan the volume control is zero then the input resistance is 10k.

For a cutoff frequency of 20Hz when the volume control is max then the coupling capacitor is 1uF.
 
Oh right, the potentiometer attenuate the signal but not giving any offset like the previous case. But why when the volume control is zero then the input resistance is 10 k? 0||50 k:eek:hm: right?
 
When the volume control is at zero then the source sees only the 10k volume control, not the input resistance of the amplifier.
 
Hi,
That is because of 10 k:eek:hm: + 0 || 50 k:eek:hm:?

BTW, I just see the waveform of the digital oscilloscope from the output of my MP3 player, but the waveform appeared only on the positive cycle. Shouldn't it be swinging up and down the 0 V?
 
I don't know if your digital oscilloscope can show negative voltages the same as a normal 'scope.
 
Yes it can. I've seen my senior using it for audio signal too. Maybe because I used the autoset function.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top