Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ezfit:clarujust:ezfit_optimizer_clarujust_algorithms [2010/01/07 15:34]
smayr
ezfit:clarujust:ezfit_optimizer_clarujust_algorithms [2010/01/08 16:44] (current)
smayr
Line 6: Line 6:
 === Steps ===  === Steps === 
  
-It turns out that the CRs provided by the Ethos API generate nice even gain steps as we increase the CR index. Valid indexes range from 0 to 15, corresponding to CRs going from 1:1 up to 4:1. +It turns out that the CRs provided by the Ethos API generate nice even gain steps as we increase the CR index.  
- +  * Valid indexes range from 0 to 15, corresponding to CRs going from 1:1 up to 4:1. 
-Let's assume a TK of 50dB (index 2 ...which is our default) for these calculations.+  Let's assume a TK of 50dB (index 2 ...which is our default) for these calculations.
  
 ==== Calculate Gain 60 and 80 ====  ==== Calculate Gain 60 and 80 ==== 
Line 14: Line 14:
 Given the Gain for 50 in, we can calculate the gain provided for 60 in as follows: Given the Gain for 50 in, we can calculate the gain provided for 60 in as follows:
 <code csharp>  <code csharp> 
 +//--------------------------------------------
 +// Gain Formulas
 +// X = 60dB Input, or 80dB Input
 +// CRi = Compression Ratio Index
 +// GainX = G50 - (50dB-XdB x 0.05 x CRi);
 +//--------------------------------------------
 G60 = G50 - (10 x 0.05 x CRi); G60 = G50 - (10 x 0.05 x CRi);
 +G80 = G50 - (30 x 0.05 x CRi);
 </code> </code>
-  
-So, G60 (gain for 60 in) is the gain for 50 in (G50) reduced by 10x0.05 multiplied by the CR index (NOT the CR itself). The 10 represents the fact that 60in is 10 dB higher than 50dB, and the 0.05 is a gain factor that results from the nice CR spacings on the Ethos. It really is 0.05 dB/dB, which is 0.05 dB of gain change for each dB in increase in input level. 
  
-Likewise+  * Gain Input: 
 +    * G60 (Gain for 60in): It is the gain for 50 in (G50) reduced by 10x0.05 multiplied by the CR index (NOT the CR itself).  
 +    * G80 (Gain for 60in): It is the gain for 50 in (G50) reduced by 30x0.05 multiplied by the CR index (NOT the CR itself).  
 +  * G50: The G50 values are taken from the BEQx values (i.e. Equalizer parameters) for each channel/band as setup by Autofit. 
 +  * 50dB-XdB Offset: 
 +    * 10: represents the fact that 60in is 10dB higher (louder) than 50dB (50in). 
 +    * 30: The change to 30 x 0.05 is because 80 in is 30dB higher (louder) than 50dB (50in). 
 +  * 0.05 is a gain factor that results from the nice CR spacings on the Ethos. It really is 0.05 dB/dB, which is 0.05 dB of gain change for each dB in increase in input level.
  
-<code csharp> +==== Calculate Equalizers ====  
-G80 G50 - (30 x 0.05 x CRi); + 
-</code> +On Ethos the BEQx index values correspond to 2 dB steps so we need to quantize the gain differences to a 2 dB resolution. Also the BEQx values must be of type integer. This results in the following pseudo code:
-  +
-The change to 30 x 0.05 is because 80 in is 30 dB louder than 50 in. +
-  +
-The G50 values are taken from the BEQx values (i.e. Equalizer parameters) for each channel/band as setup by Autofit. +
-==== Equalizer ====  +
-On Ethos the BEQx index values correspond to 2 dB steps so we need to quantize the gain differences to a 2 dB resolution. Also the BEQx values must be integer. This results in the following pseudo code:+
    
 <code csharp> <code csharp>
 +//--------------------------------------------
 +// Equalizer Formulas
 +//--------------------------------------------
 BEQx_60in = BEQx_autofit - Round((10 * 0.05 * CRi_autofit) / 2);  // assuming Round() does rounding to the nearest integer, NOT truncation BEQx_60in = BEQx_autofit - Round((10 * 0.05 * CRi_autofit) / 2);  // assuming Round() does rounding to the nearest integer, NOT truncation
 BEQx_80in = BEQx_autofit - Round((30 * 0.05 * CRi_autofit) / 2);   BEQx_80in = BEQx_autofit - Round((30 * 0.05 * CRi_autofit) / 2);  
 </code> </code>
    
 +
 +==== Set Equalizers and Linear Compression ==== 
 +
 Of course, we also need to deal with the fact that there are 12 bands of EQ and only 8 channels of Compression, so in an exhaustive set of code lines: Of course, we also need to deal with the fact that there are 12 bands of EQ and only 8 channels of Compression, so in an exhaustive set of code lines:
  
Line 56: Line 68:
 BEQ12_60in = BEQ12_autofit - Round((10 * 0.05 * CR8_autofit) / 2);  // also uses CR8 BEQ12_60in = BEQ12_autofit - Round((10 * 0.05 * CR8_autofit) / 2);  // also uses CR8
    
-// now we set the CRi to 0, which results in a CR of 1:1...linear condition+//---------------------------------------------------------------  
 +// Set Compression to Linear (CR 1:1), i.eset the CRi = 0 
 +//--------------------------------------------------------------- 
 for i = 1 to 8 do begin for i = 1 to 8 do begin
    CRi = 0;    CRi = 0;
Line 82: Line 96:
 BEQ12_80in = BEQ12_autofit - Round((30 * 0.05 * CR8_autofit) / 2);  // also uses CR8 BEQ12_80in = BEQ12_autofit - Round((30 * 0.05 * CR8_autofit) / 2);  // also uses CR8
    
-// now we set the CRi to 0, which results in a CR of 1:1...linear condition+//---------------------------------------------------------------  
 +// Set Compression to Linear (CR 1:1), i.eset the CRi = 0 
 +//--------------------------------------------------------------- 
 for i = 1 to 8 do begin for i = 1 to 8 do begin
    CRi = 0;    CRi = 0;
Line 125: Line 141:
 </code> </code>
    
-Please double check that we are setting the TKs to index 2 (50dB).+
    
  
 === Summary === === Summary ===
    
-The setup60 and setup80 routines calculate the inital EQ settings for each optimisation based on the Autofit values (and all CRs are set 1:1) using the following formulas:+The setup60 and setup80 routines calculate the inital EQ settings for each optimization based on the Autofit values (and all CRs are set 1:1) using the following formulas:
 <code> <code>
 BEQx_60in = BEQx_autofit - Round((10 * 0.05 * CRi_autofit) / 2);  // Assuming Round() does rounding to the nearest integer, NOT truncation BEQx_60in = BEQx_autofit - Round((10 * 0.05 * CRi_autofit) / 2);  // Assuming Round() does rounding to the nearest integer, NOT truncation