Looking for someone smarter than me to verify a voltage divider related equation.

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Sam0311

Well-known member
Joined
Jun 29, 2022
Messages
66
Location
Brighton
For a bit of fun I’ve been putting together a spreadsheet that contains different formulas I might find useful when designing an Audio Power Amp circuit.

The output for the application I had in mind is fairly low (3-5W with 8ohm load). Some of the ICs suited for this have quite a large minimum gain (20-34db). If the input voltage was line level (+4dbu or 1.228 Vrms) I would need to attenuate the voltage before amplifying it to get the desired output. I would also like control over the input volume.

I was trying to work out how I might approach this, I thought it would work if instead of having a voltage divider then a potentiometer I could put a resistor in series with the input of the pot to effectively set the minimum attenuation the pot applied?

The equation I’ve used to worked out the value of this resistor is R1 = R2/(((10^(A/20))*R2)+R2)*R2 .

Where R1 = the value of the resistor in series with the pot. R2 = that overall resistance of the pot. And A = the desired attenuation in DB.

Would appreciate if anyone could verify if this is giving me the answer I’m looking for. Seems about right to me. Sorry if this equations is clunky it’s just what I ended up with 😬
 
Quick update on this. After some more testing I found that sometimes my equation returned an answer that was very close to the correct answer and other times it was way off.

I got a couple equations from people on Reddit that seem to work:

R1 = R2 * (10^(db/20) - 1), where db is the amount of attention required expressed as a positive value.

R1 = (R2 / 10^(db/20)) - R2, where the attenuation is expressed as a negative value.

The post can be found here for anyone that’s interested:

 
Well, I'll try a walk-through... The minimum output would be 0V (-inf dB) with the pot wiper at ground.

With the pot wiper at maximum, Vout would be:
Vout = Vin x Rpot /(Rin + Rpot)

Rearranging a bit:
Vout / Vin = Rpot / (Rin + Rpot)

Attenuation (strictly speaking, gain, since it'll be a negative dB value):
dB = 20 log(Rpot / (Rin + Rpot))

dB/20 = log(Rpot/(Rin+Rpot))

10^(dB/20) = Rpot /(Rin+Rpot)

Diddling about to solve for Rin:
10^(dB/20) x (Rin + Rpot) = Rpot

10^(dB/20)Rin + 10^(dB/20)Rpot = Rpot

10^(dB/20)Rin = Rpot - 10^(dB/20)Rpot

Rin= Rpot/10^(dB/20) - Rpot

I did this on the fly, so I'm sure some bright fellow will point out any mistakes along the way...

In practice it'd be simpler to connect another variable resistor for Rin, get the desired attenuation experimentally, then measure the Rin pot value. This would account for Zout of the signal source and Zin of the driven input, which would have complicated the calculation quite a bit, if those numbers were even available. As an engineer once told me "5 minutes in the lab is worth 4 hours with a calculator". 👍
 
Last edited:
If you use the word "attenuation" it shouldn't be expressed in negative dB values, that would be a double negative, kinda like saying "I'm going east to the left". So a negative attenuation is actually gain, just like a negative gain (in dB) is attenuation.

Hence, the correct expressions are:

Vout/Vin = R2/(R1+R2)
Vin/Vout = 1 + R1/R2
Att = 20log|1+R1/R2|
10^(Att/20) -1 = R1/R2

so R2 = R1/[10^(Att/20)-1] or R1 = R2*[10^(Att/20)-1]

In this case, the attenuation (Att) should be expressed as a positive quantity in dB
 
Well, I'll try a walk-through... The minimum output would be 0V (-inf dB) with the pot wiper at ground.

With the pot wiper at maximum, Vout would be:
Vout = Vin x Rpot /(Rin + Rpot)

Rearranging a bit:
Vout / Vin = Rpot / (Rin + Rpot)

Attenuation (strictly speaking, gain, since it'll be a negative dB value):
dB = 20 log(Rpot / (Rin + Rpot))

dB/20 = log(Rpot/(Rin+Rpot))

10^(dB/20) = Rpot /(Rin+Rpot)

Diddling about to solve for Rin:
10^(dB/20) x (Rin + Rpot) = Rpot

10^(dB/20)Rin + 10^(dB/20)Rpot = Rpot

10^(dB/20)Rin = Rpot - 10^(dB/20)Rpot

Rin= Rpot/10^(dB/20) - Rpot

I did this on the fly, so I'm sure some bright fellow will point out any mistakes along the way...

In practice it'd be simpler to connect another variable resistor for Rin, get the desired attenuation experimentally, then measure the Rin pot value. This would account for Zout of the signal source and Zin of the driven input, which would have complicated the calculation quite a bit, if those numbers were even available. As an engineer once told me "5 minutes in the lab is worth 4 hours with a calculator". 👍
If you use the word "attenuation" it shouldn't be expressed in negative dB values, that would be a double negative, kinda like saying "I'm going east to the left". So a negative attenuation is actually gain, just like a negative gain (in dB) is attenuation. You can indeed work with negative gain, but that is impractical for the reasons I just described; it is better to use attenuation in this context.

Hence, the correct expressions are:

Vout/Vin = R2/(R1+R2)
Vin/Vout = 1 + R1/R2
Att = 20log|1+R1/R2|
10^(Att/20) -1 = R1/R2

so R2 = R1/[10^(Att/20)-1] and R1 = R2*[10^(Att/20)-1]

Where the attenuation Att should be expressed as a positive quantity in dB
 
Last edited:

Latest posts

Back
Top