Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
ezfit:clarujust:ezfit_optimizer_clarujust_algorithms [2010/01/07 15:30] smayr |
ezfit:clarujust:ezfit_optimizer_clarujust_algorithms [2010/01/08 16:44] (current) smayr |
||
---|---|---|---|
Line 5: | Line 5: | ||
We want to take the Equalizer (EQ) and Compression Ratio (CR) settings (as determined by Autofit) as the basis for setting up the Ethos chip to provide linear amplification (CR = 1:1) for two different input conditions. Setup60 and Setup80 are to linearize the HA with the appropriate gains for both 60 and 80 dB inputs. | We want to take the Equalizer (EQ) and Compression Ratio (CR) settings (as determined by Autofit) as the basis for setting up the Ethos chip to provide linear amplification (CR = 1:1) for two different input conditions. Setup60 and Setup80 are to linearize the HA with the appropriate gains for both 60 and 80 dB inputs. | ||
=== 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. | |
- | I am assuming | + | * Valid indexes range from 0 to 15, corresponding to CRs going from 1:1 up to 4:1. |
+ | * Let's assume | ||
==== Calculate Gain 60 and 80 ==== | ==== Calculate Gain 60 and 80 ==== | ||
+ | |||
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); | ||
</ | </ | ||
- | |||
- | 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/ | ||
+ | * 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); | + | |
- | </ | + | 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/ | + | |
- | ==== 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); | ||
</ | </ | ||
+ | |||
+ | ==== 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, | Of course, we also need to deal with the fact that there are 12 bands of EQ and only 8 channels of Compression, | ||
Line 53: | 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 | ||
+ | // | ||
for i = 1 to 8 do begin | for i = 1 to 8 do begin | ||
CRi = 0; | CRi = 0; | ||
Line 79: | 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 | ||
+ | // | ||
for i = 1 to 8 do begin | for i = 1 to 8 do begin | ||
CRi = 0; | CRi = 0; | ||
Line 87: | Line 106: | ||
</ | </ | ||
==== Compression ==== | ==== Compression ==== | ||
+ | |||
We also need to modify the '' | We also need to modify the '' | ||
Line 121: | Line 141: | ||
</ | </ | ||
- | 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 | + | The setup60 and setup80 routines calculate the inital EQ settings for each optimization |
< | < | ||
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); | ||
</ | </ | ||
- | + | ||
These gains are lower then the Autofit values, but because compression is being turned off, the gains should be appropriate for each input condition. | These gains are lower then the Autofit values, but because compression is being turned off, the gains should be appropriate for each input condition. | ||
- | + | ||
The '' | The '' | ||
< | < | ||
BEQi_best = BEQi_optimized60 + Round((10 * 0.05 * CRi_optimized) / 2); // Assuming Round() does rounding to near integer | BEQi_best = BEQi_optimized60 + Round((10 * 0.05 * CRi_optimized) / 2); // Assuming Round() does rounding to near integer | ||
</ | </ |