libosmocoding 1.9.0.196-9975
Osmocom GSM/GPRS/EGPRS L1 channel coding library
Interleaving

GSM TS 05.03 interleaving. More...

Files

file  gsm0503_interleaving.h
 GSM TS 05.03 interleaving.
 
file  gsm0503_interleaving.c
 

Functions

void gsm0503_xcch_deinterleave (sbit_t *cB, const sbit_t *iB)
 De-Interleave burst bits according to TS 05.03 4.1.4. More...
 
void gsm0503_xcch_interleave (const ubit_t *cB, ubit_t *iB)
 Interleave burst bits according to TS 05.03 4.1.4. More...
 
void gsm0503_tch_fr_deinterleave (sbit_t *cB, const sbit_t *iB)
 GSM TCH FR/EFR/AFS De-Interleaving and burst mapping. More...
 
void gsm0503_tch_fr_interleave (const ubit_t *cB, ubit_t *iB)
 GSM TCH FR/EFR/AFS Interleaving and burst mapping. More...
 
void gsm0503_tch_hr_deinterleave (sbit_t *cB, const sbit_t *iB)
 GSM TCH HR/AHS De-Interleaving and burst mapping. More...
 
void gsm0503_tch_hr_interleave (const ubit_t *cB, ubit_t *iB)
 GSM TCH HR/AHS Interleaving and burst mapping. More...
 
void gsm0503_mcs1_ul_deinterleave (sbit_t *hc, sbit_t *dc, const sbit_t *iB)
 Interleave MCS1 UL burst bits according to TS 05.03 5.1.5.2.4. More...
 
void gsm0503_mcs1_ul_interleave (const ubit_t *hc, const ubit_t *dc, ubit_t *iB)
 Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.2.4. More...
 
void gsm0503_mcs1_dl_deinterleave (sbit_t *u, sbit_t *hc, sbit_t *dc, const sbit_t *iB)
 De-Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.1.5. More...
 
void gsm0503_mcs1_dl_interleave (const ubit_t *up, const ubit_t *hc, const ubit_t *dc, ubit_t *iB)
 Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.1.5. More...
 
void gsm0503_mcs5_ul_deinterleave (sbit_t *hc, sbit_t *dc, const sbit_t *hi, const sbit_t *di)
 De-Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.2.4. More...
 
void gsm0503_mcs5_ul_interleave (const ubit_t *hc, const ubit_t *dc, ubit_t *hi, ubit_t *di)
 Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.2.4. More...
 
void gsm0503_mcs5_dl_deinterleave (sbit_t *hc, sbit_t *dc, const sbit_t *hi, const sbit_t *di)
 De-Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.1.5. More...
 
void gsm0503_mcs5_dl_interleave (const ubit_t *hc, const ubit_t *dc, ubit_t *hi, ubit_t *di)
 Interleave MCS5 DL burst bits according to TS 05.03 5.1.9.1.5. More...
 
void gsm0503_mcs7_ul_deinterleave (sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di)
 De-Interleave MCS7 UL burst bits according to TS 05.03 5.1.11.2.4. More...
 
void gsm0503_mcs7_ul_interleave (const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di)
 Interleave MCS7 UL burst bits according to TS 05.03 5.1.11.2.4. More...
 
void gsm0503_mcs7_dl_deinterleave (sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di)
 De-Interleave MCS7 DL burst bits according to TS 05.03 5.1.11.1.5. More...
 
void gsm0503_mcs7_dl_interleave (const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di)
 Interleave MCS7 DL burst bits according to TS 05.03 5.1.11.1.5. More...
 
void gsm0503_mcs8_ul_deinterleave (sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di)
 De-Interleave MCS8 UL burst bits according to TS 05.03 5.1.12.2.4. More...
 
void gsm0503_mcs8_ul_interleave (const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di)
 Interleave MCS8 UL burst bits according to TS 05.03 5.1.12.2.4. More...
 
void gsm0503_mcs8_dl_deinterleave (sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di)
 De-Interleave MCS8 DL burst bits according to TS 05.03 5.1.12.1.5. More...
 
void gsm0503_mcs8_dl_interleave (const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di)
 Interleave MCS8 DL burst bits according to TS 05.03 5.1.12.1.5. More...
 
void gsm0503_tch_f96_deinterleave (sbit_t *cB, const sbit_t *iB)
 
void gsm0503_tch_f96_interleave (const ubit_t *cB, ubit_t *iB)
 

Detailed Description

GSM TS 05.03 interleaving.

This module contains interleaving / de-interleaving routines for various channel types, as defined in 3GPP TS 05.03 / 45.003.

GSM xCCH interleaving and burst mapping:

Interleaving:

Given 456 coded input bits, form 4 blocks of 114 bits:

 i(B, j) = c(n, k)       k = 0, ..., 455
                         n = 0, ..., N, N + 1, ...
                         B = B_0 + 4n + (k mod 4)
                         j = 2(49k mod 57) + ((k mod 8) div 4)

Mapping on Burst:

 e(B, j) = i(B, j)
 e(B, 59 + j) = i(B, 57 + j)     j = 0, ..., 56
 e(B, 57) = h_l(B)
 e(B, 58) = h_n(B)

Where hl(B) and hn(B) are bits in burst B indicating flags.

GSM TCH HR/AHS interleaving and burst mapping:

Interleaving:

Given 288 coded input bits, form 4 blocks of 114 bits, where even bits of the first 2 blocks and odd bits of the last 2 blocks are used:

 i(B, j) = c(n, k)       k = 0, ..., 227
                         n = 0, ..., N, N + 1, ...
                         B = B_0 + 2n + b
                         j, b = table[k];

Mapping on Burst:

 e(B, j) = i(B, j)
 e(B, 59 + j) = i(B, 57 + j)     j = 0, ..., 56
 e(B, 57) = h_l(B)
 e(B, 58) = h_n(B)

Where hl(B) and hn(B) are bits in burst B indicating flags.

Function Documentation

◆ gsm0503_mcs1_dl_deinterleave()

void gsm0503_mcs1_dl_deinterleave ( sbit_t u,
sbit_t hc,
sbit_t dc,
const sbit_t iB 
)

De-Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.1.5.

Parameters
[out]ucaller-allocated output buffer for 12 soft coded bits
[out]hccaller-allocated output buffer for 68 soft coded bits
[out]dccaller-allocated output buffer for 372 soft coded bits
[in]iB452 interleaved soft input bits

References c, gsm0503_xcch_deinterleave(), k, and u.

◆ gsm0503_mcs1_dl_interleave()

void gsm0503_mcs1_dl_interleave ( const ubit_t up,
const ubit_t hc,
const ubit_t dc,
ubit_t iB 
)

Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.1.5.

Parameters
[in]up12 input soft coded bits (usf)
[in]hc68 input soft coded bits (header)
[in]dc372 input soft bits (data)
[out]iB456 interleaved soft output bits

References c, gsm0503_xcch_interleave(), and k.

Referenced by egprs_type3_map().

◆ gsm0503_mcs1_ul_deinterleave()

void gsm0503_mcs1_ul_deinterleave ( sbit_t hc,
sbit_t dc,
const sbit_t iB 
)

Interleave MCS1 UL burst bits according to TS 05.03 5.1.5.2.4.

Parameters
[out]hccaller-allocated output buffer for 80 soft coded header bits
[out]dccaller-allocated output buffer for 372 soft coded data bits
[in]iB456 interleaved soft input bits

References c, gsm0503_xcch_deinterleave(), and k.

Referenced by egprs_type3_unmap().

◆ gsm0503_mcs1_ul_interleave()

void gsm0503_mcs1_ul_interleave ( const ubit_t hc,
const ubit_t dc,
ubit_t iB 
)

Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.2.4.

Parameters
[in]hc80 input coded bits (header)
[in]dc372 input bits (data)
[out]iB456 interleaved output bits

References c, gsm0503_xcch_interleave(), and k.

◆ gsm0503_mcs5_dl_deinterleave()

void gsm0503_mcs5_dl_deinterleave ( sbit_t hc,
sbit_t dc,
const sbit_t hi,
const sbit_t di 
)

De-Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.1.5.

Parameters
[out]hccaller-allocated output buffer for 100 soft coded header bits
[out]dccaller-allocated output buffer for 1248 soft coded data bits
[in]iBinterleaved soft input bits

References gsm0503_interleave_mcs5, and k.

◆ gsm0503_mcs5_dl_interleave()

void gsm0503_mcs5_dl_interleave ( const ubit_t hc,
const ubit_t dc,
ubit_t hi,
ubit_t di 
)

Interleave MCS5 DL burst bits according to TS 05.03 5.1.9.1.5.

Parameters
[in]hc100 soft coded header input bits
[in]dc1248 soft coded data input bits
[out]hi100 interleaved header output bits
[out]di1248 interleaved data output bits

References gsm0503_interleave_mcs5, and k.

Referenced by egprs_type2_map().

◆ gsm0503_mcs5_ul_deinterleave()

void gsm0503_mcs5_ul_deinterleave ( sbit_t hc,
sbit_t dc,
const sbit_t hi,
const sbit_t di 
)

De-Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.2.4.

Parameters
[out]hccaller-allocated output buffer for 136 soft coded header bits
[out]dccaller-allocated output buffer for 1248 soft coded data bits
[in]iBinterleaved soft input bits

References gsm0503_interleave_mcs5, and k.

Referenced by egprs_type2_unmap().

◆ gsm0503_mcs5_ul_interleave()

void gsm0503_mcs5_ul_interleave ( const ubit_t hc,
const ubit_t dc,
ubit_t hi,
ubit_t di 
)

Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.2.4.

Parameters
[in]hc136 soft coded header input bits
[in]dc1248 soft coded data input bits
[out]hi136 interleaved header output bits
[out]di1248 interleaved data output bits

References gsm0503_interleave_mcs5, and k.

◆ gsm0503_mcs7_dl_deinterleave()

void gsm0503_mcs7_dl_deinterleave ( sbit_t hc,
sbit_t c1,
sbit_t c2,
const sbit_t hi,
const sbit_t di 
)

De-Interleave MCS7 DL burst bits according to TS 05.03 5.1.11.1.5.

Parameters
[out]hccaller-allocated output buffer for 124 soft coded header bits
[out]c1caller-allocated output buffer for 612 soft coded data bits
[out]c2caller-allocated output buffer for 612 soft coded data bits
[in]hiinterleaved soft input header bits
[in]diinterleaved soft input data bits

References k.

◆ gsm0503_mcs7_dl_interleave()

void gsm0503_mcs7_dl_interleave ( const ubit_t hc,
const ubit_t c1,
const ubit_t c2,
ubit_t hi,
ubit_t di 
)

Interleave MCS7 DL burst bits according to TS 05.03 5.1.11.1.5.

Parameters
[in]hc124 soft coded header input bits
[in]c1612 soft coded data input bits
[in]c2612 soft coded data input bits
[out]hi124 interleaved header output bits
[out]di1224 interleaved data output bits

References k.

Referenced by egprs_type1_map().

◆ gsm0503_mcs7_ul_deinterleave()

void gsm0503_mcs7_ul_deinterleave ( sbit_t hc,
sbit_t c1,
sbit_t c2,
const sbit_t hi,
const sbit_t di 
)

De-Interleave MCS7 UL burst bits according to TS 05.03 5.1.11.2.4.

Parameters
[out]hccaller-allocated output buffer for 160 soft coded header bits
[out]c1caller-allocated output buffer for 612 soft coded data bits
[out]c2caller-allocated output buffer for 612 soft coded data bits
[in]hiinterleaved soft input header bits
[in]diinterleaved soft input data bits

References k.

Referenced by egprs_type1_unmap().

◆ gsm0503_mcs7_ul_interleave()

void gsm0503_mcs7_ul_interleave ( const ubit_t hc,
const ubit_t c1,
const ubit_t c2,
ubit_t hi,
ubit_t di 
)

Interleave MCS7 UL burst bits according to TS 05.03 5.1.11.2.4.

Parameters
[in]hc124 soft coded header input bits
[in]c1612 soft coded data input bits
[in]c2612 soft coded data input bits
[out]hi124 interleaved header output bits
[out]di1224 interleaved data output bits

References k.

◆ gsm0503_mcs8_dl_deinterleave()

void gsm0503_mcs8_dl_deinterleave ( sbit_t hc,
sbit_t c1,
sbit_t c2,
const sbit_t hi,
const sbit_t di 
)

De-Interleave MCS8 DL burst bits according to TS 05.03 5.1.12.1.5.

Parameters
[out]hccaller-allocated output buffer for 124 soft coded header bits
[out]c1caller-allocated output buffer for 612 soft coded data bits
[out]c2caller-allocated output buffer for 612 soft coded data bits
[in]hiinterleaved soft input header bits
[in]diinterleaved soft input data bits

References k.

◆ gsm0503_mcs8_dl_interleave()

void gsm0503_mcs8_dl_interleave ( const ubit_t hc,
const ubit_t c1,
const ubit_t c2,
ubit_t hi,
ubit_t di 
)

Interleave MCS8 DL burst bits according to TS 05.03 5.1.12.1.5.

Parameters
[in]hc124 soft coded header input bits
[in]c1612 soft coded data input bits
[in]c2612 soft coded data input bits
[out]hi124 interleaved header output bits
[out]di1224 interleaved data output bits

References k.

Referenced by egprs_type1_map().

◆ gsm0503_mcs8_ul_deinterleave()

void gsm0503_mcs8_ul_deinterleave ( sbit_t hc,
sbit_t c1,
sbit_t c2,
const sbit_t hi,
const sbit_t di 
)

De-Interleave MCS8 UL burst bits according to TS 05.03 5.1.12.2.4.

Parameters
[out]hccaller-allocated output buffer for 160 soft coded header bits
[out]c1caller-allocated output buffer for 612 soft coded data bits
[out]c2caller-allocated output buffer for 612 soft coded data bits
[in]hiinterleaved soft input header bits
[in]diinterleaved soft input data bits

References k.

Referenced by egprs_type1_unmap().

◆ gsm0503_mcs8_ul_interleave()

void gsm0503_mcs8_ul_interleave ( const ubit_t hc,
const ubit_t c1,
const ubit_t c2,
ubit_t hi,
ubit_t di 
)

Interleave MCS8 UL burst bits according to TS 05.03 5.1.12.2.4.

Parameters
[in]hc160 soft coded header input bits
[in]c1612 soft coded data input bits
[in]c2612 soft coded data input bits
[out]hi160 interleaved header output bits
[out]di1224 interleaved data output bits

References k.

◆ gsm0503_tch_f96_deinterleave()

void gsm0503_tch_f96_deinterleave ( sbit_t cB,
const sbit_t iB 
)

◆ gsm0503_tch_f96_interleave()

void gsm0503_tch_f96_interleave ( const ubit_t cB,
ubit_t iB 
)

◆ gsm0503_tch_fr_deinterleave()

void gsm0503_tch_fr_deinterleave ( sbit_t cB,
const sbit_t iB 
)

GSM TCH FR/EFR/AFS De-Interleaving and burst mapping.

Parameters
[out]cBcaller-allocated buffer for 456 unpacked output bits
[in]iB456 unpacked interleaved input bits

References B, and k.

Referenced by gsm0503_tch_afs_decode_dtx(), gsm0503_tch_ahs_decode_dtx(), gsm0503_tch_fr24_decode(), gsm0503_tch_fr_decode(), gsm0503_tch_fr_facch_decode(), gsm0503_tch_hr_decode2(), and gsm0503_tch_hr_facch_decode().

◆ gsm0503_tch_fr_interleave()

void gsm0503_tch_fr_interleave ( const ubit_t cB,
ubit_t iB 
)

GSM TCH FR/EFR/AFS Interleaving and burst mapping.

Parameters
[in]cBcaller-allocated buffer for 456 unpacked input bits
[out]iB456 unpacked interleaved output bits

References B, and k.

Referenced by gsm0503_tch_afs_encode(), gsm0503_tch_ahs_encode(), gsm0503_tch_fr24_encode(), gsm0503_tch_fr_encode(), gsm0503_tch_fr_facch_encode(), gsm0503_tch_hr_encode(), and gsm0503_tch_hr_facch_encode().

◆ gsm0503_tch_hr_deinterleave()

void gsm0503_tch_hr_deinterleave ( sbit_t cB,
const sbit_t iB 
)

GSM TCH HR/AHS De-Interleaving and burst mapping.

Parameters
[out]cBcaller-allocated buffer for 228 unpacked output bits
[in]iB228 unpacked interleaved input bits

References B, gsm0503_tch_hr_interleaving, and k.

Referenced by gsm0503_tch_ahs_decode_dtx(), and gsm0503_tch_hr_decode2().

◆ gsm0503_tch_hr_interleave()

void gsm0503_tch_hr_interleave ( const ubit_t cB,
ubit_t iB 
)

GSM TCH HR/AHS Interleaving and burst mapping.

Parameters
[in]cBcaller-allocated buffer for 228 unpacked input bits
[out]iB228 unpacked interleaved output bits

References B, gsm0503_tch_hr_interleaving, and k.

Referenced by gsm0503_tch_ahs_encode(), and gsm0503_tch_hr_encode().

◆ gsm0503_xcch_deinterleave()

void gsm0503_xcch_deinterleave ( sbit_t cB,
const sbit_t iB 
)

De-Interleave burst bits according to TS 05.03 4.1.4.

Parameters
[out]cBcaller-allocated output buffer for 456 soft coded bits
[in]iB456 soft input bits

References B, and k.

Referenced by gsm0503_mcs1_dl_deinterleave(), gsm0503_mcs1_ul_deinterleave(), gsm0503_pdtch_decode(), and gsm0503_xcch_decode().

◆ gsm0503_xcch_interleave()

void gsm0503_xcch_interleave ( const ubit_t cB,
ubit_t iB 
)

Interleave burst bits according to TS 05.03 4.1.4.

Parameters
[out]iBcaller-allocated output buffer for 456 soft interleaved bits
[in]cB456 soft input coded bits

References B, and k.

Referenced by gsm0503_mcs1_dl_interleave(), gsm0503_mcs1_ul_interleave(), gsm0503_pdtch_encode(), and gsm0503_xcch_encode().