Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed get freq using LTE TDD bands in earfcn2freq function #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions utils/eu_arfcn_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,15 @@ def earfcn2freq(band, dl_earfcn=None, ul_earfcn=None):
out: tuple (float downlink_freq, float uplink_freq)
'''
NDL_Offset = table_earfcn[band]['NDL_Offset']
NUL_Offset = table_earfcn[band]['NUL_Offset']
duplex_spacing = abs(table_earfcn[band]['FDL_Low']-table_earfcn[band]['FUL_Low'])
if table_earfcn[band].__contains__('NUL_Offset'):
NUL_Offset = table_earfcn[band]['NUL_Offset']
if table_earfcn[band].__contains__('FUL_Low'):
ful_low = table_earfcn[band]['FUL_Low']
else:
ful_low = 0
duplex_spacing = abs(table_earfcn[band]['FDL_Low']-ful_low)
FDL_Low = table_earfcn[band]['FDL_Low']
FUL_Low = table_earfcn[band]['FUL_Low']
FUL_Low = ful_low
downlink_freq = uplink_freq = None
if dl_earfcn is not None:
downlink_freq = FDL_Low + 0.1 * (dl_earfcn-NDL_Offset)
Expand All @@ -468,6 +473,10 @@ def earfcn2freq(band, dl_earfcn=None, ul_earfcn=None):
uplink_freq = downlink_freq - duplex_spacing
elif downlink_freq is None and uplink_freq is not None:
downlink_freq = downlink_freq + duplex_spacing

if FUL_Low == 0:
uplink_freq = 0

return (downlink_freq, uplink_freq)

if __name__ == "__main__":
Expand Down