I am writing a synthesizer. One part of the synthesizer specification says that different sources can specify an attenuation to be applied to a signal, and that these attenuations should be summed.

The attenuations are specified in cB and are given as positive values. An attenuation of 0cB means no attenuation.

The naive approach, which I've tried, would be:

$$x_{total} = 20 \log_{10}\left( \sum 10^{\frac{x}{20}}\right)$$

for each $$x$$ as the attenuation (converted to dB) being summed.

This has problems, since if I add two 0cB attenuations (i.e. no attenuation, twice), I get a total attenuation of 60.2cB. This is obviously not what I want.

How can I add my attenuations to get a sensible result out the other side? Thank you.

• I assume that a 'cB' is a centi-bel, i.e., 1/10th of a decibel? – TimWescott Sep 1 '20 at 17:05
• @TimWescott Correct – jumbot Sep 1 '20 at 17:10
• If so then your factors of 20 above should be factors of 200. I'm answering your question assuming dB. – TimWescott Sep 1 '20 at 17:12
• sorry, I mentioned in the question that I am converting my centibels to decibels before I use them in that formula. – jumbot Sep 1 '20 at 17:16

So if you're speaking in dB, when you add a 10dB attenuation to another 10dB of attenuation, what you're saying is that you're multiplying the signal by $$\sqrt{0.1}$$, and then by $$\sqrt{0.1}$$ again. The result is 20dB of attenuation -- or multiplying the signal by $$\sqrt{0.01} = 0.1$$.
So if your ultimate gain is $$A$$, as a normal number, and you have attenuations $$a_1, a_2, \cdots$$ in dB, then the actual $$A$$ by which you multiply your signal is $$A = 10^{-\frac{1}{20}\sum a_n}$$