Post Go back to editing

How to calibrate scale of second Rx channel on PlutoSDR

I activated second Rx channel on my Pluto and I want to compare signal strength from two sources. However, second channel seems to have non-linear scale(so I can't fix it by adjusting gain). I can see attribute scale, that is set to "0.3052" on "voltage2" channel and "1.00" on "voltage0" channel, but this attribute is read-only. Any suggestions how to adjust channels to be able to compare signal powers?

Here's code I'm using:

def power(samples):
res = 0
for sample in samples:
return res/len(samples)

sdr = adi.ad9361(uri='ip:')
samp_rate = 3e6

sdr.rx_enabled_channels = [0, 1]
sdr.sample_rate = int(samp_rate)
sdr.rx_rf_bandwidth = int(1e6)
sdr.rx_lo = int(2.5e9)
sdr.gain_control_mode_chan0 = "manual"
sdr.gain_control_mode_chan1 = "manual"
sdr.rx_hardwaregain_chan0 = int(50)
sdr.rx_hardwaregain_chan1 = int(50)
sdr.rx_buffer_size = 10000

while True:
data = sdr.rx()
print(power(data[1]), '\n')

add code
[edited by: ANepp at 1:29 PM (GMT -4) on 12 Sep 2022]