computeCI: Document hardcoded multiplier

Logarithm change of base rule is used. Document it so it's clear where
it comes from.

Change-Id: Ia588e8dafda4e1abe0721f12491661949339a1ba
This commit is contained in:
Pau Espin 2021-09-03 13:48:29 +02:00
parent ac8a4e7297
commit 985694175d
1 changed files with 7 additions and 1 deletions

View File

@ -1478,7 +1478,13 @@ static float computeCI(const signalVector *burst, const CorrelationSequence *syn
/* Esimate Carrier power */
C = xcorr.norm2() / ((N - 1) * sync->gain.abs());
/* Interference = Signal - Carrier, so C/I = C / (S - C) */
/* Interference = Signal - Carrier, so C/I = C / (S - C).
* Calculated in dB:
* C/I_dB = 10 * log10(C/I)
* C/I_dB = 10 * (1/log2(10)) * log2(C/I)
* C/I_dB = 10 * 0.30103 * log2(C/I)
* C/I_dB = 3.0103 * log2(C/I)
*/
return 3.0103f * log2f(C / (S - C));
}