summaryrefslogtreecommitdiffstats
path: root/dpd/src/TX_Agc.py
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-09-23 20:31:47 +0200
committerandreas128 <Andreas>2017-09-23 20:31:47 +0200
commitb821bd80132eaa6e7132508d0e12787db45f4f16 (patch)
treedeb83c79ebdb3fa8c36cec44b75edfa542ea0193 /dpd/src/TX_Agc.py
parentebcd2418cfecd41b56b37454bab2551a5df7e25c (diff)
downloaddabmod-b821bd80132eaa6e7132508d0e12787db45f4f16.tar.gz
dabmod-b821bd80132eaa6e7132508d0e12787db45f4f16.tar.bz2
dabmod-b821bd80132eaa6e7132508d0e12787db45f4f16.zip
Move constants to const.py
Diffstat (limited to 'dpd/src/TX_Agc.py')
-rw-r--r--dpd/src/TX_Agc.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/dpd/src/TX_Agc.py b/dpd/src/TX_Agc.py
index affc42f..b9226b2 100644
--- a/dpd/src/TX_Agc.py
+++ b/dpd/src/TX_Agc.py
@@ -24,10 +24,7 @@ import src.Adapt as Adapt
class TX_Agc:
def __init__(self,
adapt,
- max_txgain=89,
- tx_median_target=0.16,
- tx_median_threshold_max=0.18,
- tx_median_threshold_min=0.14):
+ c):
"""
In order to avoid digital clipping, this class increases the
TX gain and reduces the digital gain. Digital clipping happens
@@ -47,16 +44,16 @@ class TX_Agc:
:param tx_median_target: The digital gain is reduced in a way that
the median TX value is expected to be lower than this value.
"""
+
+
assert isinstance(adapt, Adapt.Adapt)
self.adapt = adapt
- self.max_txgain = max_txgain
+ self.max_txgain = c.TAGC_max_txgain
self.txgain = self.max_txgain
- assert tx_median_threshold_max > tx_median_target,\
- "The tolerated tx_median has to be larger then the goal tx_median"
- self.tx_median_threshold_tolerate_max = tx_median_threshold_max
- self.tx_median_threshold_tolerate_min = tx_median_threshold_min
- self.tx_median_target = tx_median_target
+ self.tx_median_threshold_tolerate_max = c.TAGC_tx_median_max
+ self.tx_median_threshold_tolerate_min = c.TAGC_tx_median_min
+ self.tx_median_target = c.TAGC_tx_median_target
def adapt_if_necessary(self, tx):
tx_median = np.median(np.abs(tx))