# Bias headphone audio signal for use with digital potentiometer?

I am attempting to control speaker volume via a digital potentiometer, the problem being that audio signal goes both above and below 0V, for regular potentiometers this is no problem but for digital they cannot handle a signal below ground.

How can I shift the signal up to always be above 0V? I believe this is called biasing, so instead of -2V to 2V it'll be 0V to 4V. I have seen example circuits for this. So for me the more important question is do I have to shift it back down for the speakers to "understand" the signal again?

You can shift it like this if you don't have the center voltage already available:

simulate this circuit – Schematic created using CircuitLab

Or like this if you do:

simulate this circuit

You may recognize it as a highpass filter, which it is. In signal processing, DC (constant offset) is 0Hz, and is considered a frequency just like any other. Set the cutoff frequency well below the lowest point of interest.

As for the speakers, yes, you should offset it back, using the speakers' ground as the center point. You should probably add a buffer amp between the pot and the output, which you can take advantage of as an active highpass filter. This circuit takes that idea one step further by coaxing a linear pot into a somewhat decent log response, which is a little bit better suited for the way we naturally measure volume:

simulate this circuit

It may not be immediately obvious, but I used one of each variation. The input one is almost obvious - I'm using the digipot itself as R2 - and the other can be seen by realizing that the (-) input of the opamp is actively held at the speaker ground, which is the desired center point. Also, by loading the pot with R3 to ground, I can convert a linear response into a semi-log one.

The classic inverting opamp then takes the voltage that appears between C2 and R3 and puts it on the output with a gain of (-R4/R3). This means that you can make R4 variable in order to match the digipot's volume range with the speakers' volume range, which is generally a good idea in my opinion. Once set, it should never be moved again unless you change your setup, so it doesn't need to be anything fancy.

Two things to note:

1. The opamp needs a wide enough power supply to cover the entire +/- voltage range that the speaker can handle, or that you care to give it. It can't go outside of its own supply.
2. Power on/off transients typically go straight through this kind of filter because they're relatively high in frequency content. At this point in time, the cap is charged incorrectly for the required offset and so you might need some kind of over/undervoltage protection between C1 and the digipot and between C2 and the opamp. You can use a pair of zener diodes in reverse series from the signal to the center point if you have it and it's "stiff" enough compared to the supply rails, or you can use a shottkey diode from the signal to each supply rail of the device that it's about to go into.
• This is an awesome answer, i'm still trying to wrap my head around it so i'll post some questions. I'm not so sure how to choose the ? values you provide? When you say v+ or v- are you meaning the range i want to move it into? Because the tricky part is, i have no idea what the actual headphone voltage range is.. I've read articles but they are all below 2v, which i assume means between -2v and 2v. Oct 14, 2014 at 5:10
• Start with the digipot. It probably has a set value already, so you can fill that in. Then choose R1 so that the center point naturally floats at the center point that you want. Then choose C1 given R1||R2 (yes, parallel) to give an RC cutoff frequency that is much less than the lowest bass you want to pass. Add some clamping diodes as in note 2 of my answer, and the first stage is done. Oct 14, 2014 at 14:40
• Choose R3 to be roughly 1/5 to 1/10 of R2 (digipot) for a decent log response (from sound.westhost.com, project01). Then choose C2 for a similar cutoff frequency that you have in the first stage. Then choose R4 to set the output gain, add the clamping diodes again, and the second stage is done. Oct 14, 2014 at 14:45
• For audio signals, there really isn't a set max or min except for the power supplies or excursion limits of the various equipment that it goes through. (one notable exception is 70V distribution to many speakers via individual transformers, but you're not doing that) Higher is louder, but also keep in mind that some headphones/speakers are more sensitive than others. You should set each intermediate volume control so that the entire chain clips at about the same level, then turn things down from there, starting at the end. That gives you the volume you want with minimal noise. Oct 14, 2014 at 15:02
• OK So with the digipot being 10k when you say "the center point naturally floats at the center point that you want". The goal being centerin on 2.5v, i adjust R1 to give this but won't this center point change when the resistance in the digipot changes? Oct 14, 2014 at 19:27

You should. Adding the DC offset will shift the speaker's diaphragm in one direction, limiting the travel of the diaphragm in that direction. In addition, the constant current flow will cause much more heat dissipation, especially at higher volumes.

This link has a decent explanation of this.