Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have $2$ formulas (mentioned in this page):

  1. $Z = 2AB$ if both $A<0.5$ and $B<0.5$
  2. $Z = 2(A+B) – 2AB – 1$ otherwise

where $A$ and $B$ are numbers between $0$ and $1$ (including $0$ and $1$) eg: $0$ $0.2$ $0.9$ $0.34$ $1$

Now, I can understand formula $1$ (if $A$ and $B$ are BOTH greater than $0.5$, then $Z$ is $2AB$, right?) What I can't understand is the part from the second formula that reads $2(A+B)$:

Add $A$ with $B$ and then multiply by $2$ : $2\cdot(A+B)$ is this correct or am I missing something?

Any help?

share|cite|improve this question
It says $Z=2AB$ if $A$ and $B$ are both less than $0.5$. – André Nicolas Oct 18 '11 at 7:11
That's correct, my mistake! – LaLeX Oct 18 '11 at 7:12
Side note: the usual solution to mixing audio (and other effects) is to perform intermediate calculations at a greater resolution, then dither on the way back down to the desired output range. For instance, the Pro Tools mix engine uses 48-bit fixed-point arithmetic internally. Multiplying the signals seems... weird. – dls Oct 18 '11 at 15:41

Your description of the evaluation of $2(A+B)$ is correct: first add $A$ and $B$, then multiply by $2$. Since you didn't write why you think you may be missing something there, it's hard to say more about that.

However, your description of the first formula is incorrect. The symbol $<$ denotes the relation "less than", not "greater than".

share|cite|improve this answer
I said that I think I'm missing something because the output audio is not sounding right. There's some attenuation in the first group of samples (A), that are mixed with the second group (B). Also in the fist formula there's 2*AB Is this the same as writing 2(AB) ? – LaLeX Oct 18 '11 at 7:18
I wouldn't spend too much time looking for mistakes in your implementation -- I'd be surprised if this formula leads to sensible audio mixing. The multiplication should lead to artefacts. You speak of attenuation -- it's my understanding of the description that the whole point of this unconventional approach is to attenuate one signal when the other one is present, so I don't think this in itself should be cause for concern. Regarding $2\cdot A\cdot B$: yes, this is equivalent to $2(A\cdot B)$. – joriki Oct 18 '11 at 7:31
@André: I don't understand. Both the question and the page it links to say $Z=2(A+B)-2AB-1$. Where is $Z=2AB-2AB-1$ coming from? – joriki Oct 18 '11 at 7:51
@joriki: Mistyping, of course. – André Nicolas Oct 18 '11 at 13:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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