diff options
author | Harald Welte <laforge@osmocom.org> | 2020-02-12 23:08:17 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2023-02-25 19:37:44 +0100 |
commit | 65e0edc73fa921632641463f82a7df2fa15ad7d8 (patch) | |
tree | 41165d1f7d9a93a7b09fcd29c8c0eacc4084cc55 | |
parent | 7b9b3074a282ba5f38476993dcb47e5fc7e77223 (diff) |
convolutional coding for CSD
This patch adds the convolutional code definitions for CSD (circuit
switched data) on TCH/F channels with user bit rates of 2400, 4800, 9600
and 14400 bps.
Related: OS#4396, OS#1572
Change-Id: I412131d7ee2e676402bf8d88394af17c4447b664
-rw-r--r-- | src/gsm/libosmogsm.map | 4 | ||||
-rw-r--r-- | tests/conv/conv_gsm0503_test.ok | 32 | ||||
-rw-r--r-- | utils/conv_codes_gsm.py | 87 |
3 files changed, 123 insertions, 0 deletions
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ebfa42e3..21f8e152 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -121,6 +121,10 @@ gsm0503_cs3; gsm0503_cs2_np; gsm0503_cs3_np; gsm0503_tch_fr; +gsm0503_tch_f24; +gsm0503_tch_f48; +gsm0503_tch_f96; +gsm0503_tch_f144; gsm0503_tch_hr; gsm0503_tch_afs_12_2; gsm0503_tch_afs_10_2; diff --git a/tests/conv/conv_gsm0503_test.ok b/tests/conv/conv_gsm0503_test.ok index 764bd436..bfefcd0d 100644 --- a/tests/conv/conv_gsm0503_test.ok +++ b/tests/conv/conv_gsm0503_test.ok @@ -6,6 +6,38 @@ [..] Encoding / Decoding cycle : OK [..] Encoding / Decoding cycle : OK +[+] Testing: gsm0503_tch_f24 +[.] Input length : ret = 72 exp = 72 -> OK +[.] Output length : ret = 456 exp = 456 -> OK +[.] Random vector checks: +[..] Encoding / Decoding cycle : OK +[..] Encoding / Decoding cycle : OK +[..] Encoding / Decoding cycle : OK + +[+] Testing: gsm0503_tch_f48 +[.] Input length : ret = 152 exp = 152 -> OK +[.] Output length : ret = 468 exp = 468 -> OK +[.] Random vector checks: +[..] Encoding / Decoding cycle : OK +[..] Encoding / Decoding cycle : OK +[..] Encoding / Decoding cycle : OK + +[+] Testing: gsm0503_tch_f96 +[.] Input length : ret = 240 exp = 240 -> OK +[.] Output length : ret = 456 exp = 456 -> OK +[.] Random vector checks: +[..] Encoding / Decoding cycle : OK +[..] Encoding / Decoding cycle : OK +[..] Encoding / Decoding cycle : OK + +[+] Testing: gsm0503_tch_f144 +[.] Input length : ret = 290 exp = 290 -> OK +[.] Output length : ret = 456 exp = 456 -> OK +[.] Random vector checks: +[..] Encoding / Decoding cycle : OK +[..] Encoding / Decoding cycle : OK +[..] Encoding / Decoding cycle : OK + [+] Testing: gsm0503_rach [.] Input length : ret = 14 exp = 14 -> OK [.] Output length : ret = 36 exp = 36 -> OK diff --git a/utils/conv_codes_gsm.py b/utils/conv_codes_gsm.py index 42f340b9..a6e471e3 100644 --- a/utils/conv_codes_gsm.py +++ b/utils/conv_codes_gsm.py @@ -42,6 +42,93 @@ conv_codes = [ ] ), + # TCH/F2.4 definition + ConvolutionalCode( + 72, + [ + (G1, 1), + (G2, 1), + (G3, 1), + (G1, 1), + (G2, 1), + (G3, 1), + ], + name = "tch_f24", + description = [ + "TCH/F2.4 convolutional code:", + "72 bits blocks, rate 1/6, k = 5", + "G1 = 1 + D + D3 + D4", + "G2 = 1 + D2 + D4", + "G3 = 1 + D + D2 + D3 + D4", + "G1 = 1 + D + D3 + D4", + "G2 = 1 + D2 + D4", + "G3 = 1 + D + D2 + D3 + D4", + ] + ), + + # TCH/F4.8 definition + ConvolutionalCode( + 152, + [ + (G1, 1), + (G2, 1), + (G3, 1), + ], + name = "tch_f48", + description = [ + "TCH/F4.8 convolutional code:", + "152 bits blocks, rate 1/3, k = 5", + "G1 = 1 + D + D3 + D4", + "G2 = 1 + D2 + D4", + "G3 = 1 + D + D2 + D3 + D4", + ] + ), + + # TCH/F9.6 definition + ConvolutionalCode( + 240, + shared_polys["xcch"], + puncture = [ + 11, 26, 41, 56, 71, 86, 101, 116, 131, 146, 161, 176, + 191, 206, 221, 236, 251, 266, 281, 296, 311, 326, 341, 356, + 371, 386, 401, 416, 431, 446, 461, 476, -1 + ], + name = "tch_f96", + description = [ + "TCH/F9.6 convolutional code:", + "240 bits blocks, rate 1/2, k = 5", + "G0 = 1 + D3 + D4", + "G1 = 1 + D + D3 + D4", + ] + ), + + # TCH/F14.4 definition + ConvolutionalCode( + 290, + shared_polys["xcch"], + puncture = [ + 1, 6, 11, 15, 19, 24, 29, 33, 37, 42, 47, 51, + 55, 60, 65, 69, 73, 78, 83, 87, 91, 96, 101, 105, + 109, 114, 119, 123, 127, 132, 137, 141, 145, 150, 155, 159, + 163, 168, 173, 177, 181, 186, 191, 195, 199, 204, 209, 213, + 217, 222, 227, 231, 235, 240, 245, 249, 253, 258, 263, 267, + 271, 276, 281, 285, 289, 294, 299, 303, 307, 312, 317, 321, + 325, 330, 335, 339, 343, 348, 353, 357, 361, 366, 371, 375, + 379, 384, 389, 393, 397, 402, 407, 411, 415, 420, 425, 429, + 433, 438, 443, 447, 451, 456, 461, 465, 469, 474, 479, 483, + 487, 492, 497, 501, 505, 510, 515, 519, 523, 528, 533, 537, + 541, 546, 551, 555, 559, 564, 569, 573, 577, 582, 584, 587, + -1 + ], + name = "tch_f144", + description = [ + "TCH/F14.4 convolutional code:", + "290 bits blocks, rate 1/2, k = 5", + "G0 = 1 + D3 + D4", + "G1 = 1 + D + D3 + D4", + ] + ), + # RACH definition ConvolutionalCode( 14, |