Go Down

Topic: Sound gets distored when going thru digital pot (Read 5802 times) previous topic - next topic

bratan

Jan 25, 2014, 10:39 pm Last Edit: Jan 26, 2014, 01:09 am by bratan Reason: 1
I've build remote volume control box that changes volume of the line signal passing thru it with help of MCP4241 10K digital pot. Everything seems great when source of audio was my TiVo, however when I connected Xbox 360 I noticed that something is very wrong with sound. Anything that has bass in it sounds very distorted (like speakers were ripped)... This especially clear during explosions...  Is this the nature of digital pots or I'm doing something wrong?  Can I add some components before or after pot to  fix this issue?
I'm attaching schematic, but it's pretty basic...

Edit: I think this is clipping :(
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, etc.

tmd3

Intuitively, I suspect that the digital potentiometer requires that its inputs be between VSS and VDD, while the input signal is bipolar.  When the input signal is lower than VSS, the IC is outside its operating range, and it responds in some non-linear fashion.  I think you hear it most in bassy passages because the bass signal is usually very large compared to higher-frequencies, and the voltage gets further below VSS.

That view is bolstered by this line in the datasheet, found here - http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en531709, page 5, "AC/DC Characteristics:"
Quote
Resistor Terminal Input Voltage Range (Terminals A, B and W)  Min: VSS  Max:VDD
.
To fix it, you'll have to offset the input signals.  Depending on how your amplifier is coupled, you might have to shift the output signals back to bipolar.

bratan


To fix it, you'll have to offset the input signals.  Depending on how your amplifier is coupled, you might have to shift the output signals back to bipolar.

Thank you so much!  But how do I offset input signal? Add a voltage divider?
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, etc.

CrossRoads

Yes, feed the signal thru a capacitor, to the junction of two 100K resistors between 5V and GND, so the junction sits at 2.5V going into the pot.
Then feed the pot output thru a cap again to the amplifier.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bratan


Yes, feed the signal thru a capacitor, to the junction of two 100K resistors between 5V and GND, so the junction sits at 2.5V going into the pot.
Then feed the pot output thru a cap again to the amplifier.

Awesome! So this is whats called bias offset right?  Do I need voltage divider on the output as well or just the cap?  Would 10uF cap be ok?
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, etc.

CrossRoads

Just a cap on the output to remove the DC offset.
10uF should be good. Experiment, see what sounds good.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bratan

Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, etc.

CrossRoads

C2-R6-R7 not wired correctly.
Polarity of C3/C4 are not wired the same.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bratan


C2-R6-R7 not wired correctly.
Polarity of C3/C4 are not wired the same.


Ahhh my bad!
How about now? :)
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, etc.

CrossRoads

I think you have all the polarized caps backwards; I think you want + connected to the source.
Definitely  + to the VDD pin, altho 0.1uF ceramic caps are not generally polarized.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bratan

Yeah decoupling C5 is not polarized... I'm confused about polarized tho. I see I have C1 and C2 incorrect, current flows from R/L-in to the IC, but not sure about C3, C4...
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, etc.

tmd3

Maybe I'm missing something, but I see a problem with the voltage divider used for input voltage offset in this design.

Here's my take on the voltage divider:  The digital potentiometer's internal resistor - 10K, from the original post - is in parallel with the lower half of the voltage divider.  That makes the divider's DC voltage a lot lower than half of VDD, since the upper resistor is 100K, and the lower resistor figures to be about 9.1K.  That'll be OK as long as the input signal amplitude doesn't go above about .42V peak-to-ground.  If the signal gets bigger than that, the input to the digital potentiometer will be below VSS, outside the operating range.

I think that 10K connected between VDD and the input to the digital potentiometer, and no resistor connected between the potentiometer input and ground, will give a DC voltage of 2.5V.

CrossRoads

Hmm, yeah, I was thinking about the pot as an active device, like an op amp.
How about if the line level is just ac coupled thru the pot then? Does it even need to be offset?

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

tmd3

The part requires that the voltage on all three potentiometer pins be between VSS and VDD.  I see the voltage on the upper connection to the potentiometer going negative; it the potentiometer were linear under those conditions, the wiper would be negative, too.

I like the circuit in the revised schematic, attached.

CrossRoads

That's what I drew up originally, but I waffled and couldn't decide how to derive the output.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up