rfemu_gnuradio_zmq: fix amplitude conversion

fix dB to amplitude conversion and adjust max attenuation value

Change-Id: I5a94d5d31e7dc85ab37bd281f95374ad825a41ff
This commit is contained in:
Andre Puschmann 2020-10-15 16:40:21 +02:00 committed by pespin
parent 27b603f7e2
commit d5579fa38e
1 changed files with 4 additions and 3 deletions

View File

@ -188,11 +188,12 @@ class RFemulationGnuradioZmq(RFemulation):
def set_attenuation(self, db):
for cell in self.enb.gen_conf['enb']['cell_list']:
if int(cell['cell_id']) == self.cell_id:
max_att_db = self.get_max_attenuation()
self.broker.cmd_set_relative_gain_on_local_port(cell['zmq_enb_peer_port'], (max_att_db - db)/max_att_db)
# convert negative dB to amplitude
amp = pow(10, -db/20.0)
self.broker.cmd_set_relative_gain_on_local_port(cell['zmq_enb_peer_port'], amp)
break
def get_max_attenuation(self):
return 12 # maximum cell_gain value in srs. Is this correct value?
return 200
# vim: expandtab tabstop=4 shiftwidth=4