|
Components and Circuits For discussions about component types, alternatives and availability, circuit configurations and modifications etc. Discussions here should be of a general nature and not about specific sets. |
|
Thread Tools |
27th Jun 2019, 11:49 am | #1 |
Dekatron
Join Date: Jul 2009
Location: Sleaford, Lincs. UK.
Posts: 7,667
|
Attenuator calculations.
I'm trying to calculate resistor values for a 100k logarithmic attenuator in a preamp that uses a 2 x 50 pole SW, and it's bending my mind. If average line level is 0.3v say and I want my final OP to be 6v max then an attenuator of 26dB is needed right or is it?
If I make a ladder attenuator then I need to calculate R values for 50 potential dividers each with a gain of 0.52dB ( I think) but how do I figure out R values from here? Andy.
__________________
Curiosity hasn't killed this cat...so far. |
27th Jun 2019, 12:09 pm | #2 |
Nonode
Join Date: Aug 2010
Location: Resolven, Wales; and Bristol, England
Posts: 2,613
|
Re: Attenuator calculations.
There's a calculator here: http://rssconsultancy.co.uk/atten.html
__________________
Richard Index: recursive loop: see recursive loop |
27th Jun 2019, 1:09 pm | #3 |
Dekatron
Join Date: Jul 2009
Location: Sleaford, Lincs. UK.
Posts: 7,667
|
Re: Attenuator calculations.
Thanks Richard saw that before on a previous search but it's for a shunt attenuator and only 24 steps so I'll need to calculate by "hand", just not sure how to go about it and if my assumptions are correct, EG 26dB etc.
Andy.
__________________
Curiosity hasn't killed this cat...so far. |
27th Jun 2019, 3:35 pm | #4 |
Moderator
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,901
|
Re: Attenuator calculations.
Step number 1
Decide what 'law' you want I'm guessing it's a volume control, so the ideal would be x decibels per step and then a bottom step onto silence (infinite attenuation) If this guess is so, then your 50 way switch has the full input signal on the top stud, and ground on the bottom stud with a resistor between each pair between these extremes. The wiper rotates down tappings of a series string of resistors. 2 parameters are needed How many dB per step? What total resistance? David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done |
27th Jun 2019, 5:04 pm | #5 |
Nonode
Join Date: Jan 2009
Location: Bristol, UK.
Posts: 2,062
|
Re: Attenuator calculations.
For a preamp you'll need (sticks finger in the air) at least 60db of attenuation range from drowning out the sound of the police hammering on the door to a quiet whisper!
It's easy enough to do the experiment to see how much that is, set your system to the maximum volume you use then slap in a 60db attenuator. Do you need more range or is that enough ? My guess is that 50 steps is not really enough, as the steps are such that you can't really get it to the volume you want - too loud or too quiet. Or maybe thats just me dc Last edited by dave cox; 27th Jun 2019 at 5:05 pm. Reason: sp |
27th Jun 2019, 5:40 pm | #6 |
Moderator
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,901
|
Re: Attenuator calculations.
The preamp in my lounge has an active gain control with a silver-stud fader and metal film resistors done in a law of constant dB per step, suitably calculated for the active circuit.
I get about 1.25dB per step without any problems. Fine enough steps and it goes down far enough. (The power amps can do 200W/channel) 50 studs is 49 increments. 1dB/step would not give enough range. 1.5 would give plenty of range and not be intrusively big. With designing your own pot, you can compensate the law for the load inopedance if you want. But ignoring load, say for a 10k pot then the first step down is to 84.135% of the voltage so we need (100-84.1395)% of 10k as the top resistor = 1.5860k So that leaves us 10k - 1.5860k = 8,41395k for the rest of the string. so another 1.5dB down needs the next resistor in the string to be (100-84.1395)% of 8.1395k = 1.2893k So we are now a total of 1.5860k + 1.28937k = 2.87537k down from the top and the remainder is 7.124622k so for the next resistor we take (100-84.1395)%of that remainder Just keep going til you've had enough. Use a spreadsheet. The arithmetic will be done to enough precision so just forget cumulative errors. Calculate the whole lot. DO NOT PICK PREFERRED VALUES ALONG THE WAY - do that right at the end. Voila! David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done |
28th Jun 2019, 8:43 am | #7 |
Dekatron
Join Date: Jul 2009
Location: Sleaford, Lincs. UK.
Posts: 7,667
|
Re: Attenuator calculations.
Pot R = 100k? ( see 2nd para) , log law and if the first step is infinity and the last wide open (0dB) that leaves 48 steps, if 60dB (which is what I first calculated it to be) giving 1.25dB a step, however that would be linear law.
The attenuator will go after the line stage, followed by a cathode follower which would have a Z in around 9.4M (470k grid leak/ (1-gain), to be honest 100k was a guess. For log law the calculator Richard linked to has a calculator for a shunt and gives the dB steps as below, see attached, but this is for more than 60dB, however it looks like step 3 - 7 are 3dB, steps 8 - 26 are 2dB, steps 27 to 48 are 1dB. What step 2 is, is tricky to guess as total dB attenuation isn't given. I've no idea if this correct though, I looked online where there are several calculators for attenuators but none for my specific application. So given those figures what formula do I use to turn dB into R1&2 of each divider?? "then the first step down is to 84.135% of the voltage" how do you get 84.135% David from 1.5 dB? I suppose I need to turn dB into a ratio like 2:1 or whatever, maths not being my strong point am at a loss as to how to start. Andy.
__________________
Curiosity hasn't killed this cat...so far. |
28th Jun 2019, 11:20 am | #8 |
Dekatron
Join Date: Apr 2011
Location: Cornwall, UK.
Posts: 13,454
|
Re: Attenuator calculations.
If it's any use:
https://www.dhtrob.com/zelfbouw/pdf/...tapp_schak.pdf The article in Hifi World Dec. 1998 (supplement) mentioned in the above can be found in links given on this site: http://www.audiodesignguide.com/doc/index1.html Lawrence. |
30th Jun 2019, 7:01 am | #9 |
Dekatron
Join Date: Jul 2009
Location: Sleaford, Lincs. UK.
Posts: 7,667
|
Re: Attenuator calculations.
Thanks Lawrence, good articles, ones I'd not seen in my search for info.
Andy.
__________________
Curiosity hasn't killed this cat...so far. |
30th Jun 2019, 11:19 am | #10 | ||
Rest in Peace
Join Date: Apr 2008
Location: London, UK.
Posts: 2,508
|
Re: Attenuator calculations.
Quote:
On a linear control each step subtracts the same fraction of the total level, i.e. they follow an arithmetic series (e.g. 0.9, 0.8, 0.7, 0.6...). On a log control each step attenuates the level by the same ratio, i.e. they follow a geometric series (e.g. 0.5, 0.25, 0.125, 0.0625...). A control with steps of differing ratios, such as you mention above with between 1 & 3 dB per step, has a log law modified to give some desired improvement in the useful control range. The differing dB per step is not what makes it a log law! Quote:
You are dealing with signal amplitude rather than power, so gain= 20 log(Vout/Vin) dB or Vout/Vin = exp (gain/20) Your gain is -1.5dB (negative, as it is an attenuator) hence Vout/Vin = exp (-1.5/20) = 0.841 Each 1.5dB step of the control gives 84.1% of the signal level of the step above. |
||
30th Jun 2019, 11:24 am | #11 |
Moderator
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,901
|
Re: Attenuator calculations.
Thanks, Lucien. It looks like we are in close agreement .All that's needed is ten minutes with a pocket calculator and Andy'll have all the calculated resistor values, then it's just a matter of picking the nearest preferred values. Faster with a spreadsheet.
David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done |
30th Jun 2019, 11:47 am | #12 | |
Rest in Peace
Join Date: Apr 2008
Location: London, UK.
Posts: 2,508
|
Re: Attenuator calculations.
Quote:
One more note, re. the overall resistance; it sounds OK in your present situation if your load is really in the order of 10M. Just be aware that if you load down the wiper of a simple pot significantly, the law varies because of the variation in source resistance looking back into the wiper. FWIW this can be used to achieve a useful audio taper from a linear pot if required. A true constant impedance switched attenuator does not have this property; its input and output impedances remain constant at all attenuations. |
|
30th Jun 2019, 7:50 pm | #13 |
Nonode
Join Date: Aug 2010
Location: Resolven, Wales; and Bristol, England
Posts: 2,613
|
Re: Attenuator calculations.
Talking of stepped volume controls, has anyone tried the Chinese 24-step ones at about £15?
__________________
Richard Index: recursive loop: see recursive loop |
30th Jun 2019, 10:41 pm | #14 |
Nonode
Join Date: Jun 2016
Location: Bognor Regis, West Sussex, UK.
Posts: 2,300
|
Re: Attenuator calculations.
I attach an Excel sheet I put together to calculate stepped attenuators.
The value Rt is the value of the "pot" you want to emulate, initial value is 390K, change this to suit. Column B is the dB attenuation desired at each step, log or lin can be simulated (or any other law), you need to decide what attenuation you need at that step Column C & D are the calculated values for Rx - the upper arm of the divider and Ry, the lower, Columns E&F allow you to enter the nearest real world value to that calculated and then Column G calculates the actual attenuation and column I the error from the desired attenuation. The chart plots the error for each step. Not fancy but it works. Peter |
1st Jul 2019, 2:19 pm | #15 | |
Octode
Join Date: Nov 2013
Location: Penrith, Cumbria, UK
Posts: 1,993
|
Re: Attenuator calculations.
Quote:
It's pretty good I think, uses Vishay Dale metal film resistors for low noise, and has the adavantage of only ever having 2 resistors in the circuit at any setting rather than a string of them in series. And 24 steps didnt seem too coarse an adjustment for my needs. The only reason its currently not in my homebrew stuff is that I got lazy and now use an Alps motorised pot as a volume control. The only sonic advantage as far as I am concerned is the near perfect channel balance compared with your average carbon track pot, although again the RK127 Alps pot isnt a bad one in that regard and I really can't hear any significant difference. I may of course have cloth ears, it's been 4 years now since my last hearing test since I retired, but then my lugs were pretty good, the printout used to come with an "Age" of my ears and it was gratifing to know i had the ears of a 23 year old especially as the rest of me now well into my 60s seems top be falling apart! It can be a bit of a b*gger too as the faint whine of a SMPS can get really irritating to me at times. A. |
|
2nd Jul 2019, 11:21 am | #16 |
Dekatron
Join Date: Jul 2009
Location: Sleaford, Lincs. UK.
Posts: 7,667
|
Re: Attenuator calculations.
"All that's needed is ten minutes with a pocket calculator" Maybe for you David, but I don't know what to put in it. So far I've worked out I want a 100k pot/attenuator, whatever, with a 60dB gain/attenuation. My SW is 50 pole, with pole 1 being infinity, pole 50 being 60dB that leaves 48 steps/poles, so 60/48 = 1.25dB.
I've sussed out 1.25dB = 0.865 in voltage by spending an hour online feeding in random values, so as the pot is going to be of the ladder type that means 50 x potential dividers. Step = R1 100k & R2 0r resistors, Step 2 is what? Well R1 has to be smaller than 100k and R2 has to be bigger than 0r so 100k/0.865 and 0 x 0.865? No obviously. Could someone tell me what formula I need? But please bear in mind I didn't go to college/university, havn't a degree, have never worked in the field, hated maths at school 40 years ago, and either slept or didn't bother going in the end to maths classes. I struggle, like not knowing what exp means in a formula. There are several spreadsheets ( thanks Peter) to calculate R values for attenuators, but for SERIES types,or the wrong number of steps, also I havn't a clue how to use a spreadsheet, despite watching several hour long videos and trying numerous times. There are numerous electronic calculators online too and helpful articles but non for my specific needs or they assume a level of knowledge I don't posses. A.
__________________
Curiosity hasn't killed this cat...so far. |
2nd Jul 2019, 12:41 pm | #17 |
Rest in Peace
Join Date: Apr 2008
Location: London, UK.
Posts: 2,508
|
Re: Attenuator calculations.
If you have 60dB of attenuation at the bottom 'active' step, i.e. the one above zero, then yes there are 48 steps of attenuation each of 1.25dB.
The top step is full signal. The next step is a voltage divider that reduces the signal by 1.25dB. -1.25dB is actually 0.866, so the resistor feeding it needs to drop (1-0.866) = 0.134 of the signal. The remaining 0.866 of the signal appears across the chain of resistors below and hence the output when that step is selected. Start the process off at the top step and work down: Top step: full signal. No resistance above, the total 100k is made up of all the resistors below. For the next step, out of the total 100k: 0.134 x 100k = 13.4 between this step and the one above. 100k-13.5k = 86.6k below this step in total. Therefore 13.4k is the first resistor, the remaining 86.6k will be made up of all the resistors below. For the next step, out of the remaining 86.5k: 0.134 x 86.6k = 11.6004k between this step and the one above 86.6k-11.6004k = 74.9996k below this step in total Therefore 11.6004k is the second resistor, the remaining 74.9996k will be made up of all the resistors below. For the next step, out of the remaining 74.9996k.... Repeat until you are on the penultimate step. The remaning resistance is the last resistor to the bottom step which is ground, if you want the control to go to zero signal. Don't round the numbers at each step or you will get a cumulative error, just work with all the digits in your display and round / find preferred values at the end. |
2nd Jul 2019, 1:32 pm | #18 |
Moderator
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,901
|
Re: Attenuator calculations.
OK, I've got a pocket calculator out... a nice vintage HP11C
So your total resistor string is to be 100k and you want to go down in 1.25dB steps. 1.25dB is a voltage ratio of 10^(-1.25/20) = 0.86596 So here's the first tap down your 100k string (1-0.86596) x 100k = 13.40k and it leaves 0.86596 x 100k = 86.594k for the total of the remainder of the string. Second tap is 0.86596 of the way up to the tap above (not to the top of it all) to get the further 1.25dB that's needed So the resistor between 1st and second taps is (1-0.86596) x 86.596k = 11.607k and it leaves 0.86596 x 86.596k = 74.9886k for the total of the remainder of the string. Do you begin to see the pattern? Each successive step is a times 0.86596 attenuation from the step before, but the resistors aren't equal because the steps before have eaten up some of the 100k budget for the whole. Hey, each remainder is 0.86596 of the previous remainder so the tapping points have the following totals to ground: 100k (the top) 86.596k 74.989k 64.937k 56.234k 48.696k 42.169k 36.517k 31.622k 27.384k 23.713k 20.535k 17.782k 15.399k 13.335k 11.547k 10.000k 8.6596k Hey, look, we hit 10k dead on. So from here on it's a repeat of the top lot but 1/10th the size. Now these are the values of the total remainders at each tap. So you just look at the difference in values to get the resistor value to go between each pair of taps. Do all the calculations to more decimal places than you'll ever need, and then pick the nearest preferred values. Easier now? I really don't want to compute the final values for you cos you'll just use them and forget where they came from. I want you to see some of the scenery along the way. You only need the x and - buttons on your calculator ! David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done |
2nd Jul 2019, 1:33 pm | #19 |
Moderator
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,901
|
Re: Attenuator calculations.
Ayup, we're agreeing again! I went out for lunch, that's my excuse.
David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done |
2nd Jul 2019, 4:57 pm | #20 |
Nonode
Join Date: Jun 2016
Location: Bognor Regis, West Sussex, UK.
Posts: 2,300
|
Re: Attenuator calculations.
Hi David,
I used my spread sheet to calculate the 50 step 60dB attenuator you specified. The resistor values are as calculated, you will have to select the nearest value resistor (or combination of resistors) Peter |