DSP is not my strong suit either, but I will try to take a stab at this.

ykhaled wrote:My ultimate goal is to measure channel power and be able to plot a power distribution percentage.

The API is working - I can stream I/Q. As I understood the sample either I or Q is a number in the range [-2048, 2047]. So signal ith sample is (Ith + Qthj).

To get the power - I can simply calculate "I*I + Q*Q"

The maximum power that can be measured is basically 2048*2048*2

All that looks good to me.

ykhaled wrote:To get relative power for N samples; power (dB) = 10*log10(SUM(I*I + Q*Q)/N) - 69.23

[s]Can you explain where the 69.23 comes from? I'm not sure I follow that part.[/s] The rest of it looks correct.

Edit: I realized you're subtracting off the full scale maximum, so your maximum dbFS is 0.

ykhaled wrote:I have few questions:

1- How can I get the actual power measured (dBm). I'm not asking for perfect calibrated level

This requires you to have a known input signal level so you can get an idea for all the losses in the chain leading up to (and including) the LMS6. To complicate things, these losses depend on frequency. Remember that the I/Q samples are just unitless numbers, and that dBm is relative to 1 milliwatt. If you don't supply a known input to see what numbers the LMS6 spits out, you can't get even a ballpark dBm conversion.

ykhaled wrote:2- Do I need to deduct the gains/losses in the reception chain? when I increase the vga1, vga2 and lna. If someone has a formula that accommodate for all parameters would be great.

Yes, you will need to take all gain stages into account, inside and outside the LMS6. If they're in dB, you can just add/subtract.