CODE
[1] val = log((val/2) + 1) / log(2.0);
[2] val = val * 0.25;
[3] if (val>1.0) val = 1.0;
Where val is the mean of the vis_samples of all channels.[2] val = val * 0.25;
[3] if (val>1.0) val = 1.0;
I assume [2] is scaling the logarithmic value to a scale where most values fall into [0,1.0] range. And that [3] is clamping the samples that fall outside 1.0. The instruction I don't understand is [1], can someone explain it?
Other problem I have is that I don't know what exactly is a vis_sample. I assume that a vis_sample is calculated as follow:
CODE
vis_sample = power^2 = real^2 + img^2.
Where real and img are grabbed from a fft calculated sample.Am I correct?
Thanks in advance
Edit: clarify what is val.