mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
adjusted modes
This commit is contained in:
parent
6745aea7c5
commit
d886edc56d
1 changed files with 69 additions and 40 deletions
|
@ -437,6 +437,26 @@ class OFDM_CONFIG(ctypes.Structure):
|
||||||
("fmax", ctypes.c_float), # Maximum frequency for tuning range
|
("fmax", ctypes.c_float), # Maximum frequency for tuning range
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class FREEDV_ADVANCED(ctypes.Structure):
|
||||||
|
"""Advanced structure for fsk and ofdm modes"""
|
||||||
|
_fields_ = [
|
||||||
|
("interleave_frames", ctypes.c_int),
|
||||||
|
("M", ctypes.c_int),
|
||||||
|
("Rs", ctypes.c_int),
|
||||||
|
("Fs", ctypes.c_int),
|
||||||
|
("first_tone", ctypes.c_int),
|
||||||
|
("tone_spacing", ctypes.c_int),
|
||||||
|
("codename", ctypes.c_char_p),
|
||||||
|
("config", ctypes.POINTER(OFDM_CONFIG))
|
||||||
|
]
|
||||||
|
|
||||||
|
api.freedv_open_advanced.argtypes = [ctypes.c_int, ctypes.POINTER(FREEDV_ADVANCED)]
|
||||||
|
api.freedv_open_advanced.restype = ctypes.c_void_p
|
||||||
|
|
||||||
|
def create_default_ofdm_config():
|
||||||
uw_sequence = (c_uint8 * MAX_UW_BITS)(*([1, 1, 0, 0, 1, 0, 1, 0] * 8))
|
uw_sequence = (c_uint8 * MAX_UW_BITS)(*([1, 1, 0, 0, 1, 0, 1, 0] * 8))
|
||||||
|
|
||||||
ofdm_default_config = OFDM_CONFIG(
|
ofdm_default_config = OFDM_CONFIG(
|
||||||
|
@ -473,24 +493,6 @@ ofdm_default_config = OFDM_CONFIG(
|
||||||
fmax=50.0,
|
fmax=50.0,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class FREEDV_ADVANCED(ctypes.Structure):
|
|
||||||
"""Advanced structure for fsk and ofdm modes"""
|
|
||||||
_fields_ = [
|
|
||||||
("interleave_frames", ctypes.c_int),
|
|
||||||
("M", ctypes.c_int),
|
|
||||||
("Rs", ctypes.c_int),
|
|
||||||
("Fs", ctypes.c_int),
|
|
||||||
("first_tone", ctypes.c_int),
|
|
||||||
("tone_spacing", ctypes.c_int),
|
|
||||||
("codename", ctypes.c_char_p),
|
|
||||||
("config", ctypes.POINTER(OFDM_CONFIG))
|
|
||||||
]
|
|
||||||
|
|
||||||
api.freedv_open_advanced.argtypes = [ctypes.c_int, ctypes.POINTER(FREEDV_ADVANCED)]
|
|
||||||
api.freedv_open_advanced.restype = ctypes.c_void_p
|
|
||||||
|
|
||||||
def create_default_ofdm_config():
|
|
||||||
return FREEDV_ADVANCED(
|
return FREEDV_ADVANCED(
|
||||||
interleave_frames = 0,
|
interleave_frames = 0,
|
||||||
M = 2,
|
M = 2,
|
||||||
|
@ -503,29 +505,56 @@ def create_default_ofdm_config():
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
data_ofdm_500_config = create_default_ofdm_config()
|
||||||
|
print(data_ofdm_500_config)
|
||||||
|
data_ofdm_500_config.config.contents.ns = 5
|
||||||
|
data_ofdm_500_config.config.contents.np = 29
|
||||||
|
data_ofdm_500_config.config.contents.tcp = 0.006
|
||||||
|
data_ofdm_500_config.config.contents.ts = 0.016
|
||||||
|
data_ofdm_500_config.config.contents.nc = 9
|
||||||
|
data_ofdm_500_config.config.contents.nuwbits = 40
|
||||||
|
data_ofdm_500_config.config.contents.timing_mx_thresh = 0.10
|
||||||
|
data_ofdm_500_config.config.contents.bad_uw_errors = 10
|
||||||
|
data_ofdm_500_config.config.contents.amp_est_mode = 1
|
||||||
|
data_ofdm_500_config.config.contents.amp_scale = 300E3
|
||||||
|
data_ofdm_500_config.config.contents.codename = b"H_1024_2048_4f"
|
||||||
|
data_ofdm_500_config.config.contents.clip_en = True
|
||||||
|
data_ofdm_500_config.config.contents.clip_gain1 = 2.7;
|
||||||
|
data_ofdm_500_config.config.contents.clip_gain2 = 0.8;
|
||||||
|
data_ofdm_500_config.config.contents.timing_mx_thresh = 0.10;
|
||||||
|
data_ofdm_500_config.config.contents.tx_bpf_en = False
|
||||||
|
data_ofdm_500_config.config.contents.rx_bpf_en = False
|
||||||
|
# Fill the tx_uw field with the uw_sequence, and pad the rest with zeros if necessary
|
||||||
|
uw_sequence = [1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0]
|
||||||
|
data_ofdm_500_config.tx_uw = (ctypes.c_uint8 * MAX_UW_BITS)(*(uw_sequence + [0]*(MAX_UW_BITS-len(uw_sequence))))
|
||||||
|
|
||||||
|
|
||||||
data_ofdm_2438_config = create_default_ofdm_config()
|
data_ofdm_2438_config = create_default_ofdm_config()
|
||||||
|
print(data_ofdm_2438_config)
|
||||||
data_ofdm_2438_config.config.contents.ns = 5
|
data_ofdm_2438_config.config.contents.ns = 5
|
||||||
data_ofdm_2438_config.config.contents.np = 52
|
data_ofdm_2438_config.config.contents.np = 51
|
||||||
data_ofdm_2438_config.config.contents.tcp = 0.005
|
data_ofdm_2438_config.config.contents.tcp = 0.005
|
||||||
data_ofdm_2438_config.config.contents.ts = 0.018
|
data_ofdm_2438_config.config.contents.ts = 0.018
|
||||||
data_ofdm_2438_config.config.contents.nc = 39
|
data_ofdm_2438_config.config.contents.nc = 40#39
|
||||||
data_ofdm_2438_config.config.contents.nuwbits = 12
|
data_ofdm_2438_config.config.contents.nuwbits = 60#12
|
||||||
data_ofdm_2438_config.config.contents.timing_mx_thresh = 0.10
|
data_ofdm_2438_config.config.contents.timing_mx_thresh = 0.10
|
||||||
data_ofdm_2438_config.config.contents.bad_uw_errors = 8
|
data_ofdm_2438_config.config.contents.bad_uw_errors = 8
|
||||||
data_ofdm_2438_config.config.contents.amp_est_mode = 1
|
data_ofdm_2438_config.config.contents.amp_est_mode = 0
|
||||||
data_ofdm_2438_config.config.contents.amp_scale = 145E3
|
data_ofdm_2438_config.config.contents.amp_scale = 145E3
|
||||||
data_ofdm_2438_config.config.contents.codename = b"H_16200_9720"
|
data_ofdm_2438_config.config.contents.codename = b"H_16200_9720"
|
||||||
|
data_ofdm_500_config.config.contents.clip_en = True
|
||||||
data_ofdm_2438_config.config.contents.clip_gain1 = 2.7;
|
data_ofdm_2438_config.config.contents.clip_gain1 = 2.7;
|
||||||
data_ofdm_2438_config.config.contents.clip_gain2 = 0.8;
|
data_ofdm_2438_config.config.contents.clip_gain2 = 0.8;
|
||||||
data_ofdm_2438_config.config.contents.timing_mx_thresh = 0.10;
|
data_ofdm_2438_config.config.contents.timing_mx_thresh = 0.10;
|
||||||
data_ofdm_2438_config.config.contents.tx_bpf_en = False
|
data_ofdm_2438_config.config.contents.tx_bpf_en = False
|
||||||
data_ofdm_2438_config.config.contents.rx_bpf_en = False
|
data_ofdm_2438_config.config.contents.rx_bpf_en = False
|
||||||
# Fill the tx_uw field with the uw_sequence, and pad the rest with zeros if necessary
|
# Fill the tx_uw field with the uw_sequence, and pad the rest with zeros if necessary
|
||||||
uw_sequence = [1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1]
|
#uw_sequence = [1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1]
|
||||||
|
uw_sequence = [1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0]
|
||||||
data_ofdm_2438_config.tx_uw = (ctypes.c_uint8 * MAX_UW_BITS)(*(uw_sequence + [0]*(MAX_UW_BITS-len(uw_sequence))))
|
data_ofdm_2438_config.tx_uw = (ctypes.c_uint8 * MAX_UW_BITS)(*(uw_sequence + [0]*(MAX_UW_BITS-len(uw_sequence))))
|
||||||
|
|
||||||
|
|
||||||
data_ofdm_500_config = create_default_ofdm_config()
|
|
||||||
|
|
||||||
|
|
||||||
ofdm_configurations = {
|
ofdm_configurations = {
|
||||||
|
|
Loading…
Reference in a new issue