mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 03:07:56 +00:00
port_probe.py : added HT equation
ct_us_001_scripts.json updated ip_variable_time.py test Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
@@ -54,9 +54,9 @@ class ProbePort(LFCliBase):
|
||||
sleep(0.2)
|
||||
response = self.json_get(self.probepath)
|
||||
self.response = response
|
||||
if self.debug:
|
||||
print(self.probepath)
|
||||
print(response)
|
||||
#if self.debug:
|
||||
print("probepath (eid): {probepath}".format(probepath=self.probepath))
|
||||
print("Probe response: {response}".format(response=self.response))
|
||||
text = self.response['probe-results'][0][self.eid_str]['probe results'].split('\n')
|
||||
signals = [x.strip('\t').split('\t') for x in text if 'signal' in x]
|
||||
keys = [x[0].strip(' ').strip(':') for x in signals]
|
||||
@@ -186,7 +186,66 @@ class ProbePort(LFCliBase):
|
||||
print(error)
|
||||
print('mbit: %s, mcs: %s' % (mbit, mcs))
|
||||
|
||||
def ofdma_calculator(self, mbit, mcs):
|
||||
df = self.df[self.df['VHT'] == mcs]
|
||||
data_rate = (mbit * nbpscs * cding * nss) / (tdft + tgi)
|
||||
return data_rate
|
||||
def calculated_data_rate_HT(self,mcs):
|
||||
# TODO compare with standard for 40 MHz if values change
|
||||
N_sd = 0 # Number of Data Subcarriers based on modulation and bandwith
|
||||
N_bpscs = 0# Number of coded bits per Subcarrier(Determined by the modulation, MCS)
|
||||
R = 0 # coding , (Determined by the modulation, MCS )
|
||||
N_ss = 0 # Number of Spatial Streams
|
||||
T_dft = 3.2 * 10**-6 # Constant for HT
|
||||
T_gi_short = .4 * 10**-6 # Guard index.
|
||||
T_gi_long = .8 * 10**-6 # Guard index.
|
||||
# Note the T_gi is not exactly know so need to calculate bothh with .4 and .8
|
||||
# the nubmer of Data Subcarriers is based on modulation and bandwith
|
||||
bw = 20
|
||||
if bw == 20:
|
||||
N_sd = 52
|
||||
elif bw == 40:
|
||||
N_sd = 108
|
||||
elif bw == 80:
|
||||
N_sd = 234
|
||||
elif bw == 160:
|
||||
N_sd = 468
|
||||
else:
|
||||
print("bw needs to be know")
|
||||
exit(1)
|
||||
# MCS (Modulation Coding Scheme) determines the constands
|
||||
# MCS 0 == Modulation BPSK R = 1/2 , N_bpscs = 1,
|
||||
if mcs == 0:
|
||||
R = 1/2
|
||||
N_bpscs = 1
|
||||
# MCS 1 == Modulation QPSK R = 1/2 , N_bpscs = 2
|
||||
elif mcs == 1:
|
||||
R = 1/2
|
||||
N_bpscs = 2
|
||||
# MCS 2 == Modulation QPSK R = 3/4 , N_bpscs = 2
|
||||
elif mcs == 2:
|
||||
R = 3/4
|
||||
N_bpscs = 2
|
||||
# MCS 3 == Modulation 16-QAM R = 1/2 , N_bpscs = 4
|
||||
elif mcs == 3:
|
||||
R = 1/2
|
||||
N_bpscs = 4
|
||||
# MCS 4 == Modulation 16-QAM R = 3/4 , N_bpscs = 4
|
||||
elif mcs == 4:
|
||||
R = 3/4
|
||||
N_bpscs = 4
|
||||
# MCS 5 == Modulation 64-QAM R = 2/3 , N_bpscs = 6
|
||||
elif mcs == 5:
|
||||
R = 2/3
|
||||
N_bpscs = 6
|
||||
# MCS 6 == Modulation 64-QAM R = 3/4 , N_bpscs = 6
|
||||
elif mcs == 6:
|
||||
R = 3/4
|
||||
N_bpscs = 6
|
||||
# MCS 7 == Modulation 64-QAM R = 5/6 , N_bpscs = 6
|
||||
elif mcs ==7:
|
||||
R = 5/6
|
||||
N_bpscs = 6
|
||||
|
||||
|
||||
data_rate_gi_short = (N_sd * N_bpscs * R * N_ss) / (T_dft + T_gi_short)
|
||||
print("data_rate gi_short {data_rate}".format(data_rate=data_rate_gi_short))
|
||||
data_rate_gi_long = (N_sd * N_bpscs * R * N_ss) / (T_dft + T_gi_long)
|
||||
print("data_rate gi_long {data_rate}".format(data_rate=data_rate_gi_long))
|
||||
return data_rate_gi_short, data_rate_gi_long
|
||||
|
||||
Reference in New Issue
Block a user