Csound Csound-dev Csound-tekno Search About

[Csnd] balance opcode

Date2009-03-16 15:29
FromFederico Vanni
Subject[Csnd] balance opcode
hi list,

i would know the internal operation of the 'balance'
opcode.

It should be something like that:
Take the averages of signals A and B and then divide average B by  
average A.
Multiply the actual A signal by the product of that division. This  
will make A
match the average level of B.

Could you confirm this operation?

many thank
fv



Date2009-03-16 21:10
FromMark Van Peteghem
Subject[Csnd] Re: balance opcode
Federico Vanni wrote:
> i would know the internal operation of the 'balance'
> opcode.
>
> It should be something like that:
> Take the averages of signals A and B and then divide average B by 
> average A.
> Multiply the actual A signal by the product of that division. This 
> will make A
> match the average level of B. 

Correct, except that it's not a simple average, but probably the square 
root of the average of the square of the signals, or the average of the 
absolute value of the signal, because the average can be zero or close 
to zero, and therefore not representative for the power in the signal.

-- 
  Mark
  _________________________________________
  When you get lemons, you make lemonade.
  When you get hardware, you make software.