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.

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

Part of the advantages of using dB to express gain or attenuation is that they're inherently logarithmic.

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}$$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.