mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 20:50:28 +00:00
Compare commits
602 Commits
testing-je
...
develop-nb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
677bbab27b | ||
|
|
eff2e8410c | ||
|
|
81b8706bde | ||
|
|
36bf999657 | ||
|
|
ae16b6fde1 | ||
|
|
f51720c876 | ||
|
|
f7252bcc67 | ||
|
|
c337e5d55e | ||
|
|
fc08fd108c | ||
|
|
83d74b4071 | ||
|
|
313636a37a | ||
|
|
cb69cdd008 | ||
|
|
0984ee0054 | ||
|
|
d280abce6b | ||
|
|
ac71394e35 | ||
|
|
510175953a | ||
|
|
26ac2a13a8 | ||
|
|
a59ccb36eb | ||
|
|
aae1ac0572 | ||
|
|
584bad45ff | ||
|
|
c266372ea7 | ||
|
|
b2b74e5d19 | ||
|
|
d14c95b65f | ||
|
|
c7439dccea | ||
|
|
7bdee0c75f | ||
|
|
1f6c08c938 | ||
|
|
db61edd793 | ||
|
|
30bd3fbe40 | ||
|
|
04d2e40c70 | ||
|
|
3d4e9240e8 | ||
|
|
d3409ac0e4 | ||
|
|
9ec2d964f0 | ||
|
|
b6eafe592b | ||
|
|
78b09bedfa | ||
|
|
9624fce090 | ||
|
|
bbf01e700e | ||
|
|
92e89fa4bc | ||
|
|
43b08e7b69 | ||
|
|
cd6ebe2d20 | ||
|
|
cd92c78fd2 | ||
|
|
1253aaf5ba | ||
|
|
72a1b22768 | ||
|
|
be28badc66 | ||
|
|
a6c29b22cb | ||
|
|
32fc631039 | ||
|
|
9370f5f873 | ||
|
|
76865935f7 | ||
|
|
124ffe200c | ||
|
|
143e765cd8 | ||
|
|
9c7a5b2212 | ||
|
|
6c3be68dae | ||
|
|
99e02e93d7 | ||
|
|
89007e0f6e | ||
|
|
e2336b030a | ||
|
|
a6cc4b3937 | ||
|
|
f57e5b4e91 | ||
|
|
13fe8079c9 | ||
|
|
5f383a990a | ||
|
|
7110bb74fe | ||
|
|
2d2c80dbab | ||
|
|
f9f541cda2 | ||
|
|
84b310c27b | ||
|
|
749ffebde9 | ||
|
|
aaf5aa3ff7 | ||
|
|
22ddb6be4e | ||
|
|
824c95a766 | ||
|
|
5cb066577d | ||
|
|
4760fa5a18 | ||
|
|
ed6ea82a1e | ||
|
|
e0b6089789 | ||
|
|
fdbec2a5ef | ||
|
|
9fcf57b954 | ||
|
|
143aaaa136 | ||
|
|
2a9f54a5cb | ||
|
|
332c42afe4 | ||
|
|
ff4350af63 | ||
|
|
e7f6906bb9 | ||
|
|
efa4401e5e | ||
|
|
f31174ee0b | ||
|
|
d9d733061c | ||
|
|
aaaa5a9743 | ||
|
|
7e6ffd494b | ||
|
|
cac8ad2058 | ||
|
|
b2d05eaf37 | ||
|
|
ee0dd14dc7 | ||
|
|
51c6675083 | ||
|
|
42a69ca456 | ||
|
|
318a8fea37 | ||
|
|
10dd3e8d84 | ||
|
|
628393ffd8 | ||
|
|
671309ef44 | ||
|
|
c18281faa5 | ||
|
|
68925645d1 | ||
|
|
44037b0ca3 | ||
|
|
6f2b2eeb49 | ||
|
|
ee93a7bacd | ||
|
|
ba015c2f13 | ||
|
|
060cdd70a7 | ||
|
|
03769bdbda | ||
|
|
9686d42fa6 | ||
|
|
5ffb23865d | ||
|
|
606403cf9b | ||
|
|
10e7d9f2e1 | ||
|
|
f2c778fcf3 | ||
|
|
4a22bddc69 | ||
|
|
67f22edf3b | ||
|
|
2271436662 | ||
|
|
b969ef8f95 | ||
|
|
994956c97b | ||
|
|
010b4fa755 | ||
|
|
e625d73bc1 | ||
|
|
d2261be4c5 | ||
|
|
a9373da0fb | ||
|
|
965fe1f750 | ||
|
|
7d36175893 | ||
|
|
8814974eea | ||
|
|
6d554b2499 | ||
|
|
d82ea72105 | ||
|
|
798c839b60 | ||
|
|
debb2cca78 | ||
|
|
6b77528d7e | ||
|
|
e8ca203b7d | ||
|
|
58c39dcc89 | ||
|
|
05306c4d4a | ||
|
|
879e2af3a4 | ||
|
|
fb83f468bb | ||
|
|
8e91fab0cb | ||
|
|
3e641f4f04 | ||
|
|
c04e0bdd5c | ||
|
|
4681ca538f | ||
|
|
d561abffc8 | ||
|
|
17cc03b872 | ||
|
|
cf85aebdb0 | ||
|
|
cf7079a6e7 | ||
|
|
6040f662b9 | ||
|
|
5111eafd7c | ||
|
|
75f0c3a817 | ||
|
|
cc243196bd | ||
|
|
8ee092a522 | ||
|
|
31127b37a3 | ||
|
|
b08cf2eeab | ||
|
|
9d1737f2b6 | ||
|
|
6ba02668f5 | ||
|
|
5506e79fa1 | ||
|
|
410da556d4 | ||
|
|
17fa23d548 | ||
|
|
ae73a19fe8 | ||
|
|
be6e0e03f0 | ||
|
|
ddbcbac970 | ||
|
|
fa26d90ca0 | ||
|
|
8287818d93 | ||
|
|
3866ad4125 | ||
|
|
9e84ca4c46 | ||
|
|
183644ca16 | ||
|
|
cdb7b298ba | ||
|
|
d580bcea1a | ||
|
|
8d862a564b | ||
|
|
fafccfe4da | ||
|
|
dd78171414 | ||
|
|
550dbe624d | ||
|
|
728b381e68 | ||
|
|
da77ebb83b | ||
|
|
c3d2aa1b0e | ||
|
|
c10d87ddcc | ||
|
|
27d7bdf463 | ||
|
|
29f6db9703 | ||
|
|
901d02ef8d | ||
|
|
7a2f874990 | ||
|
|
125878cf0d | ||
|
|
1d1172aec6 | ||
|
|
98550ce677 | ||
|
|
4ae67730ac | ||
|
|
6988893a7d | ||
|
|
0dbd5a614f | ||
|
|
58b9481cb8 | ||
|
|
e901ecdf46 | ||
|
|
8617782a4f | ||
|
|
6454c61f9d | ||
|
|
c7d050c1ce | ||
|
|
5d09a92d03 | ||
|
|
164ff7f998 | ||
|
|
83ba28ead6 | ||
|
|
2570ce3d7f | ||
|
|
7a1d8e30ec | ||
|
|
0daeb68ddf | ||
|
|
cc698b523b | ||
|
|
cf44f39189 | ||
|
|
fb3356a64c | ||
|
|
ebab332572 | ||
|
|
6d5e60f3cd | ||
|
|
30f1443a6d | ||
|
|
ef3e40df8a | ||
|
|
e6a957e1aa | ||
|
|
9d4cb04f43 | ||
|
|
ba13e294c4 | ||
|
|
10c623147c | ||
|
|
0e6d35810b | ||
|
|
3980842f50 | ||
|
|
d38501c9d4 | ||
|
|
d67c3d99bf | ||
|
|
008f825c52 | ||
|
|
e67e233497 | ||
|
|
73842bed85 | ||
|
|
2ef28de053 | ||
|
|
5824229103 | ||
|
|
701b0ac9e8 | ||
|
|
9bc78d2a07 | ||
|
|
b4365f5b35 | ||
|
|
06f78e9c6c | ||
|
|
56db54d425 | ||
|
|
99df888175 | ||
|
|
72f0176915 | ||
|
|
b07dc0f86a | ||
|
|
888067c38f | ||
|
|
d04d287944 | ||
|
|
0fbe0e79aa | ||
|
|
fc831af90a | ||
|
|
892a4bd145 | ||
|
|
e59eba4d81 | ||
|
|
d38f75b392 | ||
|
|
aa9e906bcc | ||
|
|
96e4e6f40a | ||
|
|
4496496a6a | ||
|
|
a6003505df | ||
|
|
2d46e71265 | ||
|
|
fe888bec8c | ||
|
|
452feeff51 | ||
|
|
76979a7a00 | ||
|
|
8a0616a6f4 | ||
|
|
cbbdb5c6ee | ||
|
|
cd1f20b87b | ||
|
|
23c08a4734 | ||
|
|
2512f82d65 | ||
|
|
1300a34184 | ||
|
|
27f044def3 | ||
|
|
dba5c0c5d9 | ||
|
|
0abda38210 | ||
|
|
d8e6ea3702 | ||
|
|
080d0fdf70 | ||
|
|
a67d6cb6a3 | ||
|
|
b38dadb2cf | ||
|
|
c05ac86e4f | ||
|
|
2300b9fc06 | ||
|
|
a94b05629d | ||
|
|
4af1970f06 | ||
|
|
9c4d06857f | ||
|
|
56a3732fa2 | ||
|
|
b4ad22480d | ||
|
|
1f20bcd187 | ||
|
|
77b3eaa8f4 | ||
|
|
1c1a110c22 | ||
|
|
d9b8b0ad37 | ||
|
|
db5604a685 | ||
|
|
fb84abece3 | ||
|
|
74a9532186 | ||
|
|
114d1810fc | ||
|
|
f7e78c3be7 | ||
|
|
79c80bc7e8 | ||
|
|
30ee122203 | ||
|
|
a2757c87dc | ||
|
|
82fbfae510 | ||
|
|
03c6604f03 | ||
|
|
b5a55c1396 | ||
|
|
656ecb440e | ||
|
|
42e4c95284 | ||
|
|
3c1373a1ed | ||
|
|
fd0f6cbbe9 | ||
|
|
3b0c26d91c | ||
|
|
5a13a7d4a2 | ||
|
|
4c3b80b143 | ||
|
|
ae81246e55 | ||
|
|
754fc0e9e7 | ||
|
|
5734aaee83 | ||
|
|
a2d9f0d870 | ||
|
|
564268d0c3 | ||
|
|
73bfe44f0c | ||
|
|
3ed2490ed8 | ||
|
|
dd52807ac7 | ||
|
|
8573e0ec3f | ||
|
|
13052361f4 | ||
|
|
f2d2e36d2d | ||
|
|
ba9e69b5ce | ||
|
|
cba2a21a84 | ||
|
|
31d2f32e35 | ||
|
|
3e6b9e04a8 | ||
|
|
1532289090 | ||
|
|
1383a49c05 | ||
|
|
23aeaa889b | ||
|
|
5101d7cb28 | ||
|
|
3fefbc0812 | ||
|
|
3555a021f1 | ||
|
|
9e5c636f3f | ||
|
|
63be2398bd | ||
|
|
804b4ee718 | ||
|
|
b7514c6fd1 | ||
|
|
7cb7efe9fb | ||
|
|
ff6ba40389 | ||
|
|
b78c96cb41 | ||
|
|
d8fcc7c35b | ||
|
|
e860b67475 | ||
|
|
aef1e0d55e | ||
|
|
e678081fe4 | ||
|
|
a473dc04ee | ||
|
|
0e810867f3 | ||
|
|
9526b4b15c | ||
|
|
26c4b20d7d | ||
|
|
1dc48ca72f | ||
|
|
bc93c53445 | ||
|
|
40878776a0 | ||
|
|
1341f7042f | ||
|
|
ef06c4f48c | ||
|
|
457ab9f77d | ||
|
|
5c32b1b208 | ||
|
|
c343f5efac | ||
|
|
259df1e762 | ||
|
|
93c5cb8981 | ||
|
|
6a95995fec | ||
|
|
b44acd9f74 | ||
|
|
75be22c49f | ||
|
|
b25fc90acd | ||
|
|
50797cc97b | ||
|
|
270e006790 | ||
|
|
1dc1db4114 | ||
|
|
0b90e89937 | ||
|
|
25f8a1bb6e | ||
|
|
0fc1cf2eed | ||
|
|
cef6d0af35 | ||
|
|
b8a38a2de1 | ||
|
|
9d8ea63c69 | ||
|
|
d297381d56 | ||
|
|
da791cbe98 | ||
|
|
13ab4e7301 | ||
|
|
afca780991 | ||
|
|
ec8a31ea25 | ||
|
|
bd03c21143 | ||
|
|
320f896f60 | ||
|
|
a9089927ef | ||
|
|
7a704567e4 | ||
|
|
2a792c1c0d | ||
|
|
8df96ab596 | ||
|
|
2a4a37c0f4 | ||
|
|
9b5d4c88a2 | ||
|
|
71780feb6c | ||
|
|
d8c70f5086 | ||
|
|
d18c853f13 | ||
|
|
582c577764 | ||
|
|
42958e5880 | ||
|
|
3a156e0109 | ||
|
|
037eb931ca | ||
|
|
7b65549858 | ||
|
|
c5f26acde9 | ||
|
|
b93275b6b7 | ||
|
|
b8a41765c1 | ||
|
|
6be4cae60a | ||
|
|
50f7cd0039 | ||
|
|
5cd930654c | ||
|
|
8eb94115a7 | ||
|
|
e6640c23c7 | ||
|
|
84c9c889da | ||
|
|
17c94ff84b | ||
|
|
443af7af45 | ||
|
|
c0b027b457 | ||
|
|
502070917b | ||
|
|
7daf62f85f | ||
|
|
fc1ce173e4 | ||
|
|
a7bfec6cc0 | ||
|
|
56a1457216 | ||
|
|
b4816cb4bd | ||
|
|
de02d825f8 | ||
|
|
d53413610b | ||
|
|
03936c2a2e | ||
|
|
607490d4ba | ||
|
|
2d208bc5c0 | ||
|
|
8622908567 | ||
|
|
649780913f | ||
|
|
44215ada60 | ||
|
|
0d61ffea99 | ||
|
|
8ac246c464 | ||
|
|
66f1039499 | ||
|
|
c6abe215ce | ||
|
|
1ec31489b6 | ||
|
|
db93e15907 | ||
|
|
484ff57ec1 | ||
|
|
5a2415d501 | ||
|
|
30a9ffe0da | ||
|
|
9cb628a4c5 | ||
|
|
9ccd6219ff | ||
|
|
b857d15cb6 | ||
|
|
9646876ad6 | ||
|
|
759377b87f | ||
|
|
20c916fa52 | ||
|
|
1c78e96362 | ||
|
|
162066e41c | ||
|
|
7b625c88a6 | ||
|
|
09efb985e5 | ||
|
|
34edb29386 | ||
|
|
0fdd3c8e60 | ||
|
|
92f0af7186 | ||
|
|
6e494638dc | ||
|
|
b139eeb864 | ||
|
|
d40c0abec9 | ||
|
|
5c2cbdd05d | ||
|
|
0d38348421 | ||
|
|
517d412208 | ||
|
|
bab0bf57b5 | ||
|
|
3ca4ddef50 | ||
|
|
946b063576 | ||
|
|
858ee3a18e | ||
|
|
5f807fb3d8 | ||
|
|
4d1452e19b | ||
|
|
7078d93920 | ||
|
|
59f7209418 | ||
|
|
ab4fb08349 | ||
|
|
b023840911 | ||
|
|
98a2c4ca23 | ||
|
|
09204ef5d0 | ||
|
|
e516cd6303 | ||
|
|
76ea006b02 | ||
|
|
39566efc79 | ||
|
|
8060a90a03 | ||
|
|
62d834d30d | ||
|
|
f20fcad954 | ||
|
|
0a79cc80be | ||
|
|
aabfe373c6 | ||
|
|
2e64e8475f | ||
|
|
76b6804fa4 | ||
|
|
6a2100a744 | ||
|
|
034b602cdd | ||
|
|
3bbb960dd2 | ||
|
|
3681d24fe1 | ||
|
|
0fffe1a3af | ||
|
|
fb832dcc58 | ||
|
|
0d3345f384 | ||
|
|
bdc38e8eed | ||
|
|
7bec85755a | ||
|
|
ec2b045d84 | ||
|
|
2acbe6f1a9 | ||
|
|
8cd9b164bb | ||
|
|
7ccaf81495 | ||
|
|
87e25f5669 | ||
|
|
637ab8cb64 | ||
|
|
a6a371a637 | ||
|
|
a9f91a9c4b | ||
|
|
849e93124b | ||
|
|
15b74a99ae | ||
|
|
25c8b29fd8 | ||
|
|
e6c47f943c | ||
|
|
2a68d847ef | ||
|
|
b010d77f0f | ||
|
|
3f9e3e1c30 | ||
|
|
7e60086f9e | ||
|
|
7e54224382 | ||
|
|
c2ef993c59 | ||
|
|
ba9e743efa | ||
|
|
2b1c1482fa | ||
|
|
56a45cb4e3 | ||
|
|
993570c212 | ||
|
|
a9b67c50de | ||
|
|
d6b6cb9143 | ||
|
|
6768c7da22 | ||
|
|
abad0f860d | ||
|
|
7790a10b20 | ||
|
|
32aa59e054 | ||
|
|
c6df27bacd | ||
|
|
6010c7fd02 | ||
|
|
f72365989e | ||
|
|
c6b11be0a3 | ||
|
|
6bc942488e | ||
|
|
4d17c7a6b7 | ||
|
|
4fa8fa5686 | ||
|
|
d1d341ef37 | ||
|
|
8109b45ac5 | ||
|
|
302e4c576b | ||
|
|
6f4d5db7e2 | ||
|
|
a650716556 | ||
|
|
61d976e05e | ||
|
|
9c22ed6c59 | ||
|
|
2f89881704 | ||
|
|
d71ce5a4ed | ||
|
|
7c647d15d1 | ||
|
|
d805f3a5e8 | ||
|
|
b5aa2b2b87 | ||
|
|
3b00e1dccb | ||
|
|
44b6e1a3a4 | ||
|
|
e8451cfdc2 | ||
|
|
4729dd672b | ||
|
|
2ccbef43e0 | ||
|
|
711a4fb913 | ||
|
|
e3b21d8bce | ||
|
|
75d6077c21 | ||
|
|
7c5585fb49 | ||
|
|
1baa3251cd | ||
|
|
ee4974ba30 | ||
|
|
e15c1f111e | ||
|
|
c86b684064 | ||
|
|
f822c17d77 | ||
|
|
87aff44c72 | ||
|
|
bd672b4229 | ||
|
|
c4925a1d64 | ||
|
|
46b04c3bf7 | ||
|
|
5729da580b | ||
|
|
9257223e44 | ||
|
|
15e4e6a45c | ||
|
|
59dd935293 | ||
|
|
03c04bdc0d | ||
|
|
807e160b98 | ||
|
|
da0e334cbe | ||
|
|
5ac6d639ea | ||
|
|
bd903cfef3 | ||
|
|
81a04df3a9 | ||
|
|
28991862d0 | ||
|
|
ff3ceab752 | ||
|
|
ea9f723fc9 | ||
|
|
54896bac5b | ||
|
|
e7974775ba | ||
|
|
249e67153b | ||
|
|
4deb7c5494 | ||
|
|
27dd07eacd | ||
|
|
af9833fff9 | ||
|
|
559e81bbd3 | ||
|
|
f3b6c4912e | ||
|
|
897b24dc2c | ||
|
|
2e5b4c6a00 | ||
|
|
da4afbd4f4 | ||
|
|
b2fccdfaec | ||
|
|
d1d5029ff9 | ||
|
|
bdf57bdc97 | ||
|
|
4e522af668 | ||
|
|
9e228a7438 | ||
|
|
39c0a57c4c | ||
|
|
b46c33999a | ||
|
|
95db8f6c16 | ||
|
|
e01a3c06c7 | ||
|
|
4e93618b38 | ||
|
|
7dfa4afa3b | ||
|
|
0e098e1241 | ||
|
|
0bb24834fe | ||
|
|
3cde6ecb8b | ||
|
|
dce3862bde | ||
|
|
c319c7b3a6 | ||
|
|
76334007ec | ||
|
|
26407d26af | ||
|
|
ea9282f459 | ||
|
|
2ed1bfb196 | ||
|
|
a531c5173e | ||
|
|
1bbdc2dcda | ||
|
|
9d8268e70c | ||
|
|
f07397e6b0 | ||
|
|
a9a6a545ef | ||
|
|
9cc7c2d12b | ||
|
|
93b0e1fb9b | ||
|
|
1fecf3bf4b | ||
|
|
1d5a372cc9 | ||
|
|
e55e3e6f0b | ||
|
|
0b2a3668f3 | ||
|
|
4ce4c187bc | ||
|
|
9d14ef5095 | ||
|
|
fa278acdff | ||
|
|
fed3da6622 | ||
|
|
7aef723ca6 | ||
|
|
45816bd33e | ||
|
|
fead207f44 | ||
|
|
8eacbfe661 | ||
|
|
91485cdf04 | ||
|
|
8a0f0172e1 | ||
|
|
5d919b40da | ||
|
|
a97ce5c349 | ||
|
|
38c7be6683 | ||
|
|
d9be30fc81 | ||
|
|
76a6cfe607 | ||
|
|
fdaf93ec72 | ||
|
|
d3f12491f1 | ||
|
|
6a705eb46f | ||
|
|
a7f9f3a397 | ||
|
|
fbf56d4fd6 | ||
|
|
af20a29a86 | ||
|
|
4961013bb4 | ||
|
|
de2401a9bd | ||
|
|
51d56fe8dd | ||
|
|
d0f47893d8 | ||
|
|
02861d060d | ||
|
|
24730dea22 | ||
|
|
f19315aa23 | ||
|
|
106f3135bf | ||
|
|
4f5cc15c72 | ||
|
|
bb39e42ce9 | ||
|
|
f3d3e22680 | ||
|
|
08e2a0486a | ||
|
|
b49bfe6e96 | ||
|
|
a228777c45 | ||
|
|
e6c25ec9ea | ||
|
|
933ef1974f | ||
|
|
b25c1b892b | ||
|
|
3ab54cf820 | ||
|
|
ae25ec0289 | ||
|
|
d86cb3adb1 | ||
|
|
d55d71ab13 | ||
|
|
9650940f3e | ||
|
|
908bad77ce | ||
|
|
4f359646f1 | ||
|
|
a60ea61bbd | ||
|
|
4ec59fbf27 |
24
Develop-Records.txt
Normal file
24
Develop-Records.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
Develop_nb_iot_RRC Records
|
||||
|
||||
|
||||
|
||||
2017_05_16
|
||||
|
||||
|
||||
*for the moment all the interfaces are in L2_interface_nb_iot.c
|
||||
|
||||
*pdcp_primitives.c --> pdcp_serialize_user_plane_data_pdu_with_short_sn_buffer (new function) --> used in NB_pdcp_data_req interface
|
||||
included also in the proper header file pdcp_primitives.h
|
||||
|
||||
|
||||
*management of SecurityModeFailure message (rrc_eNB_nb_iot.c) --> we call the NB_rrc_pdcp_config_asn1_req with a particular case for securityMode =-1;
|
||||
modify NB_rrc_pdcp_config_asn1_req function in L2_interface_nb_iot.c
|
||||
modify pdcp_config_set_security this particular case "else if(security_modeP == -1)"
|
||||
|
||||
*modified rrc_eNB_process_RRCConnectionReconfigurationComplete_NB function ---> DRBs are never deleted and ue_cuontext_pP->ue_context.DRB_active[drb_id] == 1 called only once
|
||||
|
||||
*modified rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB--> no need of qci switch case since only RLC-AM mode in NB-IoT (no GBR)
|
||||
|
||||
*LCHAN_DESC Lchan_desc[2] --> old structure and is mainly a "good practice" but non used anymore so deleted from the rrc_eNB_nb_iot.c file
|
||||
|
||||
*update picures in DOC/RRC_images for NB-IoT protocol stack and signalling
|
||||
@@ -289,7 +289,7 @@ elseif (${RRC_ASN1_VERSION} STREQUAL "CBA")
|
||||
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel10")
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20.asn)
|
||||
else()
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/RRC-e10.asn)
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/RRC-e30.asn)
|
||||
endif (${RRC_ASN1_VERSION} STREQUAL "Rel8")
|
||||
|
||||
set (RRC_FULL_DIR ${asn1_generated_dir}/${RRC_ASN1_VERSION})
|
||||
@@ -311,6 +311,7 @@ if (NOT ${ret} STREQUAL 0)
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
file(GLOB rrc_source ${RRC_FULL_DIR}/*.c)
|
||||
set(rrc_source ${rrc_source} ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1_msg.c)
|
||||
set(rrc_source ${rrc_source} ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1_msg_NB_IoT.c)
|
||||
file(GLOB rrc_h ${RRC_FULL_DIR}/*.h)
|
||||
set(rrc_h ${rrc_h} ${RRC_FULL_DIR}/asn1_constants.h)
|
||||
set_source_files_properties(${rrc_source} PROPERTIES COMPILE_FLAGS -w) # suppress warnings from generated code
|
||||
@@ -566,6 +567,13 @@ add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchang
|
||||
|
||||
add_boolean_option(FLEXRAN_AGENT_SB_IF False "enable FlexRAN agent to inteface with a SDN controller")
|
||||
|
||||
################################################################
|
||||
# NB-IOT
|
||||
################################################################
|
||||
add_boolean_option(NB_IOT True "Enabling NB-IoT code")
|
||||
add_boolean_option(NB_IOT_CRC_REVOVERY True "Enabling NB-IoT CRC Recovery for some specific data")
|
||||
|
||||
|
||||
########################
|
||||
# Include order
|
||||
##########################
|
||||
@@ -650,7 +658,7 @@ add_boolean_option(TRACE_RLC_MUTEX True "TRACE for RLC, possible proble
|
||||
add_boolean_option(TRACE_RLC_AM_BO False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
|
||||
add_boolean_option(TRACE_RLC_AM_FREE_SDU False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
|
||||
add_boolean_option(TRACE_RLC_AM_HOLE False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
|
||||
add_boolean_option(TRACE_RLC_AM_PDU False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
|
||||
add_boolean_option(TRACE_RLC_AM_PDU True "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
|
||||
add_boolean_option(TRACE_RLC_AM_RESEGMENT False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
|
||||
add_boolean_option(TRACE_RLC_AM_RX False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
|
||||
add_boolean_option(TRACE_RLC_AM_RX_DECODE False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG")
|
||||
@@ -958,11 +966,15 @@ add_library(SECU_CN ${SECU_CN_SRC})
|
||||
################################"
|
||||
set(SCHED_SRC
|
||||
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_eNb.c
|
||||
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_eNb_NB_IoT.c
|
||||
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_ue.c
|
||||
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_common.c
|
||||
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_common_NB_IoT.c
|
||||
${OPENAIR1_DIR}/SCHED/phy_mac_stub.c
|
||||
${OPENAIR1_DIR}/SCHED/IF_Module_L1_primitives_NB_IoT.c
|
||||
${OPENAIR1_DIR}/SCHED/pucch_pc.c
|
||||
${OPENAIR1_DIR}/SCHED/pusch_pc.c
|
||||
${OPENAIR1_DIR}/SCHED/pusch_pc_NB_IoT.c
|
||||
${OPENAIR1_DIR}/SCHED/srs_pc.c
|
||||
)
|
||||
add_library(SCHED_LIB ${SCHED_SRC})
|
||||
@@ -974,34 +986,52 @@ set(PHY_SRC
|
||||
${RRC_FULL_DIR}/asn1_constants.h
|
||||
# actual source
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pss.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/npss_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sss.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/nsss_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pilots.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pilots_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pilots_mbsfn.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_coding.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_coding_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_modulation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_modulation_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_demodulation.c
|
||||
#${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_demodulation_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_llr_computation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/power_control.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_decoding.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_scrambling.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_scrambling_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_Isc_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pbch.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/npbch_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/SIB_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/phich.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pcfich.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/nprach_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pch.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_modulation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_coding.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_decoding.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_decoding_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/rar_tools.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/print_stats.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/initial_sync.c
|
||||
@@ -1015,36 +1045,50 @@ set(PHY_SRC
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/beamforming.c
|
||||
${OPENAIR1_DIR}/PHY/MODULATION/compute_bf_weights.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_timefreq.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_timefreq_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_est_freq_offset.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ue_measurements.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/adjust_gain.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_cell_spec.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_uespec.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_gold.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_cell_spec_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_uespec.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_gold.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_gold_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_gold_mbsfn.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_mbsfn.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_ul_ref.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_ul_ref_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/lte_segmentation.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/lte_segmentation_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/ccoding_byte.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/ccoding_byte_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/ccoding_byte_lte.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/3gpplte_sse.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/crc_byte.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/crc_byte_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/lte_rate_matching.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/lte_rate_matching_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/rate_matching.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/viterbi.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/viterbi_lte_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_init.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_init_NB_IoT.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
|
||||
@@ -1074,12 +1118,15 @@ add_library(PHY ${PHY_SRC})
|
||||
#####################
|
||||
set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC)
|
||||
set(RLC_DIR ${OPENAIR2_DIR}/LAYER2/RLC)
|
||||
set(PHY_INTERFACE_DIR ${OPENAIR2_DIR}/PHY_INTERFACE)
|
||||
set(RLC_UM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0)
|
||||
set(RLC_AM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0)
|
||||
set(RLC_TM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/TM_v9.3.0)
|
||||
set(RRC_DIR ${OPENAIR2_DIR}/RRC/LITE)
|
||||
set(PDCP_DIR ${OPENAIR2_DIR}/LAYER2/PDCP_v10.1.0)
|
||||
set(L2_SRC
|
||||
${PHY_INTERFACE_DIR}/IF_Module_NB_IoT.c
|
||||
${PHY_INTERFACE_DIR}/IF_Module_L2_primitives_NB_IoT.c
|
||||
${OPENAIR2_DIR}/LAYER2/openair2_proc.c
|
||||
${PDCP_DIR}/pdcp.c
|
||||
${PDCP_DIR}/pdcp_fifo.c
|
||||
@@ -1117,27 +1164,40 @@ set(L2_SRC
|
||||
${RLC_DIR}/rlc_mpls.c
|
||||
${RRC_DIR}/rrc_UE.c
|
||||
${RRC_DIR}/rrc_eNB.c
|
||||
#${RRC_DIR}/rrc_eNB_NB_IoT.c
|
||||
${RRC_DIR}/rrc_eNB_S1AP.c
|
||||
${RRC_DIR}/rrc_eNB_UE_context.c
|
||||
${RRC_DIR}/rrc_eNB_UE_context_NB_IoT.c
|
||||
${RRC_DIR}/rrc_common.c
|
||||
${RRC_DIR}/rrc_common_NB_IoT.c
|
||||
${RRC_DIR}/L2_interface.c
|
||||
${RRC_DIR}/L2_interface_NB_IoT.c
|
||||
)
|
||||
set (MAC_SRC
|
||||
${MAC_DIR}/lte_transport_init.c
|
||||
${MAC_DIR}/main.c
|
||||
${MAC_DIR}/main_NB_IoT.c
|
||||
${MAC_DIR}/ue_procedures.c
|
||||
${MAC_DIR}/ra_procedures.c
|
||||
${MAC_DIR}/l1_helpers.c
|
||||
${MAC_DIR}/rar_tools.c
|
||||
${MAC_DIR}/eNB_scheduler.c
|
||||
${MAC_DIR}/eNB_scheduler_NB_IoT.c
|
||||
${MAC_DIR}/eNB_scheduler_dlsch.c
|
||||
${MAC_DIR}/eNB_scheduler_dlsch_NB_IoT.c
|
||||
${MAC_DIR}/eNB_scheduler_ulsch.c
|
||||
${MAC_DIR}/eNB_scheduler_ulsch_NB_IoT.c
|
||||
${MAC_DIR}/eNB_scheduler_mch.c
|
||||
${MAC_DIR}/eNB_scheduler_bch.c
|
||||
${MAC_DIR}/eNB_scheduler_bch_NB_IoT.c
|
||||
${MAC_DIR}/eNB_scheduler_primitives.c
|
||||
${MAC_DIR}/output_handler_NB_IoT.c
|
||||
${MAC_DIR}/eNB_scheduler_RA.c
|
||||
${MAC_DIR}/eNB_scheduler_RA_NB_IoT.c
|
||||
${MAC_DIR}/pre_processor.c
|
||||
${MAC_DIR}/config.c
|
||||
${MAC_DIR}/config_NB_IoT.c
|
||||
${MAC_DIR}/schedule_tool_NB_IoT.c
|
||||
)
|
||||
|
||||
if (FLEXRAN_AGENT_SB_IF)
|
||||
|
||||
92
cmake_targets/oaisim_noS1_build_oai/CMakeLists.txt
Normal file
92
cmake_targets/oaisim_noS1_build_oai/CMakeLists.txt
Normal file
@@ -0,0 +1,92 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME False )
|
||||
set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False)
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE True )
|
||||
set ( EXMIMO_IOT True )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U False)
|
||||
set ( LINUX_LIST False )
|
||||
set ( LINUX True )
|
||||
set ( LOCALIZATION False )
|
||||
set ( LOG_NO_THREAD 1 )
|
||||
set ( DEADLINE_SCHEDULER False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False )
|
||||
set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
|
||||
set ( MESSAGE_CHART_GENERATOR_PHY False )
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX True )
|
||||
set ( NAS_BUILT_IN_UE False)
|
||||
set ( NAS_MME False )
|
||||
set ( NAS_UE False )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU True )
|
||||
set ( OAISIM True )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_EMU False )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "oaisim" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PC_DSP True )
|
||||
set ( PC_TARGET True )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM True )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( TEST_OMG False )
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( DEBUG_PHY False )
|
||||
set ( DEBUG_PHY_PROC False)
|
||||
set ( DEBUG_DLSCH False)
|
||||
set ( CMAKE_BUILD_TYPE )
|
||||
set ( CFLAGS_PROCESSOR_USER "" )
|
||||
set ( XFORMS True )
|
||||
set ( PRINT_STATS True )
|
||||
set ( RRC_ASN1_VERSION "Rel14")
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( T_TRACER False )
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
|
||||
@@ -4,7 +4,8 @@
|
||||
# <file> <sha1sum of file (without line 4 which changes depending on the location of the files)> <patch to apply to file>
|
||||
|
||||
RRC_Rel14=(
|
||||
"SystemInformation-r8-IEs.h" 562e3c3aeb7c6d76d722f31bf24488a26e627f33 "fix_asn1.data/RRC.rel14/SystemInformation-r8-IEs.h.diff"
|
||||
"SystemInformation-r8-IEs.h" 4df485c5ddf2540eca271876cdc512caa19b0890 "fix_asn1.data/RRC.rel14/SystemInformation-r8-IEs.h.diff"
|
||||
"SystemInformation-NB-r13-IEs.h" 6d91332d5c39205819b06e5e36efe62ff8e5b33b "fix_asn1.data/RRC.rel14/SystemInformation-NB-r13-IEs.h.diff"
|
||||
)
|
||||
|
||||
RRC_Rel10=(
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
48a49,70
|
||||
> struct SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member {
|
||||
> SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_PR present;
|
||||
> union SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_u {
|
||||
> SystemInformationBlockType2_NB_r13_t sib2_r13;
|
||||
> SystemInformationBlockType3_NB_r13_t sib3_r13;
|
||||
> SystemInformationBlockType4_NB_r13_t sib4_r13;
|
||||
> SystemInformationBlockType5_NB_r13_t sib5_r13;
|
||||
> SystemInformationBlockType14_NB_r13_t sib14_r13;
|
||||
> SystemInformationBlockType16_NB_r13_t sib16_r13;
|
||||
> /*
|
||||
> * This type is extensible,
|
||||
> * possible extensions are below.
|
||||
> */
|
||||
> SystemInformationBlockType15_NB_r14_t sib15_v1430;
|
||||
> SystemInformationBlockType20_NB_r14_t sib20_v1430;
|
||||
> SystemInformationBlockType22_NB_r14_t sib22_v1430;
|
||||
> } choice;
|
||||
>
|
||||
> /* Context for parsing across buffer boundaries */
|
||||
> asn_struct_ctx_t _asn_ctx;
|
||||
> };
|
||||
>
|
||||
52,72c74
|
||||
< A_SEQUENCE_OF(struct SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member {
|
||||
< SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_PR present;
|
||||
< union SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_u {
|
||||
< SystemInformationBlockType2_NB_r13_t sib2_r13;
|
||||
< SystemInformationBlockType3_NB_r13_t sib3_r13;
|
||||
< SystemInformationBlockType4_NB_r13_t sib4_r13;
|
||||
< SystemInformationBlockType5_NB_r13_t sib5_r13;
|
||||
< SystemInformationBlockType14_NB_r13_t sib14_r13;
|
||||
< SystemInformationBlockType16_NB_r13_t sib16_r13;
|
||||
< /*
|
||||
< * This type is extensible,
|
||||
< * possible extensions are below.
|
||||
< */
|
||||
< SystemInformationBlockType15_NB_r14_t sib15_v1430;
|
||||
< SystemInformationBlockType20_NB_r14_t sib20_v1430;
|
||||
< SystemInformationBlockType22_NB_r14_t sib22_v1430;
|
||||
< } choice;
|
||||
<
|
||||
< /* Context for parsing across buffer boundaries */
|
||||
< asn_struct_ctx_t _asn_ctx;
|
||||
< } ) list;
|
||||
---
|
||||
> A_SEQUENCE_OF(struct SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member) list;
|
||||
@@ -276,15 +276,24 @@ hashtable_rc_t hashtable_get(const hash_table_t * const hashtblP, const hash_key
|
||||
*dataP = NULL;
|
||||
return HASH_TABLE_BAD_PARAMETER_HASHTABLE;
|
||||
}
|
||||
|
||||
//printf("Hash table size : %d\n", hashtblP->size);
|
||||
//printf("hashfunc(keyP) : %d\n", hashtblP->hashfunc(keyP));
|
||||
hash=hashtblP->hashfunc(keyP)%hashtblP->size;
|
||||
/* fprintf(stderr, "hashtable_get() key=%s, hash=%d\n", key, hash);*/
|
||||
//printf("keyP %d\n", keyP);
|
||||
/*fprintf(stderr, "hashtable_get() key=%s, hash=%d\n", key, hash);*/
|
||||
//printf("hash %d\n", hash);
|
||||
|
||||
node=hashtblP->nodes[hash];
|
||||
//printf("nodes_value %d \n", hashtblP->nodes[hash]);
|
||||
|
||||
while(node) {
|
||||
//printf("node_key %d \n",node->key);
|
||||
if(node->key == keyP) {
|
||||
//printf("node_key %d \n",node->key);
|
||||
*dataP = node->data;
|
||||
return HASH_TABLE_OK;
|
||||
//printf("node->data : %p \n",node->data);
|
||||
return HASH_TABLE_OK;
|
||||
}
|
||||
node=node->next;
|
||||
}
|
||||
|
||||
@@ -963,6 +963,8 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y,
|
||||
|
||||
switch (crc_type) {
|
||||
case CRC24_A:
|
||||
crc_len=3;
|
||||
break;
|
||||
case CRC24_B:
|
||||
crc_len=3;
|
||||
break;
|
||||
|
||||
@@ -1188,6 +1188,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
time_stats_t *intl2_stats)
|
||||
{
|
||||
|
||||
|
||||
/* y is a pointer to the input
|
||||
decoded_bytes is a pointer to the decoded output
|
||||
n is the size in bits of the coded block, with the tail */
|
||||
@@ -1256,6 +1257,8 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
|
||||
switch (crc_type) {
|
||||
case CRC24_A:
|
||||
crc_len=3;
|
||||
break;
|
||||
case CRC24_B:
|
||||
crc_len=3;
|
||||
break;
|
||||
@@ -1562,9 +1565,58 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
print_shorts("tmp",(int16_t*)&tmp);
|
||||
fprintf(fdsse4,"decoded_bytes[%d] %x\n",i,decoded_bytes[i]);
|
||||
#endif
|
||||
//printf("decoded_bytes[%d] %x\n",i,decoded_bytes[i]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NB_IOT_CRC_REVOVERY
|
||||
|
||||
unsigned char auth_rsp[5] = {0x30, 0x0b, 0x07, 0x53, 0x08};
|
||||
unsigned char attach_complete[8] = {0x01, 0x07, 0x43, 0x00, 0x03, 0x52, 0x00, 0xc2};
|
||||
unsigned char security_complte[3] = {0x30, 0x08, 0x47};
|
||||
unsigned char security_complte_BC95G[3] = {0x30,0x08, 0x47};
|
||||
|
||||
int cnt = 0;
|
||||
int correct_bit = 0;
|
||||
int correct_bit_attach = 0;
|
||||
int correct_bit_security = 0;
|
||||
int correct_bit_security_BC95G = 0;
|
||||
//unsigned char padding = 0x00;
|
||||
|
||||
for (cnt=0; cnt <5; cnt++)
|
||||
{
|
||||
if(auth_rsp[cnt] == decoded_bytes[cnt+5])
|
||||
{
|
||||
//printf("correct_bit++\n");
|
||||
correct_bit++;
|
||||
}
|
||||
}
|
||||
for (cnt=10; cnt <18; cnt++)
|
||||
{
|
||||
if(attach_complete[cnt-10] == decoded_bytes[cnt])
|
||||
{
|
||||
//printf("correct_bit_attach++\n");
|
||||
correct_bit_attach++;
|
||||
}
|
||||
}
|
||||
for (cnt=0; cnt <3; cnt++)
|
||||
{
|
||||
if(security_complte[cnt] == decoded_bytes[cnt+5])
|
||||
{
|
||||
//printf("correct_bit_security++\n");
|
||||
correct_bit_security++;
|
||||
}
|
||||
}
|
||||
for (cnt=0; cnt <3; cnt++)
|
||||
{
|
||||
if(security_complte_BC95G[cnt] == decoded_bytes[cnt+7])
|
||||
{
|
||||
//printf("correct_bit_security++\n");
|
||||
correct_bit_security_BC95G++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// check status on output
|
||||
if (iteration_cnt>1) {
|
||||
oldcrc= *((unsigned int *)(&decoded_bytes[(n>>3)-crc_len]));
|
||||
@@ -1572,14 +1624,331 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
switch (crc_type) {
|
||||
|
||||
case CRC24_A:
|
||||
oldcrc&=0x00ffffff;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
break;
|
||||
#ifdef NB_IOT_CRC_REVOVERY
|
||||
if ((correct_bit<5) && (correct_bit_attach<8) && (correct_bit_security<3) &&(correct_bit_security_BC95G<3))
|
||||
{
|
||||
oldcrc&=0x00ffffff;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
break;
|
||||
}else if(correct_bit==5)
|
||||
{
|
||||
printf("Try to recovery authentication response\n");
|
||||
|
||||
// the first case, didn't change anything
|
||||
oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
printf("Without modification\n");
|
||||
return iteration_cnt;
|
||||
}
|
||||
|
||||
// Add 1st byte for 00001000 (0x08)
|
||||
decoded_bytes[17] = decoded_bytes[17] + 0x08;
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
decoded_bytes[17] = decoded_bytes[17] - 0x08;
|
||||
|
||||
// Add 3rd byte for 00001000 (0x08)
|
||||
decoded_bytes[15] = decoded_bytes[15] + 0x08;
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
|
||||
decoded_bytes[15] = decoded_bytes[15] - 0x08;
|
||||
|
||||
// Add 7th byte for 00001000 (0x08)
|
||||
decoded_bytes[11] = decoded_bytes[11] + 0x08;
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
decoded_bytes[11] = decoded_bytes[11] - 0x08;
|
||||
|
||||
// Add 1st , 3rd byte for 00001000 (0x08)
|
||||
decoded_bytes[17] = decoded_bytes[17] + 0x08;
|
||||
decoded_bytes[15] = decoded_bytes[15] + 0x08;
|
||||
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
// Add 1st , 3rd byte for 00001000 (0x08)
|
||||
decoded_bytes[17] = decoded_bytes[17] - 0x08;
|
||||
decoded_bytes[15] = decoded_bytes[15] - 0x08;
|
||||
|
||||
// Add 1st , 7th byte for 00001000 (0x08)
|
||||
decoded_bytes[17] = decoded_bytes[17] + 0x08;
|
||||
decoded_bytes[11] = decoded_bytes[11] + 0x08;
|
||||
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
|
||||
// Add 1st , 7th byte for 00001000 (0x08)
|
||||
decoded_bytes[17] = decoded_bytes[17] - 0x08;
|
||||
decoded_bytes[11] = decoded_bytes[11] - 0x08;
|
||||
|
||||
// Add 3rd , 7th byte for 00001000 (0x08)
|
||||
decoded_bytes[15] = decoded_bytes[15] + 0x08;
|
||||
decoded_bytes[11] = decoded_bytes[11] + 0x08;
|
||||
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
|
||||
// Add 3rd , 7th byte for 00001000 (0x08)
|
||||
decoded_bytes[15] = decoded_bytes[15] - 0x08;
|
||||
decoded_bytes[11] = decoded_bytes[11] - 0x08;
|
||||
|
||||
// Add 1st, 3rd , 7th byte for 00001000 (0x08)
|
||||
decoded_bytes[15] = decoded_bytes[15] + 0x08;
|
||||
decoded_bytes[11] = decoded_bytes[11] + 0x08;
|
||||
decoded_bytes[17] = decoded_bytes[17] + 0x08;
|
||||
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
decoded_bytes[15] = decoded_bytes[15] - 0x08;
|
||||
decoded_bytes[11] = decoded_bytes[11] - 0x08;
|
||||
decoded_bytes[17] = decoded_bytes[17] - 0x08;
|
||||
break;
|
||||
|
||||
}else if(correct_bit_attach==8)
|
||||
{
|
||||
printf("Try to recovery attach complete\n");
|
||||
|
||||
// the first case, didn't change anything
|
||||
oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
|
||||
// Add 1st byte for 00001000 (0x08)
|
||||
decoded_bytes[7] = decoded_bytes[7] + 0x08;
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
decoded_bytes[7] = decoded_bytes[7] - 0x08;
|
||||
break;
|
||||
}else if (correct_bit_security == 3)
|
||||
{
|
||||
printf("Try to recovery security complete\n");
|
||||
|
||||
// the first case, didn't change anything
|
||||
oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
|
||||
// Add 1st byte for 00001000 (0x08)
|
||||
decoded_bytes[14] = decoded_bytes[14] + 0x08;
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
decoded_bytes[14] = decoded_bytes[14] - 0x08;
|
||||
break;
|
||||
}else if (correct_bit_security_BC95G == 3)
|
||||
{
|
||||
printf("Try to recovery security complete BC95G\n");
|
||||
decoded_bytes[3] = decoded_bytes[3] + 0x08;
|
||||
// the first case, didn't change anything
|
||||
oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
|
||||
// Add 7th byte for 00001000 (0x08)
|
||||
decoded_bytes[11] = decoded_bytes[11] + 0x08;
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
decoded_bytes[11] = decoded_bytes[11] - 0x08;
|
||||
|
||||
// Add 17th byte for 00001000 (0x08)
|
||||
decoded_bytes[17] = decoded_bytes[17] + 0x08;
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
decoded_bytes[17] = decoded_bytes[17] - 0x08;
|
||||
|
||||
|
||||
// Add 7th & 17th byte for 00001000 (0x08)
|
||||
decoded_bytes[11] = decoded_bytes[11] + 0x08;
|
||||
decoded_bytes[17] = decoded_bytes[17] + 0x08;
|
||||
//oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
if (crc == oldcrc)
|
||||
{
|
||||
return iteration_cnt;
|
||||
}
|
||||
decoded_bytes[17] = decoded_bytes[17] - 0x08;
|
||||
decoded_bytes[11] = decoded_bytes[11] - 0x08;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
#else
|
||||
oldcrc&=0x00ffffff;
|
||||
crc = 0;
|
||||
crc = crc24a(&decoded_bytes[F>>3],
|
||||
n-24-F)>>8;
|
||||
temp=((uint8_t *)&crc)[2];
|
||||
((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
|
||||
((uint8_t *)&crc)[0] = temp;
|
||||
break;
|
||||
#endif
|
||||
case CRC24_B:
|
||||
oldcrc&=0x00ffffff;
|
||||
crc = crc24b(decoded_bytes,
|
||||
@@ -1611,6 +1980,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
#endif
|
||||
//printf("oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
|
||||
if (crc == oldcrc) {
|
||||
return(iteration_cnt);
|
||||
|
||||
159
openair1/PHY/CODING/ccoding_byte_NB_IoT.c
Normal file
159
openair1/PHY/CODING/ccoding_byte_NB_IoT.c
Normal file
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_CODING/ccoding_byte_NB_IoT.c
|
||||
* \Fucntions for CRC attachment and tail-biting convolutional coding for NPBCH channel, TS 36-212, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/CODING/defs_NB_IoT.h"
|
||||
|
||||
unsigned char ccodelte_table_NB_IoT[128]; // for transmitter
|
||||
unsigned short glte_NB_IoT[] = { 0133, 0171, 0165 }; // {A,B} //renaimed but is exactly the same as the one in the old implementation
|
||||
|
||||
/*************************************************************************
|
||||
Encodes for an arbitrary convolutional code of rate 1/3
|
||||
with a constraint length of 7 bits.
|
||||
The inputs are bit packed in octets (from MSB to LSB).
|
||||
An optional 8-bit CRC (3GPP) can be added.
|
||||
Trellis tail-biting is included here
|
||||
*************************************************************************/
|
||||
void ccode_encode_NB_IoT (int32_t numbits,
|
||||
uint8_t add_crc,
|
||||
uint8_t *inPtr,
|
||||
uint8_t *outPtr,
|
||||
uint16_t rnti)
|
||||
{
|
||||
uint32_t state;
|
||||
uint8_t c, out, first_bit;
|
||||
int8_t shiftbit=0;
|
||||
uint16_t c16;
|
||||
uint16_t next_last_byte=0;
|
||||
uint32_t crc=0;
|
||||
|
||||
/* The input bit is shifted in position 8 of the state.
|
||||
Shiftbit will take values between 1 and 8 */
|
||||
state = 0;
|
||||
|
||||
if (add_crc == 2) {
|
||||
|
||||
crc = crc16_NB_IoT(inPtr,numbits); // crc is 2 bytes
|
||||
// scramble with RNTI
|
||||
crc ^= (((uint32_t)rnti)<<16); // XOR with crc
|
||||
first_bit = 2;
|
||||
c = (uint8_t)((crc>>16)&0xff);
|
||||
|
||||
} else {
|
||||
|
||||
next_last_byte = numbits>>3;
|
||||
first_bit = (numbits-6)&7;
|
||||
c = inPtr[next_last_byte-1];
|
||||
}
|
||||
|
||||
// Perform Tail-biting
|
||||
// get bits from last byte of input (or crc)
|
||||
|
||||
for (shiftbit = 0 ; shiftbit <(8-first_bit) ; shiftbit++) {
|
||||
|
||||
if ((c&(1<<(7-first_bit-shiftbit))) != 0)
|
||||
state |= (1<<shiftbit);
|
||||
}
|
||||
|
||||
state = state & 0x3f; // true initial state of Tail-biting CCode
|
||||
state<<=1; // because of loop structure in CCode
|
||||
|
||||
while (numbits > 0) { // Tail-biting is applied to input bits , input 34 bits , output 102 bits
|
||||
|
||||
c = *inPtr++;
|
||||
|
||||
for (shiftbit = 7; (shiftbit>=0) && (numbits>0); shiftbit--,numbits--) {
|
||||
|
||||
state >>= 1;
|
||||
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
}
|
||||
|
||||
out = ccodelte_table_NB_IoT[state];
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
*outPtr++ = (out>>2)&1;
|
||||
}
|
||||
}
|
||||
|
||||
// now code 16-bit CRC for DCI // Tail-biting is applied to CRC bits , input 16 bits , output 48 bits
|
||||
if (add_crc == 2) {
|
||||
|
||||
c16 = (uint16_t)(crc>>16);
|
||||
|
||||
for (shiftbit = 15; (shiftbit>=0); shiftbit--) {
|
||||
|
||||
state >>= 1;
|
||||
|
||||
if ((c16&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
}
|
||||
|
||||
out = ccodelte_table_NB_IoT[state];
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
*outPtr++ = (out>>2)&1;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*************************************************************************
|
||||
|
||||
Functions to initialize the code tables
|
||||
|
||||
*************************************************************************/
|
||||
/* Basic code table initialization for constraint length 7 */
|
||||
|
||||
/* Input in MSB, followed by state in 6 LSBs */
|
||||
void ccodelte_init_NB_IoT(void)
|
||||
{
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
|
||||
ccodelte_table_NB_IoT[i] = 0;
|
||||
|
||||
/* Compute 3 output bits */
|
||||
for (j = 0; j < 3; j++) {
|
||||
sum = 0;
|
||||
|
||||
for (k = 0; k < 7; k++)
|
||||
if ((i & glte_NB_IoT[j]) & (1 << k))
|
||||
sum++;
|
||||
|
||||
/* Write the sum modulo 2 in bit j */
|
||||
ccodelte_table_NB_IoT[i] |= (sum & 1) << j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ crc24a (unsigned char * inptr, int bitlen)
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
// printf("in %x => crc %x\n",crc,*inptr);
|
||||
//printf("in %x => crc %x\n",crc,*inptr);
|
||||
crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)];
|
||||
}
|
||||
|
||||
|
||||
211
openair1/PHY/CODING/crc_byte_NB_IoT.c
Normal file
211
openair1/PHY/CODING/crc_byte_NB_IoT.c
Normal file
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/* file: crc_byte.c
|
||||
purpose: generate 3GPP LTE CRCs. Byte-oriented implementation of CRC's
|
||||
author: raymond.knopp@eurecom.fr, matthieu.kanj@b-com.com
|
||||
date: 07/2017
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef USER_MODE
|
||||
#define __NO_VERSION__
|
||||
|
||||
#endif
|
||||
|
||||
//#include "PHY/types.h"
|
||||
|
||||
//#include "defs.h" // to delete in final code version
|
||||
|
||||
#include "PHY/CODING/defs_NB_IoT.h" //
|
||||
/*ref 36-212 v8.6.0 , pp 8-9 */
|
||||
/* the highest degree is set by default */
|
||||
unsigned int poly24a_NB_IoT = 0x864cfb00; //1000 0110 0100 1100 1111 1011 D^24 + D^23 + D^18 + D^17 + D^14 + D^11 + D^10 + D^7 + D^6 + D^5 + D^4 + D^3 + D + 1
|
||||
unsigned int poly24b_NB_IoT = 0x80006300; // 1000 0000 0000 0000 0110 0011 D^24 + D^23 + D^6 + D^5 + D + 1
|
||||
unsigned int poly16_NB_IoT = 0x10210000; // 0001 0000 0010 0001 D^16 + D^12 + D^5 + 1
|
||||
unsigned int poly12_NB_IoT = 0x80F00000; // 1000 0000 1111 D^12 + D^11 + D^3 + D^2 + D + 1
|
||||
unsigned int poly8_NB_IoT = 0x9B000000; // 1001 1011 D^8 + D^7 + D^4 + D^3 + D + 1
|
||||
/*********************************************************
|
||||
|
||||
For initialization && verification purposes,
|
||||
bit by bit implementation with any polynomial
|
||||
|
||||
The first bit is in the MSB of each byte
|
||||
|
||||
*********************************************************/
|
||||
unsigned int crcbit_NB_IoT (unsigned char * inputptr, int octetlen, unsigned int poly)
|
||||
{
|
||||
unsigned int i, crc = 0, c;
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
|
||||
c = (*inputptr++) << 24;
|
||||
|
||||
for (i = 8; i != 0; i--) {
|
||||
|
||||
if ((1 << 31) & (c ^ crc))
|
||||
|
||||
crc = (crc << 1) ^ poly;
|
||||
|
||||
else
|
||||
|
||||
crc <<= 1;
|
||||
|
||||
c <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
/*********************************************************
|
||||
|
||||
crc table initialization
|
||||
|
||||
*********************************************************/
|
||||
static unsigned int crc24aTable_NB_IoT[256];
|
||||
static unsigned int crc24bTable_NB_IoT[256];
|
||||
static unsigned short crc16Table_NB_IoT[256];
|
||||
static unsigned short crc12Table_NB_IoT[256];
|
||||
static unsigned char crc8Table_NB_IoT[256];
|
||||
|
||||
void crcTableInit_NB_IoT (void)
|
||||
{
|
||||
unsigned char c = 0;
|
||||
|
||||
do {
|
||||
crc24aTable_NB_IoT[c] = crcbit_NB_IoT (&c, 1, poly24a_NB_IoT);
|
||||
crc24bTable_NB_IoT[c] = crcbit_NB_IoT (&c, 1, poly24b_NB_IoT);
|
||||
crc16Table_NB_IoT[c] = (unsigned short) (crcbit_NB_IoT (&c, 1, poly16_NB_IoT) >> 16);
|
||||
crc12Table_NB_IoT[c] = (unsigned short) (crcbit_NB_IoT (&c, 1, poly12_NB_IoT) >> 16);
|
||||
crc8Table_NB_IoT[c] = (unsigned char) (crcbit_NB_IoT (&c, 1, poly8_NB_IoT) >> 24);
|
||||
} while (++c);
|
||||
|
||||
}
|
||||
/*********************************************************
|
||||
|
||||
Byte by byte implementations,
|
||||
assuming initial byte is 0 padded (in MSB) if necessary
|
||||
|
||||
*********************************************************/
|
||||
unsigned int crc24a_NB_IoT (unsigned char * inptr, int bitlen)
|
||||
{
|
||||
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
|
||||
octetlen = bitlen / 8; /* Change in octets */
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
|
||||
crc = (crc << 8) ^ crc24aTable_NB_IoT[(*inptr++) ^ (crc >> 24)];
|
||||
|
||||
}
|
||||
|
||||
if (resbit > 0)
|
||||
|
||||
crc = (crc << resbit) ^ crc24aTable_NB_IoT[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
unsigned int crc24b_NB_IoT (unsigned char * inptr, int bitlen)
|
||||
{
|
||||
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
|
||||
octetlen = bitlen / 8; /* Change in octets */
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
|
||||
crc = (crc << 8) ^ crc24bTable_NB_IoT[(*inptr++) ^ (crc >> 24)];
|
||||
|
||||
}
|
||||
|
||||
if (resbit > 0)
|
||||
|
||||
crc = (crc << resbit) ^ crc24bTable_NB_IoT[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
unsigned int crc16_NB_IoT (unsigned char * inptr, int bitlen)
|
||||
{
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
|
||||
octetlen = bitlen / 8; /* Change in octets */
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
|
||||
crc = (crc << 8) ^ (crc16Table_NB_IoT[(*inptr++) ^ (crc >> 24)] << 16);
|
||||
|
||||
}
|
||||
|
||||
if (resbit > 0)
|
||||
|
||||
crc = (crc << resbit) ^ (crc16Table_NB_IoT[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 16);
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
unsigned int crc8_NB_IoT (unsigned char * inptr, int bitlen)
|
||||
{
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
octetlen = bitlen / 8; /* Change in octets */
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
crc = crc8Table_NB_IoT[(*inptr++) ^ (crc >> 24)] << 24;
|
||||
}
|
||||
|
||||
if (resbit > 0)
|
||||
crc = (crc << resbit) ^ (crc8Table_NB_IoT[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 24);
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
|
||||
//#ifdef DEBUG_CRC
|
||||
/*******************************************************************/
|
||||
/**
|
||||
Test code
|
||||
********************************************************************/
|
||||
|
||||
// #include <stdio.h>
|
||||
|
||||
// main()
|
||||
// {
|
||||
// unsigned char test[] = "Thebigredfox";
|
||||
// crcTableInit();
|
||||
// printf("%x\n", crcbit(test, sizeof(test) - 1, poly24));
|
||||
// printf("%x\n", crc24(test, (sizeof(test) - 1)*8));
|
||||
// printf("%x\n", crcbit(test, sizeof(test) - 1, poly8));
|
||||
// printf("%x\n", crc8(test, (sizeof(test) - 1)*8));
|
||||
// }
|
||||
//#endif
|
||||
|
||||
277
openair1/PHY/CODING/defs_NB_IoT.h
Normal file
277
openair1/PHY/CODING/defs_NB_IoT.h
Normal file
@@ -0,0 +1,277 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/* file: PHY/CODING/defs_NB_IoT.h
|
||||
purpose: Top-level definitions, data types and function prototypes for openairinterface coding blocks for NB-IoT
|
||||
author: matthieu.kanj@b-com.com, raymond.knopp@eurecom.fr, michele.paffetti@studio.unibo.it
|
||||
date: 29.06.2017
|
||||
*/
|
||||
|
||||
#ifndef OPENAIR1_PHY_CODING_DEFS_NB_IOT_H_
|
||||
#define OPENAIR1_PHY_CODING_DEFS_NB_IOT_H_
|
||||
|
||||
#include <stdint.h> // for uint8/16/32_t
|
||||
|
||||
/* check if this ifndef is required for NB-IoT ?!
|
||||
//#ifndef NO_OPENAIR1
|
||||
//#include "PHY/defs_NB_IoT.h"
|
||||
//#else
|
||||
//#include "PHY/TOOLS/time_meas.h"
|
||||
//#endif
|
||||
*/
|
||||
|
||||
#define CRC24_A_NB_IoT 0
|
||||
#define CRC24_B_NB_IoT 1
|
||||
#define CRC16_NB_IoT 2
|
||||
#define CRC8_NB_IoT 3
|
||||
|
||||
//#define MAX_TURBO_ITERATIONS_MBSFN 8 // no MBSFN
|
||||
#define MAX_TURBO_ITERATIONS_NB_IoT 4
|
||||
|
||||
#define LTE_NULL_NB_IoT 2 // defined also in PHY/LTE_TRANSPORT/defs_NB_IoT.h
|
||||
|
||||
/** \fn uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
\brief This is the subblock interleaving algorithm for convolutionally coded blocks from 36-212 (Release 13.4, 2017).
|
||||
This function takes the d-sequence and generates the w-sequence. The nu-sequence from 36-212 is implicit.
|
||||
\param D Number of input bits
|
||||
\param d Pointer to input (d-sequence, convolutional code output)
|
||||
\param w Pointer to output (w-sequence, interleaver output)
|
||||
\returns Interleaving matrix cardinality (\f$K_{\pi}\f$ from 36-212)
|
||||
*/
|
||||
uint32_t sub_block_interleaving_cc_NB_IoT(uint32_t D, uint8_t *d,uint8_t *w);
|
||||
|
||||
/**
|
||||
\brief This is the NB-IoT rate matching algorithm for Convolutionally-coded channels (e.g. BCH,DCI,UCI). It is taken directly from 36-212 (Rel 8 8.6, 2009-03), pages 16-18 )
|
||||
\param RCC R^CC_subblock from subblock interleaver (number of rows in interleaving matrix) for up to 8 segments
|
||||
\param E Number of coded channel bits
|
||||
\param w This is a pointer to the w-sequence (second interleaver output)
|
||||
\param e This is a pointer to the e-sequence (rate matching output, channel input/output bits)
|
||||
\returns \f$E\f$, the number of coded bits per segment */
|
||||
|
||||
uint32_t lte_rate_matching_cc_NB_IoT(uint32_t RCC, // RRC = 2
|
||||
uint16_t E, // E = 1600
|
||||
uint8_t *w, // length
|
||||
uint8_t *e); // length 1600
|
||||
|
||||
/** \fn void ccodelte_encode(int32_t numbits,uint8_t add_crc, uint8_t *inPtr,uint8_t *outPtr,uint16_t rnti)
|
||||
\brief This function implements the LTE convolutional code of rate 1/3
|
||||
with a constraint length of 7 bits. The inputs are bit packed in octets
|
||||
(from MSB to LSB). Trellis tail-biting is included here.
|
||||
@param numbits Number of bits to encode
|
||||
@param add_crc crc to be appended (8 bits) if add_crc = 1
|
||||
@param inPtr Pointer to input buffer
|
||||
@param outPtr Pointer to output buffer
|
||||
@param rnti RNTI for CRC scrambling
|
||||
*/
|
||||
|
||||
void ccode_encode_NB_IoT (int32_t numbits,
|
||||
uint8_t add_crc,
|
||||
uint8_t *inPtr,
|
||||
uint8_t *outPtr,
|
||||
uint16_t rnti);
|
||||
|
||||
/*!\fn void ccodelte_init(void)
|
||||
\brief This function initializes the generator polynomials for an LTE convolutional code.*/
|
||||
void ccodelte_init_NB_IoT(void);
|
||||
|
||||
void ccodelte_init2_NB_IoT(void);
|
||||
|
||||
/*!\fn void crcTableInit(void)
|
||||
\brief This function initializes the different crc tables.*/
|
||||
void crcTableInit_NB_IoT (void);
|
||||
|
||||
|
||||
/*!\fn uint32_t crc24a(uint8_t *inPtr, int32_t bitlen)
|
||||
\brief This computes a 24-bit crc ('a' variant for overall transport block)
|
||||
based on 3GPP UMTS/LTE specifications.
|
||||
@param inPtr Pointer to input byte stream
|
||||
@param bitlen length of inputs in bits
|
||||
*/
|
||||
uint32_t crc24a_NB_IoT (uint8_t *inPtr, int32_t bitlen);
|
||||
|
||||
/*!\fn uint32_t crc24b(uint8_t *inPtr, int32_t bitlen)
|
||||
\brief This computes a 24-bit crc ('b' variant for transport-block segments)
|
||||
based on 3GPP UMTS/LTE specifications.
|
||||
@param inPtr Pointer to input byte stream
|
||||
@param bitlen length of inputs in bits
|
||||
*/
|
||||
uint32_t crc24b_NB_IoT (uint8_t *inPtr, int32_t bitlen);
|
||||
|
||||
/*!\fn uint32_t crc16(uint8_t *inPtr, int32_t bitlen)
|
||||
\brief This computes a 16-bit crc based on 3GPP UMTS specifications.
|
||||
@param inPtr Pointer to input byte stream
|
||||
@param bitlen length of inputs in bits*/
|
||||
uint32_t crc16_NB_IoT (uint8_t *inPtr, int32_t bitlen);
|
||||
|
||||
/*!\fn uint32_t crc8(uint8_t *inPtr, int32_t bitlen)
|
||||
\brief This computes a 8-bit crc based on 3GPP UMTS specifications.
|
||||
@param inPtr Pointer to input byte stream
|
||||
@param bitlen length of inputs in bits*/
|
||||
uint32_t crc8_NB_IoT (uint8_t *inPtr, int32_t bitlen);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
uint32_t crcbit_NB_IoT (uint8_t * ,
|
||||
int32_t,
|
||||
uint32_t);
|
||||
|
||||
|
||||
/*!\fn void phy_viterbi_lte_sse2(int8_t *y, uint8_t *decoded_bytes, uint16_t n)
|
||||
\brief This routine performs a SIMD optmized Viterbi decoder for the LTE 64-state tail-biting convolutional code.
|
||||
@param y Pointer to soft input (coded on 8-bits but should be limited to 4-bit precision to avoid overflow)
|
||||
@param decoded_bytes Pointer to decoded output
|
||||
@param n Length of input/trellis depth in bits*/
|
||||
//void phy_viterbi_lte_sse2(int8_t *y,uint8_t *decoded_bytes,uint16_t n);
|
||||
void phy_viterbi_lte_sse2_NB_IoT(int8_t *y,uint8_t *decoded_bytes,uint16_t n);
|
||||
|
||||
/** \fn void sub_block_deinterleaving_cc(uint32_t D, int8_t *d,int8_t *w)
|
||||
\brief This is the subblock deinterleaving algorithm for convolutionally-coded data from 36-212 (Release 8, 8.6 2009-03), pages 15-16.
|
||||
This function takes the w-sequence and generates the d-sequence. The nu-sequence from 36-212 is implicit.
|
||||
\param D Number of input bits
|
||||
\param d Pointer to output (d-sequence, turbo code output)
|
||||
\param w Pointer to input (w-sequence, interleaver output)
|
||||
*/
|
||||
void sub_block_deinterleaving_cc_NB_IoT(uint32_t D,int8_t *d,int8_t *w);
|
||||
|
||||
|
||||
/*
|
||||
\brief This is the LTE rate matching algorithm for Convolutionally-coded channels (e.g. BCH,DCI,UCI). It is taken directly from 36-212 (Rel 8 8.6, 2009-03), pages 16-18 )
|
||||
\param RCC R^CC_subblock from subblock interleaver (number of rows in interleaving matrix)
|
||||
\param E This the number of coded bits allocated for channel
|
||||
\param w This is a pointer to the soft w-sequence (second interleaver output) with soft-combined outputs from successive HARQ rounds
|
||||
\param dummy_w This is the first row of the interleaver matrix for identifying/discarding the "LTE-NULL" positions
|
||||
\param soft_input This is a pointer to the soft channel output
|
||||
\returns \f$E\f$, the number of coded bits per segment
|
||||
*/
|
||||
void lte_rate_matching_cc_rx_NB_IoT(uint32_t RCC,
|
||||
uint16_t E,
|
||||
int8_t *w,
|
||||
uint8_t *dummy_w,
|
||||
int8_t *soft_input);
|
||||
|
||||
/** \fn generate_dummy_w_cc(uint32_t D, uint8_t *w)
|
||||
\brief This function generates a dummy interleaved sequence (first row) for receiver (convolutionally-coded data), in order to identify the NULL positions used to make the matrix complete.
|
||||
\param D Number of systematic bits plus 4 (plus 4 for termination)
|
||||
\param w This is the dummy sequence (first row), it will contain zeros and at most 31 "LTE_NULL" values
|
||||
\returns Interleaving matrix cardinality (\f$K_{\pi}\f$ from 36-212)
|
||||
*/
|
||||
uint32_t generate_dummy_w_cc_NB_IoT(uint32_t D, uint8_t *w);
|
||||
|
||||
/** \fn lte_segmentation(uint8_t *input_buffer,
|
||||
uint8_t **output_buffers,
|
||||
uint32_t B,
|
||||
uint32_t *C,
|
||||
uint32_t *Cplus,
|
||||
uint32_t *Cminus,
|
||||
uint32_t *Kplus,
|
||||
uint32_t *Kminus,
|
||||
uint32_t *F)
|
||||
\brief This function implements the LTE transport block segmentation algorithm from 36-212, V8.6 2009-03.
|
||||
@param input_buffer
|
||||
@param output_buffers
|
||||
@param B
|
||||
@param C
|
||||
@param Cplus
|
||||
@param Cminus
|
||||
@param Kplus
|
||||
@param Kminus
|
||||
@param F
|
||||
*/
|
||||
int32_t lte_segmentation_NB_IoT(uint8_t *input_buffer,
|
||||
uint8_t **output_buffers,
|
||||
uint32_t B,
|
||||
uint32_t *C,
|
||||
uint32_t *Cplus,
|
||||
uint32_t *Cminus,
|
||||
uint32_t *Kplus,
|
||||
uint32_t *Kminus,
|
||||
uint32_t *F);
|
||||
|
||||
/** \fn void sub_block_deinterleaving_turbo(uint32_t D, int16_t *d,int16_t *w)
|
||||
\brief This is the subblock deinterleaving algorithm from 36-212 (Release 8, 8.6 2009-03), pages 15-16.
|
||||
This function takes the w-sequence and generates the d-sequence. The nu-sequence from 36-212 is implicit.
|
||||
\param D Number of systematic bits plus 4 (plus 4 for termination)
|
||||
\param d Pointer to output (d-sequence, turbo code output)
|
||||
\param w Pointer to input (w-sequence, interleaver output)
|
||||
*/
|
||||
//*****************void sub_block_deinterleaving_turbo(uint32_t D, int16_t *d,int16_t *w);
|
||||
|
||||
/**
|
||||
\brief This is the LTE rate matching algorithm for Turbo-coded channels (e.g. DLSCH,ULSCH). It is taken directly from 36-212 (Rel 8 8.6, 2009-03), pages 16-18 )
|
||||
\param RTC R^TC_subblock from subblock interleaver (number of rows in interleaving matrix)
|
||||
\param G This the number of coded transport bits allocated in sub-frame
|
||||
\param w This is a pointer to the soft w-sequence (second interleaver output) with soft-combined outputs from successive HARQ rounds
|
||||
\param dummy_w This is the first row of the interleaver matrix for identifying/discarding the "LTE-NULL" positions
|
||||
\param soft_input This is a pointer to the soft channel output
|
||||
\param C Number of segments (codewords) in the sub-frame
|
||||
\param Nsoft Total number of soft bits (from UE capabilities in 36-306)
|
||||
\param Mdlharq Number of HARQ rounds
|
||||
\param Kmimo MIMO capability for this DLSCH (0 = no MIMO)
|
||||
\param rvidx round index (0-3)
|
||||
\param clear 1 means clear soft buffer (start of HARQ round)
|
||||
\param Qm modulation order (2,4,6)
|
||||
\param Nl number of layers (1,2)
|
||||
\param r segment number
|
||||
\param E_out the number of coded bits per segment
|
||||
\returns 0 on success, -1 on failure
|
||||
*/
|
||||
|
||||
// int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
// uint32_t G,
|
||||
// int16_t *w,
|
||||
// uint8_t *dummy_w,
|
||||
// int16_t *soft_input,
|
||||
// uint8_t C,
|
||||
// uint32_t Nsoft,
|
||||
// uint8_t Mdlharq,
|
||||
// uint8_t Kmimo,
|
||||
// uint8_t rvidx,
|
||||
// uint8_t clear,
|
||||
// uint8_t Qm,
|
||||
// uint8_t Nl,
|
||||
// uint8_t r,
|
||||
// uint32_t *E_out);
|
||||
|
||||
// uint32_t lte_rate_matching_turbo_rx_abs(uint32_t RTC,
|
||||
// uint32_t G,
|
||||
// double *w,
|
||||
// uint8_t *dummy_w,
|
||||
// double *soft_input,
|
||||
// uint8_t C,
|
||||
// uint32_t Nsoft,
|
||||
// uint8_t Mdlharq,
|
||||
// uint8_t Kmimo,
|
||||
// uint8_t rvidx,
|
||||
// uint8_t clear,
|
||||
// uint8_t Qm,
|
||||
// uint8_t Nl,
|
||||
// uint8_t r,
|
||||
// uint32_t *E_out);
|
||||
|
||||
void ccode_encode_npdsch_NB_IoT (int32_t numbits,
|
||||
uint8_t *inPtr,
|
||||
uint8_t *outPtr,
|
||||
uint32_t crc);
|
||||
|
||||
#endif /* OPENAIR1_PHY_CODING_DEFS_NB_IOT_H_ */
|
||||
223
openair1/PHY/CODING/lte_rate_matching_NB_IoT.c
Normal file
223
openair1/PHY/CODING/lte_rate_matching_NB_IoT.c
Normal file
@@ -0,0 +1,223 @@
|
||||
/***********************************************************************
|
||||
|
||||
**********************************************************************/
|
||||
/*! \file PHY/LTE_CODING/lte_rate_matching_NB_IoT.c
|
||||
* \Procedures for rate matching/interleaving for NB-IoT (turbo-coded transport channels) (TX/RX), TS 36-212, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
/* // check if this ifdef MAIN is required for NB-IoT
|
||||
#ifdef MAIN
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
*/
|
||||
|
||||
//#include "PHY/CODING/defs_NB_IoT.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
//#include "assertions.h"
|
||||
|
||||
//#include "PHY/LTE_REFSIG/defs_NB_IoT.h" // does this file is needed ?
|
||||
|
||||
static uint32_t bitrev_cc_NB_IoT[32] = {1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31,0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30};
|
||||
|
||||
uint32_t sub_block_interleaving_cc_NB_IoT(uint32_t D, uint8_t *d,uint8_t *w)
|
||||
{
|
||||
uint32_t RCC = (D>>5), ND, ND3; // D = 50 ,
|
||||
uint32_t row,col,Kpi,index;
|
||||
uint32_t index3,k;
|
||||
|
||||
if ((D&0x1f) > 0)
|
||||
RCC++;
|
||||
|
||||
Kpi = (RCC<<5); // Kpi = 32
|
||||
ND = Kpi - D;
|
||||
ND3 = ND*3; // ND3 = ND*3 = 18 *3 = 54
|
||||
k=0;
|
||||
|
||||
for (col=0; col<32; col++) {
|
||||
|
||||
index = bitrev_cc_NB_IoT[col];
|
||||
index3 = 3*index;
|
||||
|
||||
for (row=0; row<RCC; row++) {
|
||||
|
||||
w[k] = d[(int32_t)index3-(int32_t)ND3];
|
||||
w[Kpi+k] = d[(int32_t)index3-(int32_t)ND3+1];
|
||||
w[(Kpi<<1)+k] = d[(int32_t)index3-(int32_t)ND3+2];
|
||||
|
||||
index3+=96;
|
||||
index+=32;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
return(RCC);
|
||||
}
|
||||
|
||||
|
||||
uint32_t lte_rate_matching_cc_NB_IoT(uint32_t RCC, // RRC = 2
|
||||
uint16_t E, // E = 1600
|
||||
uint8_t *w, // length
|
||||
uint8_t *e) // length 1600
|
||||
{
|
||||
uint32_t ind=0,k;
|
||||
uint16_t Kw = 3*(RCC<<5); // 3*64 = 192
|
||||
|
||||
for (k=0; k<E; k++) {
|
||||
|
||||
while(w[ind] == LTE_NULL_NB_IoT) {
|
||||
|
||||
ind++;
|
||||
|
||||
if (ind==Kw)
|
||||
ind=0;
|
||||
}
|
||||
|
||||
e[k] = w[ind];
|
||||
ind++;
|
||||
|
||||
if (ind==Kw)
|
||||
ind=0;
|
||||
}
|
||||
|
||||
return(E);
|
||||
}
|
||||
|
||||
//******************* below functions related to uplink transmission , to be reviwed *********
|
||||
// this function should be adapted to NB-IoT , this deinterleaving is for LTE
|
||||
void sub_block_deinterleaving_cc_NB_IoT(uint32_t D,int8_t *d,int8_t *w)
|
||||
{
|
||||
|
||||
//WANG_Hao uint32_t RCC = (D>>5), ND, ND3;
|
||||
uint32_t RCC = (D>>5);
|
||||
ptrdiff_t ND, ND3;
|
||||
uint32_t row,col,Kpi,index;
|
||||
//WANG_Hao uint32_t index3,k;
|
||||
ptrdiff_t index3;
|
||||
uint32_t k;
|
||||
|
||||
if ((D&0x1f) > 0)
|
||||
RCC++;
|
||||
|
||||
Kpi = (RCC<<5);
|
||||
// Kpi3 = Kpi*3;
|
||||
ND = Kpi - D;
|
||||
|
||||
ND3 = ND*3;
|
||||
|
||||
k=0;
|
||||
|
||||
for (col=0; col<32; col++) {
|
||||
|
||||
index = bitrev_cc_NB_IoT[col];
|
||||
index3 = 3*index;
|
||||
|
||||
for (row=0; row<RCC; row++) {
|
||||
|
||||
d[index3-ND3] = w[k];
|
||||
d[index3-ND3+1] = w[Kpi+k];
|
||||
d[index3-ND3+2] = w[(Kpi<<1)+k];
|
||||
|
||||
index3+=96;
|
||||
index+=32;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void lte_rate_matching_cc_rx_NB_IoT(uint32_t RCC,
|
||||
uint16_t E,
|
||||
int8_t *w,
|
||||
uint8_t *dummy_w,
|
||||
int8_t *soft_input)
|
||||
{
|
||||
|
||||
|
||||
|
||||
uint32_t ind=0,k;
|
||||
uint16_t Kw = 3*(RCC<<5);
|
||||
uint32_t acc=1;
|
||||
int16_t w16[Kw];
|
||||
|
||||
memset(w,0,Kw);
|
||||
memset(w16,0,Kw*sizeof(int16_t));
|
||||
|
||||
for (k=0; k<E; k++) {
|
||||
|
||||
|
||||
while(dummy_w[ind] == LTE_NULL_NB_IoT) {
|
||||
|
||||
ind++;
|
||||
|
||||
if (ind==Kw)
|
||||
ind=0;
|
||||
}
|
||||
|
||||
|
||||
w16[ind] += soft_input[k];
|
||||
|
||||
ind++;
|
||||
|
||||
if (ind==Kw) {
|
||||
ind=0;
|
||||
acc++;
|
||||
}
|
||||
}
|
||||
|
||||
// rescale
|
||||
for (ind=0; ind<Kw; ind++) {
|
||||
// w16[ind]=(w16[ind]/acc);
|
||||
if (w16[ind]>7)
|
||||
w[ind]=7;
|
||||
else if (w16[ind]<-8)
|
||||
w[ind]=-8;
|
||||
else
|
||||
w[ind]=(int8_t)w16[ind];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
uint32_t generate_dummy_w_cc_NB_IoT(uint32_t D, uint8_t *w)
|
||||
{
|
||||
|
||||
uint32_t RCC = (D>>5), ND;
|
||||
uint32_t col,Kpi,index;
|
||||
int32_t k;
|
||||
|
||||
if ((D&0x1f) > 0)
|
||||
RCC++;
|
||||
|
||||
Kpi = (RCC<<5);
|
||||
// Kpi3 = Kpi*3;
|
||||
ND = Kpi - D;
|
||||
|
||||
// copy d02 to dD2 (for mod Kpi operation from clause (4), p.16 of 36.212
|
||||
k=0;
|
||||
|
||||
for (col=0; col<32; col++) {
|
||||
|
||||
index = bitrev_cc_NB_IoT[col];
|
||||
|
||||
if (index<ND) {
|
||||
w[k] = LTE_NULL_NB_IoT;
|
||||
w[Kpi+k] = LTE_NULL_NB_IoT;
|
||||
w[(Kpi<<1)+k] = LTE_NULL_NB_IoT;
|
||||
|
||||
}
|
||||
|
||||
|
||||
k+=RCC;
|
||||
}
|
||||
|
||||
return(RCC);
|
||||
}
|
||||
152
openair1/PHY/CODING/lte_segmentation_NB_IoT.c
Normal file
152
openair1/PHY/CODING/lte_segmentation_NB_IoT.c
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/* file: lte_segmentation.c
|
||||
purpose: Procedures for transport block segmentation for LTE (turbo-coded transport channels)
|
||||
author: raymond.knopp@eurecom.fr
|
||||
date: 21.10.2009
|
||||
*/
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "SCHED/extern_NB_IoT.h"
|
||||
|
||||
//#define DEBUG_SEGMENTATION
|
||||
|
||||
int lte_segmentation_NB_IoT(unsigned char *input_buffer,
|
||||
unsigned char **output_buffers,
|
||||
unsigned int B,
|
||||
unsigned int *C,
|
||||
unsigned int *Cplus,
|
||||
unsigned int *Cminus,
|
||||
unsigned int *Kplus,
|
||||
unsigned int *Kminus,
|
||||
unsigned int *F)
|
||||
{
|
||||
|
||||
unsigned int L,Bprime,Bprime_by_C,r,Kr,k,s,crc;
|
||||
|
||||
if (B<=6144) {
|
||||
L=0;
|
||||
*C=1;
|
||||
Bprime=B;
|
||||
} else {
|
||||
L=24;
|
||||
*C = B/(6144-L);
|
||||
|
||||
if ((6144-L)*(*C) < B)
|
||||
*C=*C+1;
|
||||
|
||||
Bprime = B+((*C)*L);
|
||||
}
|
||||
|
||||
if ((*C)>MAX_NUM_DLSCH_SEGMENTS_NB_IoT) {
|
||||
LOG_E(PHY,"lte_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// Find K+
|
||||
Bprime_by_C = Bprime/(*C);
|
||||
|
||||
if (Bprime_by_C <= 40) {
|
||||
*Kplus = 40;
|
||||
*Kminus = 0;
|
||||
} else if (Bprime_by_C<=512) { // increase by 1 byte til here
|
||||
*Kplus = (Bprime_by_C>>3)<<3;
|
||||
*Kminus = Bprime_by_C-8;
|
||||
} else if (Bprime_by_C <=1024) { // increase by 2 bytes til here
|
||||
*Kplus = (Bprime_by_C>>4)<<4;
|
||||
|
||||
if (*Kplus < Bprime_by_C)
|
||||
*Kplus = *Kplus + 16;
|
||||
|
||||
*Kminus = (*Kplus - 16);
|
||||
} else if (Bprime_by_C <= 2048) { // increase by 4 bytes til here
|
||||
*Kplus = (Bprime_by_C>>5)<<5;
|
||||
|
||||
if (*Kplus < Bprime_by_C)
|
||||
*Kplus = *Kplus + 32;
|
||||
|
||||
*Kminus = (*Kplus - 32);
|
||||
} else if (Bprime_by_C <=6144 ) { // increase by 8 bytes til here
|
||||
|
||||
*Kplus = (Bprime_by_C>>6)<<6;
|
||||
|
||||
|
||||
if (*Kplus < Bprime_by_C)
|
||||
*Kplus = *Kplus + 64;
|
||||
|
||||
*Kminus = (*Kplus - 64);
|
||||
} else {
|
||||
msg("lte_segmentation.c: Illegal codeword size !!!\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (*C == 1) {
|
||||
*Cplus = *C;
|
||||
*Kminus = 0;
|
||||
*Cminus = 0;
|
||||
} else {
|
||||
|
||||
// printf("More than one segment (%d), exiting \n",*C);
|
||||
// exit(-1);
|
||||
*Cminus = ((*C)*(*Kplus) - (Bprime))/((*Kplus) - (*Kminus));
|
||||
*Cplus = (*C) - (*Cminus);
|
||||
}
|
||||
|
||||
*F = ((*Cplus)*(*Kplus) + (*Cminus)*(*Kminus) - (Bprime));
|
||||
|
||||
if ((input_buffer) && (output_buffers)) {
|
||||
|
||||
for (k=0; k<*F>>3; k++) {
|
||||
output_buffers[0][k] = 0;
|
||||
}
|
||||
|
||||
s=0;
|
||||
|
||||
for (r=0; r<*C; r++) {
|
||||
|
||||
if (r<*Cminus)
|
||||
Kr = *Kminus;
|
||||
else
|
||||
Kr = *Kplus;
|
||||
|
||||
while (k<((Kr - L)>>3)) {
|
||||
output_buffers[r][k] = input_buffer[s];
|
||||
// printf("encoding segment %d : byte %d (%d) => %d\n",r,k,Kr>>3,input_buffer[s]);
|
||||
k++;
|
||||
s++;
|
||||
}
|
||||
|
||||
if (*C > 1) { // add CRC
|
||||
crc = crc24b_NB_IoT(output_buffers[r],Kr-24)>>8;
|
||||
output_buffers[r][(Kr-24)>>3] = ((uint8_t*)&crc)[2];
|
||||
output_buffers[r][1+((Kr-24)>>3)] = ((uint8_t*)&crc)[1];
|
||||
output_buffers[r][2+((Kr-24)>>3)] = ((uint8_t*)&crc)[0];
|
||||
|
||||
}
|
||||
|
||||
k=0;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
336
openair1/PHY/CODING/viterbi_lte_NB_IoT.c
Normal file
336
openair1/PHY/CODING/viterbi_lte_NB_IoT.c
Normal file
@@ -0,0 +1,336 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/* file: viterbit_lte.c
|
||||
purpose: SIMD optimized LTE Viterbi Decoder for rate 1/3 Tail-biting convolutional code. Performs two iterations
|
||||
of code. First pass does Viterbi with all initial partial metrics set to zero. Second pass does Viterbi
|
||||
with initial partial metrics set to values from final state values after first pass. Max is selected at
|
||||
end to do trace-back.
|
||||
author: raymond.knopp@eurecom.fr
|
||||
date: 21.10.2009
|
||||
*/
|
||||
|
||||
#ifdef USER_MODE
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifndef TEST_DEBUG
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define msg printf
|
||||
#endif
|
||||
|
||||
|
||||
#include "PHY/sse_intrin.h"
|
||||
|
||||
//extern uint8_t ccodelte_table[128],ccodelte_table_rev[128];
|
||||
|
||||
|
||||
|
||||
|
||||
static int8_t m0_table[64*16*16*16] __attribute__ ((aligned(16)));
|
||||
static int8_t m1_table[64*16*16*16] __attribute__ ((aligned(16)));
|
||||
|
||||
|
||||
|
||||
void phy_viterbi_lte_sse2_NB_IoT(int8_t *y,uint8_t *decoded_bytes,uint16_t n)
|
||||
{
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i TB[4*8192];
|
||||
__m128i *m0_ptr,*m1_ptr,*TB_ptr = &TB[0];
|
||||
|
||||
__m128i metrics0_15,metrics16_31,metrics32_47,metrics48_63,even0_30a,even0_30b,even32_62a,even32_62b,odd1_31a,odd1_31b,odd33_63a,odd33_63b,TBeven0_30,TBeven32_62,TBodd1_31,
|
||||
TBodd33_63;
|
||||
|
||||
__m128i min_state,min_state2;
|
||||
|
||||
#elif defined(__arm__)
|
||||
uint8x16x2_t TB[2*8192]; // 2 int8x16_t per input bit, 8 bits / byte, 8192 is largest packet size in bits
|
||||
|
||||
uint8x16_t even0_30a,even0_30b,even32_62a,even32_62b,odd1_31a,odd1_31b,odd33_63a,odd33_63b,TBeven0_30,TBeven32_62,TBodd1_31,TBodd33_63;
|
||||
uint8x16x2_t metrics0_31,metrics32_63;
|
||||
|
||||
uint8x16_t min_state;
|
||||
|
||||
uint8x16_t *m0_ptr,*m1_ptr;
|
||||
uint8x16x2_t *TB_ptr = &TB[0];
|
||||
|
||||
|
||||
#endif
|
||||
int8_t *in = y;
|
||||
uint8_t prev_state0,maxm,s;
|
||||
static uint8_t *TB_ptr2;
|
||||
uint32_t table_offset;
|
||||
uint8_t iter;
|
||||
int16_t position;
|
||||
|
||||
// set initial metrics
|
||||
//debug_msg("Doing viterbi\n");
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
|
||||
metrics0_15 = _mm_setzero_si128();
|
||||
metrics16_31 = _mm_setzero_si128();
|
||||
metrics32_47 = _mm_setzero_si128();
|
||||
metrics48_63 = _mm_setzero_si128();
|
||||
#elif defined(__arm__)
|
||||
metrics0_31.val[0] = vdupq_n_u8(0);
|
||||
metrics0_31.val[1] = vdupq_n_u8(0);
|
||||
metrics32_63.val[0] = vdupq_n_u8(0);
|
||||
metrics32_63.val[1] = vdupq_n_u8(0);
|
||||
#endif
|
||||
|
||||
for (iter=0; iter<2; iter++) {
|
||||
in = y;
|
||||
TB_ptr=&TB[0];
|
||||
|
||||
for (position=0; position<n; position++) {
|
||||
|
||||
|
||||
// get branch metric offsets for the 64 states
|
||||
table_offset = (in[0]+8 + ((in[1]+8)<<4) + ((in[2]+8)<<8))<<6;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
m0_ptr = (__m128i *)&m0_table[table_offset];
|
||||
m1_ptr = (__m128i *)&m1_table[table_offset];
|
||||
|
||||
// even states
|
||||
even0_30a = _mm_adds_epu8(metrics0_15,m0_ptr[0]);
|
||||
even32_62a = _mm_adds_epu8(metrics16_31,m0_ptr[1]);
|
||||
even0_30b = _mm_adds_epu8(metrics32_47,m0_ptr[2]);
|
||||
even32_62b = _mm_adds_epu8(metrics48_63,m0_ptr[3]);
|
||||
|
||||
|
||||
// odd states
|
||||
odd1_31a = _mm_adds_epu8(metrics0_15,m1_ptr[0]);
|
||||
odd33_63a = _mm_adds_epu8(metrics16_31,m1_ptr[1]);
|
||||
odd1_31b = _mm_adds_epu8(metrics32_47,m1_ptr[2]);
|
||||
odd33_63b = _mm_adds_epu8(metrics48_63,m1_ptr[3]);
|
||||
|
||||
// select maxima
|
||||
|
||||
even0_30a = _mm_max_epu8(even0_30a,even0_30b);
|
||||
even32_62a = _mm_max_epu8(even32_62a,even32_62b);
|
||||
odd1_31a = _mm_max_epu8(odd1_31a,odd1_31b);
|
||||
odd33_63a = _mm_max_epu8(odd33_63a,odd33_63b);
|
||||
|
||||
// Traceback information
|
||||
|
||||
TBeven0_30 = _mm_cmpeq_epi8(even0_30a,even0_30b);
|
||||
TBeven32_62 = _mm_cmpeq_epi8(even32_62a,even32_62b);
|
||||
TBodd1_31 = _mm_cmpeq_epi8(odd1_31a,odd1_31b);
|
||||
TBodd33_63 = _mm_cmpeq_epi8(odd33_63a,odd33_63b);
|
||||
|
||||
metrics0_15 = _mm_unpacklo_epi8(even0_30a ,odd1_31a);
|
||||
metrics16_31 = _mm_unpackhi_epi8(even0_30a ,odd1_31a);
|
||||
metrics32_47 = _mm_unpacklo_epi8(even32_62a,odd33_63a);
|
||||
metrics48_63 = _mm_unpackhi_epi8(even32_62a,odd33_63a);
|
||||
|
||||
TB_ptr[0] = _mm_unpacklo_epi8(TBeven0_30,TBodd1_31);
|
||||
TB_ptr[1] = _mm_unpackhi_epi8(TBeven0_30,TBodd1_31);
|
||||
TB_ptr[2] = _mm_unpacklo_epi8(TBeven32_62,TBodd33_63);
|
||||
TB_ptr[3] = _mm_unpackhi_epi8(TBeven32_62,TBodd33_63);
|
||||
|
||||
|
||||
in+=3;
|
||||
TB_ptr += 4;
|
||||
|
||||
// rescale by subtracting minimum
|
||||
/****************************************************
|
||||
USE SSSE instruction phminpos!!!!!!!
|
||||
****************************************************/
|
||||
min_state =_mm_min_epu8(metrics0_15,metrics16_31);
|
||||
min_state =_mm_min_epu8(min_state,metrics32_47);
|
||||
min_state =_mm_min_epu8(min_state,metrics48_63);
|
||||
|
||||
min_state2 = min_state;
|
||||
min_state = _mm_unpacklo_epi8(min_state,min_state);
|
||||
min_state2 = _mm_unpackhi_epi8(min_state2,min_state2);
|
||||
min_state = _mm_min_epu8(min_state,min_state2);
|
||||
|
||||
min_state2 = min_state;
|
||||
min_state = _mm_unpacklo_epi8(min_state,min_state);
|
||||
min_state2 = _mm_unpackhi_epi8(min_state2,min_state2);
|
||||
min_state = _mm_min_epu8(min_state,min_state2);
|
||||
|
||||
min_state2 = min_state;
|
||||
min_state = _mm_unpacklo_epi8(min_state,min_state);
|
||||
min_state2 = _mm_unpackhi_epi8(min_state2,min_state2);
|
||||
min_state = _mm_min_epu8(min_state,min_state2);
|
||||
|
||||
min_state2 = min_state;
|
||||
min_state = _mm_unpacklo_epi8(min_state,min_state);
|
||||
min_state2 = _mm_unpackhi_epi8(min_state2,min_state2);
|
||||
min_state = _mm_min_epu8(min_state,min_state2);
|
||||
|
||||
metrics0_15 = _mm_subs_epu8(metrics0_15,min_state);
|
||||
metrics16_31 = _mm_subs_epu8(metrics16_31,min_state);
|
||||
metrics32_47 = _mm_subs_epu8(metrics32_47,min_state);
|
||||
metrics48_63 = _mm_subs_epu8(metrics48_63,min_state);
|
||||
#elif defined(__arm__)
|
||||
m0_ptr = (uint8x16_t *)&m0_table[table_offset];
|
||||
m1_ptr = (uint8x16_t *)&m1_table[table_offset];
|
||||
|
||||
|
||||
// even states
|
||||
even0_30a = vqaddq_u8(metrics0_31.val[0],m0_ptr[0]);
|
||||
even32_62a = vqaddq_u8(metrics0_31.val[1],m0_ptr[1]);
|
||||
even0_30b = vqaddq_u8(metrics32_63.val[0],m0_ptr[2]);
|
||||
even32_62b = vqaddq_u8(metrics32_63.val[1],m0_ptr[3]);
|
||||
|
||||
// odd states
|
||||
odd1_31a = vqaddq_u8(metrics0_31.val[0],m1_ptr[0]);
|
||||
odd33_63a = vqaddq_u8(metrics0_31.val[1],m1_ptr[1]);
|
||||
odd1_31b = vqaddq_u8(metrics32_63.val[0],m1_ptr[2]);
|
||||
odd33_63b = vqaddq_u8(metrics32_63.val[1],m1_ptr[3]);
|
||||
// select maxima
|
||||
even0_30a = vmaxq_u8(even0_30a,even0_30b);
|
||||
even32_62a = vmaxq_u8(even32_62a,even32_62b);
|
||||
odd1_31a = vmaxq_u8(odd1_31a,odd1_31b);
|
||||
odd33_63a = vmaxq_u8(odd33_63a,odd33_63b);
|
||||
|
||||
// Traceback information
|
||||
TBeven0_30 = vceqq_u8(even0_30a,even0_30b);
|
||||
TBeven32_62 = vceqq_u8(even32_62a,even32_62b);
|
||||
TBodd1_31 = vceqq_u8(odd1_31a,odd1_31b);
|
||||
TBodd33_63 = vceqq_u8(odd33_63a,odd33_63b);
|
||||
|
||||
metrics0_31 = vzipq_u8(even0_30a,odd1_31a);
|
||||
metrics32_63 = vzipq_u8(even32_62a,odd33_63a);
|
||||
|
||||
TB_ptr[0] = vzipq_u8(TBeven0_30,TBodd1_31);
|
||||
TB_ptr[1] = vzipq_u8(TBeven32_62,TBodd33_63);
|
||||
|
||||
in+=2;
|
||||
TB_ptr += 2;
|
||||
|
||||
// rescale by subtracting minimum
|
||||
/****************************************************
|
||||
USE SSSE instruction phminpos!!!!!!!
|
||||
****************************************************/
|
||||
min_state =vminq_u8(metrics0_31.val[0],metrics0_31.val[1]);
|
||||
min_state =vminq_u8(min_state,metrics32_63.val[0]);
|
||||
min_state =vminq_u8(min_state,metrics32_63.val[1]);
|
||||
// here we have 16 maximum metrics from the 64 states
|
||||
uint8x8_t min_state2 = vpmin_u8(((uint8x8_t*)&min_state)[0],((uint8x8_t*)&min_state)[0]);
|
||||
// now the 8 maximum in min_state2
|
||||
min_state2 = vpmin_u8(min_state2,min_state2);
|
||||
// now the 4 maximum in min_state2, repeated twice
|
||||
min_state2 = vpmin_u8(min_state2,min_state2);
|
||||
// now the 2 maximum in min_state2, repeated 4 times
|
||||
min_state2 = vpmin_u8(min_state2,min_state2);
|
||||
// now the 1 maximum in min_state2, repeated 8 times
|
||||
min_state = vcombine_u8(min_state2,min_state2);
|
||||
// now the 1 maximum in min_state, repeated 16 times
|
||||
metrics0_31.val[0] = vqsubq_u8(metrics0_31.val[0],min_state);
|
||||
metrics0_31.val[1] = vqsubq_u8(metrics0_31.val[1],min_state);
|
||||
metrics32_63.val[0] = vqsubq_u8(metrics32_63.val[0],min_state);
|
||||
metrics32_63.val[1] = vqsubq_u8(metrics32_63.val[1],min_state);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // iteration
|
||||
|
||||
// Traceback
|
||||
prev_state0 = 0;
|
||||
maxm = 0;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
for (s=0; s<16; s++)
|
||||
if (((uint8_t *)&metrics0_15)[s] > maxm) {
|
||||
maxm = ((uint8_t *)&metrics0_15)[s];
|
||||
prev_state0 = s;
|
||||
}
|
||||
|
||||
for (s=0; s<16; s++)
|
||||
if (((uint8_t *)&metrics16_31)[s] > maxm) {
|
||||
maxm = ((uint8_t *)&metrics16_31)[s];
|
||||
prev_state0 = s+16;
|
||||
}
|
||||
|
||||
for (s=0; s<16; s++)
|
||||
if (((uint8_t *)&metrics32_47)[s] > maxm) {
|
||||
maxm = ((uint8_t *)&metrics32_47)[s];
|
||||
prev_state0 = s+32;
|
||||
}
|
||||
|
||||
for (s=0; s<16; s++)
|
||||
if (((uint8_t *)&metrics48_63)[s] > maxm) {
|
||||
maxm = ((uint8_t *)&metrics48_63)[s];
|
||||
prev_state0 = s+48;
|
||||
}
|
||||
|
||||
|
||||
#elif defined(__arm__)
|
||||
for (s=0; s<16; s++)
|
||||
if (((uint8_t *)&metrics0_31.val[0])[s] > maxm) {
|
||||
maxm = ((uint8_t *)&metrics0_31.val[0])[s];
|
||||
prev_state0 = s;
|
||||
}
|
||||
|
||||
for (s=0; s<16; s++)
|
||||
if (((uint8_t *)&metrics0_31.val[1])[s] > maxm) {
|
||||
maxm = ((uint8_t *)&metrics0_31.val[1])[s];
|
||||
prev_state0 = s+16;
|
||||
}
|
||||
|
||||
for (s=0; s<16; s++)
|
||||
if (((uint8_t *)&metrics32_63.val[0])[s] > maxm) {
|
||||
maxm = ((uint8_t *)&metrics32_63.val[0])[s];
|
||||
prev_state0 = s+32;
|
||||
}
|
||||
|
||||
for (s=0; s<16; s++)
|
||||
if (((uint8_t *)&metrics32_63.val[1])[s] > maxm) {
|
||||
maxm = ((uint8_t *)&metrics32_63.val[1])[s];
|
||||
prev_state0 = s+48;
|
||||
}
|
||||
#endif
|
||||
|
||||
TB_ptr2 = (uint8_t *)&TB[(n-1)*4];
|
||||
|
||||
for (position = n-1 ; position>-1; position--) {
|
||||
|
||||
decoded_bytes[(position)>>3] += (prev_state0 & 0x1)<<(7-(position & 0x7));
|
||||
|
||||
|
||||
if (TB_ptr2[prev_state0] == 0)
|
||||
prev_state0 = (prev_state0 >> 1);
|
||||
else
|
||||
prev_state0 = 32 + (prev_state0>>1);
|
||||
|
||||
TB_ptr2-=64;
|
||||
}
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "PHY/defs.h"
|
||||
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
|
||||
#include "SystemInformationBlockType2.h"
|
||||
//#include "RadioResourceConfigCommonSIB.h"
|
||||
@@ -338,6 +339,9 @@ void phy_cleanup(void);
|
||||
|
||||
|
||||
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
|
||||
|
||||
|
||||
|
||||
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
@@ -353,5 +357,31 @@ void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
uint8_t osf,
|
||||
uint32_t perfect_ce);
|
||||
/** @} */
|
||||
|
||||
|
||||
//////////////////////// for NB-IoT ////////////////////////////////////////////
|
||||
|
||||
int init_frame_parms_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,uint8_t osf);
|
||||
|
||||
void phy_init_lte_top_NB_IoT(NB_IoT_DL_FRAME_PARMS *lte_frame_parms);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Allocate and initialize the PHY variables relevant to the LTE implementation (eNB).
|
||||
\details Only a subset of phy_vars_eNb is initialized.
|
||||
@param[out] phy_vars_eNb Pointer to eNB Variables
|
||||
@param is_secondary_eNb Flag to indicate this eNB gets synch from another
|
||||
@param abstraction_flag 1 indicates memory should be allocated for abstracted MODEM
|
||||
@returns 0 on success
|
||||
@returns -1 if any memory allocation failed
|
||||
@note The current implementation will never return -1, but segfault.
|
||||
*/
|
||||
int phy_init_lte_eNB_NB_IoT(PHY_VARS_eNB_NB_IoT *phy_vars_eNb,
|
||||
unsigned char is_secondary_eNb,
|
||||
unsigned char abstraction_flag);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
81
openair1/PHY/INIT/defs_NB_IoT.h
Normal file
81
openair1/PHY/INIT/defs_NB_IoT.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __INIT_DEFS_NB_IOT__H__
|
||||
#define __INIT_DEFS_NB_IOT__H__
|
||||
|
||||
//#include "PHY/defs_NB_IoT.h"
|
||||
#include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h"
|
||||
// nfapi_interface.h is required here, it is called through IF_Module_NB_IoT.h
|
||||
|
||||
//#include "SystemInformationBlockType2.h"
|
||||
//#include "RadioResourceConfigCommonSIB.h"
|
||||
//#include "RadioResourceConfigDedicated.h"
|
||||
//#include "TDD-Config.h"
|
||||
//#include "MBSFN-SubframeConfigList.h"
|
||||
//#include "MobilityControlInfo.h"
|
||||
//#if defined(Rel10) || defined(Rel14)
|
||||
//#include "SCellToAddMod-r10.h"
|
||||
//#endif
|
||||
|
||||
/*brief Configure LTE_DL_FRAME_PARMS with components derived after initial synchronization (MIB-NB decoding + primary/secondary synch).*/
|
||||
void phy_config_mib_eNB_NB_IoT(int Mod_id,
|
||||
int CC_id,
|
||||
int eutra_band,
|
||||
int Nid_cell,
|
||||
int Ncp,
|
||||
int Ncp_UL,
|
||||
int p_eNB,
|
||||
uint16_t EARFCN,
|
||||
uint16_t prb_index, // NB_IoT_RB_ID,
|
||||
uint16_t operating_mode,
|
||||
uint16_t control_region_size,
|
||||
uint16_t eutra_NumCRS_ports);
|
||||
|
||||
/*NB_phy_config_sib1_eNB is not needed since NB-IoT use only FDD mode*/
|
||||
|
||||
/*brief Configure LTE_DL_FRAME_PARMS with components of SIB2-NB (at eNB).*/
|
||||
|
||||
//void NB_phy_config_sib2_eNB(module_id_t Mod_id,
|
||||
// int CC_id,
|
||||
// RadioResourceConfigCommonSIB_NB_r13_t *radioResourceConfigCommon
|
||||
// );
|
||||
|
||||
void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
nfapi_config_NB_IoT_t *config,
|
||||
nfapi_rf_config_t *rf_config,
|
||||
nfapi_uplink_reference_signal_config_t* ul_nrs_config,
|
||||
extra_phyConfig_t* extra_phy_parms);
|
||||
|
||||
void phy_config_dedicated_eNB_NB_IoT(module_id_t Mod_id,
|
||||
int CC_id,
|
||||
rnti_t rnti,
|
||||
extra_phyConfig_t* extra_phy_parms);
|
||||
|
||||
// void phy_init_lte_top_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
*/
|
||||
|
||||
//#define DEBUG_PHY
|
||||
//#define DEBUG_PHY
|
||||
t
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,20 @@
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
/*! \file phy_procedures_lte_eNB.c
|
||||
* \brief Implementation of eNB procedures from 36.213 LTE specifications
|
||||
* \author R. Knopp, F. Kaltenberger, N. Nikaein, X. Foukas
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr,navid.nikaein@eurecom.fr, x.foukas@sms.ed.ac.uk
|
||||
* last changes: M. Kanj, V. Savaux
|
||||
* date: 2018
|
||||
* company: b<>com
|
||||
* \email: matthieu.kanj@b-com.com, vincent.savaux@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
#include "SCHED/defs.h"
|
||||
@@ -32,12 +46,13 @@
|
||||
#define DEBUG_PHY
|
||||
#include "assertions.h"
|
||||
#include <math.h>
|
||||
#include "PHY/LTE_REFSIG/defs.h"
|
||||
|
||||
extern uint16_t prach_root_sequence_map0_3[838];
|
||||
extern uint16_t prach_root_sequence_map4[138];
|
||||
uint8_t dmrs1_tab[8] = {0,2,3,4,6,8,9,10};
|
||||
|
||||
// FIXME not used anywhere
|
||||
|
||||
void phy_config_mib(LTE_DL_FRAME_PARMS *fp,
|
||||
uint8_t N_RB_DL,
|
||||
uint8_t Nid_cell,
|
||||
@@ -1381,6 +1396,10 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF4p5) {
|
||||
lte_gold(fp,eNB->lte_gold_table,fp->Nid_cell);
|
||||
|
||||
// NB-IoT testing
|
||||
lte_gold_NB_IoT(fp,eNB->lte_gold_table_NB_IoT,fp->Nid_cell);
|
||||
//////////////////////////////////////////////////////////
|
||||
generate_pcfich_reg_mapping(fp);
|
||||
generate_phich_reg_mapping(fp);
|
||||
|
||||
@@ -1641,3 +1660,333 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void phy_init_lte_top_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
|
||||
crcTableInit_NB_IoT();
|
||||
|
||||
//ccodedot11_init();
|
||||
//ccodedot11_init_inv();
|
||||
ccodelte_init_NB_IoT();
|
||||
ccodelte_init2_NB_IoT();
|
||||
//ccodelte_init_inv();
|
||||
|
||||
//treillis_table_init();
|
||||
|
||||
//phy_generate_viterbi_tables();
|
||||
//phy_generate_viterbi_tables_lte();
|
||||
|
||||
//init_td8();
|
||||
// init_td16();
|
||||
#ifdef __AVX2__
|
||||
// init_td16avx2();
|
||||
#endif
|
||||
|
||||
//lte_sync_time_init_NB_IoT(frame_parms);
|
||||
|
||||
//generate_ul_ref_sigs();
|
||||
//generate_ul_ref_sigs_rx();
|
||||
generate_ul_ref_sigs_rx_NB_IoT();
|
||||
|
||||
// generate_64qam_table();
|
||||
//generate_16qam_table();
|
||||
// generate_RIV_tables();
|
||||
|
||||
init_unscrambling_lut_NB_IoT();
|
||||
// init_scrambling_lut();
|
||||
|
||||
//set_taus_seed(1328);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int phy_init_lte_eNB_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
|
||||
unsigned char is_secondary_eNB,
|
||||
unsigned char abstraction_flag)
|
||||
{
|
||||
|
||||
// shortcuts
|
||||
NB_IoT_DL_FRAME_PARMS* const fp = &eNB->frame_parms;
|
||||
NB_IoT_eNB_COMMON* const common_vars = &eNB->common_vars;
|
||||
NB_IoT_eNB_PUSCH** const pusch_vars = eNB->pusch_vars;
|
||||
NB_IoT_eNB_SRS* const srs_vars = eNB->srs_vars;
|
||||
NB_IoT_eNB_PRACH* const prach_vars = &eNB->prach_vars;
|
||||
|
||||
int i, j, eNB_id, UE_id;
|
||||
int re;
|
||||
|
||||
|
||||
eNB->total_dlsch_bitrate = 0;
|
||||
eNB->total_transmitted_bits = 0;
|
||||
eNB->total_system_throughput = 0;
|
||||
eNB->check_for_MUMIMO_transmissions=0;
|
||||
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF4p5_NB_IoT) {
|
||||
// lte_gold_NB_IoT(fp,eNB->lte_gold_table_NB_IoT,fp->Nid_cell); ****** uncomment when this function is used - 16/02/2018
|
||||
// generate_pcfich_reg_mapping(fp);
|
||||
// generate_phich_reg_mapping(fp);
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX_NB_IoT; UE_id++) {
|
||||
eNB->first_run_timing_advance[UE_id] =
|
||||
1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
|
||||
|
||||
// clear whole structure
|
||||
bzero( &eNB->UE_stats[UE_id], sizeof(NB_IoT_eNB_UE_stats) );
|
||||
|
||||
eNB->physicalConfigDedicated[UE_id] = NULL;
|
||||
}
|
||||
|
||||
eNB->first_run_I0_measurements = 1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
|
||||
}
|
||||
|
||||
// for (eNB_id=0; eNB_id<3; eNB_id++) {
|
||||
{
|
||||
eNB_id=0;
|
||||
if (abstraction_flag==0) {
|
||||
|
||||
// TX vars
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5_NB_IoT)
|
||||
|
||||
common_vars->txdata[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||
common_vars->txdataF[eNB_id] = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t*));
|
||||
common_vars->txdataF_BF[eNB_id] = (int32_t **)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF5_NB_IoT) {
|
||||
for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
|
||||
if (i<fp->nb_antenna_ports_eNB || i==5) {
|
||||
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->txdataF[%d][%d] = %p (%lu bytes)\n",
|
||||
eNB_id,i,common_vars->txdataF[eNB_id][i],
|
||||
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<fp->nb_antennas_tx; i++) {
|
||||
common_vars->txdataF_BF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t) );
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5_NB_IoT)
|
||||
|
||||
// Allocate 10 subframes of I/Q TX signal data (time) if not
|
||||
common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->txdata[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->txdata[eNB_id][i],
|
||||
fp->samples_per_tti*10*sizeof(int32_t));
|
||||
#endif
|
||||
}
|
||||
|
||||
for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
|
||||
if (i<fp->nb_antenna_ports_eNB || i==5) {
|
||||
common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||
for (j=0; j<fp->nb_antennas_tx; j++) {
|
||||
common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
// antenna ports 0-3 are mapped on antennas 0-3
|
||||
// antenna port 4 is mapped on antenna 0
|
||||
// antenna ports 5-14 are mapped on all antennas
|
||||
if (((i<4) && (i==j)) || ((i==4) && (j==0))) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff;
|
||||
}
|
||||
else if (i>4) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff/fp->nb_antennas_tx;
|
||||
}
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->beam_weights[%d][%d][%d] = %p (%zu bytes)\n",
|
||||
eNB_id,i,j,common_vars->beam_weights[eNB_id][i][j],
|
||||
fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// RX vars
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5_NB_IoT) {
|
||||
common_vars->rxdata[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
common_vars->rxdata_7_5kHz[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
}
|
||||
|
||||
common_vars->rxdataF[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5_NB_IoT) {
|
||||
// allocate 2 subframes of I/Q signal data (time) if not an RCC (no time-domain signals)
|
||||
common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF5_NB_IoT)
|
||||
// allocate 2 subframes of I/Q signal data (time, 7.5 kHz offset)
|
||||
common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( 2*fp->samples_per_tti*2*sizeof(int32_t) );
|
||||
}
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF5_NB_IoT)
|
||||
// allocate 2 subframes of I/Q signal data (frequency)
|
||||
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(2*fp->ofdm_symbol_size*fp->symbols_per_tti) );
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->rxdata[eNB_id][i],fp->samples_per_tti*10*sizeof(int32_t));
|
||||
if (eNB->node_function != NGFI_RRU_IF5_NB_IoT)
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i],fp->samples_per_tti*2*sizeof(int32_t));
|
||||
#endif
|
||||
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti) );
|
||||
}
|
||||
|
||||
|
||||
if ((eNB->node_function != NGFI_RRU_IF4p5_NB_IoT)&&(eNB->node_function != NGFI_RRU_IF5_NB_IoT)) {
|
||||
|
||||
// Channel estimates for SRS
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
|
||||
srs_vars[UE_id].srs_ch_estimates[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
srs_vars[UE_id].srs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
srs_vars[UE_id].srs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
srs_vars[UE_id].srs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
||||
}
|
||||
} //UE_id
|
||||
|
||||
common_vars->sync_corr[eNB_id] = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_tti );
|
||||
}
|
||||
} // abstraction_flag = 0
|
||||
else { //UPLINK abstraction = 1
|
||||
eNB->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
||||
}
|
||||
} //eNB_id
|
||||
|
||||
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
if ((eNB->node_function != NGFI_RRU_IF4p5_NB_IoT)&&(eNB->node_function != NGFI_RRU_IF5_NB_IoT)) {
|
||||
generate_ul_ref_sigs_rx();
|
||||
|
||||
// SRS
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
srs_vars[UE_id].srs = (int32_t*)malloc16_clear(2*fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ULSCH VARS, skip if NFGI_RRU_IF4
|
||||
|
||||
|
||||
if ((eNB->node_function!=NGFI_RRU_IF4p5_NB_IoT)&&(eNB->node_function != NGFI_RRU_IF5_NB_IoT))
|
||||
|
||||
prach_vars->prachF = (int16_t*)malloc16_clear( 1024*2*sizeof(int16_t) );
|
||||
|
||||
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
|
||||
AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->rxsigF) / sizeof(prach_vars->rxsigF[0]),
|
||||
"nb_antennas_rx too large");
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
prach_vars->rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) );
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((eNB->node_function != NGFI_RRU_IF4p5_NB_IoT)&&(eNB->node_function != NGFI_RRU_IF5_NB_IoT)) {
|
||||
|
||||
AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->prach_ifft) / sizeof(prach_vars->prach_ifft[0]),
|
||||
"nb_antennas_rx too large");
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
prach_vars->prach_ifft[i] = (int16_t*)malloc16_clear(1024*2*sizeof(int16_t));
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] prach_vars->prach_ifft[%d] = %p\n",i,prach_vars->prach_ifft[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
|
||||
//FIXME
|
||||
pusch_vars[UE_id] = (NB_IoT_eNB_PUSCH*)malloc16_clear( NUMBER_OF_UE_MAX*sizeof(NB_IoT_eNB_PUSCH) );
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
for (eNB_id=0; eNB_id<3; eNB_id++) {
|
||||
|
||||
pusch_vars[UE_id]->rxdataF_ext[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->rxdataF_ext2[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->drs_ch_estimates[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->rxdataF_comp[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->ul_ch_mag[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->ul_ch_magb[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
// RK 2 times because of output format of FFT!
|
||||
// FIXME We should get rid of this
|
||||
pusch_vars[UE_id]->rxdataF_ext[eNB_id][i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->rxdataF_ext2[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->drs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( 2*2*sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
pusch_vars[UE_id]->rxdataF_comp[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->ul_ch_mag[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
|
||||
pusch_vars[UE_id]->ul_ch_magb[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
|
||||
}
|
||||
} //eNB_id
|
||||
|
||||
pusch_vars[UE_id]->llr = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
} // abstraction_flag
|
||||
} //UE_id
|
||||
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
if (is_secondary_eNB) {
|
||||
for (eNB_id=0; eNB_id<3; eNB_id++) {
|
||||
eNB->dl_precoder_SeNB[eNB_id] = (int **)malloc16(4*sizeof(int*));
|
||||
|
||||
if (eNB->dl_precoder_SeNB[eNB_id]) {
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][SECSYS_PHY][INIT] eNB->dl_precoder_SeNB[%d] allocated at %p\n",eNB_id,
|
||||
eNB->dl_precoder_SeNB[eNB_id]);
|
||||
#endif
|
||||
} else {
|
||||
printf("[openair][SECSYS_PHY][INIT] eNB->dl_precoder_SeNB[%d] not allocated\n",eNB_id);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
for (j=0; j<fp->nb_antennas_tx; j++) {
|
||||
eNB->dl_precoder_SeNB[eNB_id][j] = (int *)malloc16(2*sizeof(int)*(fp->ofdm_symbol_size)); // repeated format (hence the '2*')
|
||||
|
||||
if (eNB->dl_precoder_SeNB[eNB_id][j]) {
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] allocated at %p\n",eNB_id,j,
|
||||
eNB->dl_precoder_SeNB[eNB_id][j]);
|
||||
#endif
|
||||
memset(eNB->dl_precoder_SeNB[eNB_id][j],0,2*sizeof(int)*(fp->ofdm_symbol_size));
|
||||
} else {
|
||||
printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] not allocated\n",eNB_id,j);
|
||||
return(-1);
|
||||
}
|
||||
} //for(j=...nb_antennas_tx
|
||||
|
||||
} //for(eNB_id...
|
||||
}
|
||||
}
|
||||
/*
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++)
|
||||
eNB->UE_stats_ptr[UE_id] = &eNB->UE_stats[UE_id];
|
||||
|
||||
//defaul value until overwritten by RRCConnectionReconfiguration
|
||||
if (fp->nb_antenna_ports_eNB==2)
|
||||
eNB->pdsch_config_dedicated->p_a = dBm3;
|
||||
else
|
||||
eNB->pdsch_config_dedicated->p_a = dB0;
|
||||
|
||||
init_prach_tables(839);
|
||||
*/
|
||||
} // node_function != NGFI_RRU_IF4p5
|
||||
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
468
openair1/PHY/INIT/lte_init_NB_IoT.c
Normal file
468
openair1/PHY/INIT/lte_init_NB_IoT.c
Normal file
@@ -0,0 +1,468 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
//#include "defs.h"
|
||||
#include "SCHED/defs_NB_IoT.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "PHY/extern_NB_IoT.h" // PHY/defs_NB_IoT.h is called here , log.h & LTE_TRANSPORT/defs_NB_IoT.h are included through PHY/defs_NB_IoT.h
|
||||
#include "openair2/LAYER2/MAC/proto_NB_IoT.h" // for functions: from_earfcn_NB_IoT, get_uldl_offset_NB_IoT
|
||||
//#include "SIMULATION/TOOLS/defs.h"
|
||||
//#include "RadioResourceConfigCommonSIB.h"
|
||||
//#include "RadioResourceConfigDedicated.h"
|
||||
//#include "TDD-Config.h"
|
||||
//#include "LAYER2/MAC/extern.h"
|
||||
//#include "MBSFN-SubframeConfigList.h"
|
||||
//#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
//#define DEBUG_PHY
|
||||
#include "assertions.h"
|
||||
//#include <math.h>
|
||||
|
||||
//NB-IoT
|
||||
#include "PHY/INIT/defs_NB_IoT.h" // nfapi_interface.h & IF_Module_NB_IoT.h are included here
|
||||
//#include "RadioResourceConfigCommonSIB-NB-r13.h"
|
||||
//#include "RadioResourceConfigDedicated-NB-r13.h"
|
||||
//#include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h"
|
||||
//#include "openair2/RRC/LITE/proto_NB_IoT.h"
|
||||
|
||||
//extern uint16_t prach_root_sequence_map0_3[838];
|
||||
//extern uint16_t prach_root_sequence_map4[138];
|
||||
//uint8_t dmrs1_tab[8] = {0,2,3,4,6,8,9,10};
|
||||
|
||||
|
||||
void phy_config_mib_eNB_NB_IoT(int Mod_id,
|
||||
int CC_id,
|
||||
int eutra_band,
|
||||
int Nid_cell,
|
||||
int Ncp,
|
||||
int Ncp_UL,
|
||||
int p_eNB,
|
||||
uint16_t EARFCN,
|
||||
uint16_t prb_index, // NB_IoT_RB_ID,
|
||||
uint16_t operating_mode,
|
||||
uint16_t control_region_size,
|
||||
uint16_t eutra_NumCRS_ports)
|
||||
{
|
||||
|
||||
|
||||
AssertFatal(PHY_vars_eNB_NB_IoT_g != NULL, "PHY_vars_eNB_NB_IoT_g instance pointer doesn't exist\n");
|
||||
AssertFatal(PHY_vars_eNB_NB_IoT_g[Mod_id] != NULL, "PHY_vars_eNB_NB_IoT_g instance %d doesn't exist\n",Mod_id);
|
||||
AssertFatal(PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id] != NULL, "PHY_vars_eNB_NB_IoT_g instance %d, CCid %d doesn't exist\n",Mod_id,CC_id);
|
||||
|
||||
NB_IoT_DL_FRAME_PARMS *fp = &PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->frame_parms_NB_IoT;
|
||||
|
||||
fp = (NB_IoT_DL_FRAME_PARMS*) malloc (sizeof(NB_IoT_DL_FRAME_PARMS));
|
||||
|
||||
LOG_I(PHY,"Configuring MIB-NB for instance %d, CCid %d : (band %d,Nid_cell %d,p %d,EARFCN %u)\n",Mod_id, CC_id, eutra_band, Nid_cell, p_eNB,EARFCN);
|
||||
|
||||
|
||||
// fp->N_RB_DL
|
||||
// fp->N_RB_UL also this two values need to be known when we are dealing with in-band and guard-band operating mode
|
||||
fp->Nid_cell = Nid_cell;
|
||||
fp->nushift = Nid_cell%6;
|
||||
fp->eutra_band = eutra_band;
|
||||
fp->Ncp = Ncp;
|
||||
fp->Ncp_UL = Ncp_UL;
|
||||
fp->nb_antenna_ports_eNB = p_eNB; //tx antenna port
|
||||
fp->dl_CarrierFreq = from_earfcn_NB_IoT(eutra_band,EARFCN,0);
|
||||
fp->ul_CarrierFreq = fp->dl_CarrierFreq - get_uldl_offset_NB_IoT(eutra_band);
|
||||
|
||||
fp->operating_mode = operating_mode; //see how are defined by FAPI structure
|
||||
fp->NB_IoT_RB_ID = prb_index; //XXX to be better understand how should be managed
|
||||
//fp->nb_rx_antenna_ports_eNB
|
||||
fp->control_region_size = control_region_size; //(assume that this value is negative if not used)
|
||||
fp->eutra_NumCRS_ports = eutra_NumCRS_ports; //(valid only for in-band operating mode with different PCI)
|
||||
|
||||
LOG_I(PHY,"Configure-MIB complete\n");
|
||||
|
||||
|
||||
|
||||
//TODO (new Raymond implementation) in the classic implementation seems to be used only by oaisim
|
||||
//init_frame_parms(fp,1);
|
||||
//init_lte_top(fp);
|
||||
|
||||
}
|
||||
|
||||
//Before FAPI implementation
|
||||
//void NB_phy_config_sib2_eNB(uint8_t Mod_id,
|
||||
// int CC_id,
|
||||
// RadioResourceConfigCommonSIB_NB_r13_t *radioResourceConfigCommon
|
||||
// )
|
||||
//{
|
||||
// NB_IoT_DL_FRAME_PARMS *fp = &PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->frame_parms;
|
||||
// //LTE_eNB_UE_stats *eNB_UE_stats = PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->eNB_UE_stats;
|
||||
// //int32_t rx_total_gain_eNB_dB = PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
|
||||
// uint8_t MAX_NPRACH = 4;
|
||||
// NPRACH_Parameters_NB_r13_t *np;
|
||||
//
|
||||
// LOG_D(PHY,"[eNB%d] CCid %d: Applying radioResourceConfigCommon_NB\n",Mod_id,CC_id);
|
||||
//
|
||||
// /*NPRACH configCommon*/
|
||||
// fp->nprach_config_common.nprach_CP_Length =radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
|
||||
// //LOG_D(PHY,"nprach_config_common.nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length);
|
||||
// //fp->nprach_config_common.rsrp_ThresholdsPrachInfoList.list =radioResourceConfigCommon->nprach_Config_r13.rsrp_ThresholdsPrachInfoList_r13.list;
|
||||
// //LOG_D(PHY,"nprach_config_common.rsrp_ThresholdsPrachInfoList = %d\n",fp->nprach_config_common.rsrp_ThresholdsPrachInfoList);
|
||||
//
|
||||
// /*Loop over the configuration according to the maxNPRACH_Resources*/
|
||||
// for (fp->CE=1; fp->CE <= MAX_NPRACH;fp->CE++){
|
||||
// np = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[fp->CE];
|
||||
// /*fp->nprach_config_common.nprach_ParametersList.list.array[fp->CE]->maxNumPreambleAttemptCE =np->maxNumPreambleAttemptCE_r13;
|
||||
// //LOG_D(PHY,"nprach_config_common.nprach_ParametersList.list.maxNumPreambleAttemptCE = %d\n",fp->nprach_config_common.nprach_ParametersList.list.maxNumPreambleAttemptCE);
|
||||
// fp->nprach_config_common.nprach_ParametersList.list.array[fp->CE]->npdcch_NumRepetitions_RA =np->npdcch_NumRepetitions_RA_r13;
|
||||
// //LOG_D(PHY,"nprach_config_common.nprach_ParametersList.list.npdcch_NumRepetitions_RA = %d\n",fp->nprach_config_common.nprach_ParametersList.list.npdcch_NumRepetitions_RA);
|
||||
// fp->nprach_config_common.nprach_ParametersList.list.array[fp->CE]->nprach_Periodicity =np->nprach_Periodicity_r13;
|
||||
// //LOG_D(PHY,"nprach_config_common.nprach_ParametersList.list.nprach_Periodicity = %d\n",fp->nprach_config_common.nprach_ParametersList.list.nprach_Periodicity);
|
||||
// fp->nprach_config_common.nprach_ParametersList.list.array[fp->CE]->nprach_StartTime =np->nprach_StartTime_r13;
|
||||
// //LOG_D(PHY,"nprach_config_common.nprach_ParametersList.list.nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list.nprach_StartTime);
|
||||
// fp->nprach_config_common.nprach_ParametersList.list.array[fp->CE]->nprach_SubcarrierOffset =np->nprach_SubcarrierOffset_r13;
|
||||
// //LOG_D(PHY,"nprach_config_common.nprach_ParametersList.list.nprach_SubcarrierOffset = %d\n",fp->nprach_config_common.nprach_ParametersList.list.nprach_SubcarrierOffset);
|
||||
// fp->nprach_config_common.nprach_ParametersList.list.array[fp->CE]->nprach_SubcarrierMSG3_RangeStart =np->nprach_SubcarrierMSG3_RangeStart_r13;
|
||||
// //LOG_D(PHY,"nprach_config_common.nprach_ParametersList.list.nprach_SubcarrierMSG3_RangeStart = %d\n",fp->nprach_config_common.nprach_ParametersList.list.nprach_SubcarrierMSG3_RangeStart);
|
||||
// fp->nprach_config_common.nprach_ParametersList.list.array[fp->CE]->npdcch_Offset_RA =np->npdcch_Offset_RA_r13;
|
||||
// //LOG_D(PHY,"nprach_config_common.nprach_ParametersList.list.npdcch_Offset_RA = %d\n",fp->nprach_config_common.nprach_ParametersList.list.npdcch_Offset_RA);
|
||||
// fp->nprach_config_common.nprach_ParametersList.list.array[fp->CE]->npdcch_StartSF_CSS_RA =np->npdcch_StartSF_CSS_RA_r13;
|
||||
// //LOG_D(PHY,"nprach_config_common.nprach_ParametersList.list.npdcch_StartSF_CSS_RA = %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[fp->CE]->npdcch_StartSF_CSS_RA);
|
||||
// */
|
||||
// }
|
||||
//
|
||||
// /*Should modify to compute_nprach_seq*/
|
||||
// //compute_prach_seq(&fp->prach_config_common,fp->frame_type,PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->X_u);
|
||||
//
|
||||
// /*NPDSCH ConfigCommon*/
|
||||
// fp->npdsch_config_common.nrs_Power = radioResourceConfigCommon->npdsch_ConfigCommon_r13.nrs_Power_r13;
|
||||
//
|
||||
// /*NPUSCH ConfigCommon*/
|
||||
// /*A list (1-3) should be loop for ack_NACK_NumRepetitions_Msg4*/
|
||||
// for (fp->CE=1; fp->CE <= MAX_NPRACH;fp->CE++){
|
||||
// fp->npusch_config_common.ack_NACK_NumRepetitions_Msg4[fp->CE] = radioResourceConfigCommon->npusch_ConfigCommon_r13.ack_NACK_NumRepetitions_Msg4_r13.list.array[fp->CE];
|
||||
// //LOG_D(PHY,"npusch_config_common.ack_NACK_NumRepetitions_Msg4 = %d]n",fp->npusch_config_common.ack_NACK_NumRepetitions_Msg4);
|
||||
// }
|
||||
// fp->npusch_config_common.srs_SubframeConfig = radioResourceConfigCommon->npusch_ConfigCommon_r13.srs_SubframeConfig_r13;
|
||||
// LOG_D(PHY,"npusch_config_common.srs_SubframeConfig = %d]n",fp->npusch_config_common.srs_SubframeConfig);
|
||||
// fp->npusch_config_common.dmrs_Config.threeTone_BaseSequence = radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_BaseSequence_r13;
|
||||
// LOG_D(PHY,"npusch_config_common.dmrs_Config.threeTone_BaseSequence = %d]n",fp->npusch_config_common.dmrs_Config.threeTone_BaseSequence);
|
||||
// fp->npusch_config_common.dmrs_Config.sixTone_BaseSequence = radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_BaseSequence_r13;
|
||||
// LOG_D(PHY,"npusch_config_common.dmrs_Config.sixTone_BaseSequence = %d]n",fp->npusch_config_common.dmrs_Config.sixTone_BaseSequence);
|
||||
// fp->npusch_config_common.dmrs_Config.threeTone_CyclicShift = radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_CyclicShift_r13;
|
||||
// LOG_D(PHY,"npusch_config_common.dmrs_Config.threeTone_CyclicShift = %d]n",fp->npusch_config_common.dmrs_Config.threeTone_CyclicShift);
|
||||
// fp->npusch_config_common.dmrs_Config.sixTone_CyclicShift = radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_CyclicShift_r13;
|
||||
// LOG_D(PHY,"npusch_config_common.dmrs_Config.sixTone_CyclicShift = %d]n",fp->npusch_config_common.dmrs_Config.sixTone_CyclicShift);
|
||||
// fp->npusch_config_common.dmrs_Config.twelveTone_BaseSequence = radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->twelveTone_BaseSequence_r13;
|
||||
// LOG_D(PHY,"npusch_config_common.dmrs_Config.twelveTone_BaseSequence = %d]n",fp->npusch_config_common.dmrs_Config.twelveTone_BaseSequence);
|
||||
//
|
||||
// fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupAssignmentNPUSCH = radioResourceConfigCommon->npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupAssignmentNPUSCH_r13;
|
||||
// LOG_D(PHY,"npusch_config_common.ul_ReferenceSignalsNPUSCH.groupAssignmentNPUSCH = %d]n",fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupAssignmentNPUSCH);
|
||||
// fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled = radioResourceConfigCommon->npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupHoppingEnabled_r13;
|
||||
// LOG_D(PHY,"npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled = %d]n",fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled);
|
||||
//
|
||||
// /*should change the part that implement the ul hopping in NB-IoT*/
|
||||
// //init_ul_hopping(fp);
|
||||
//
|
||||
// /*UL Power Control Config Common*/
|
||||
//
|
||||
// fp->ul_power_control_config_common.p0_NominalNPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon_r13.p0_NominalNPUSCH_r13;
|
||||
// fp->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon_r13.alpha_r13;
|
||||
// fp->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon_r13.deltaPreambleMsg3_r13;
|
||||
//
|
||||
// /*DL gap*/
|
||||
//
|
||||
// fp->DL_gap_config.dl_GapDurationCoeff = radioResourceConfigCommon->dl_Gap_r13->dl_GapDurationCoeff_r13;
|
||||
// fp->DL_gap_config.dl_GapPeriodicity = radioResourceConfigCommon->dl_Gap_r13->dl_GapPeriodicity_r13;
|
||||
// fp->DL_gap_config.dl_GapThreshold = radioResourceConfigCommon->dl_Gap_r13->dl_GapThreshold_r13;
|
||||
//
|
||||
// /*PUCCH stuff in LTE*/
|
||||
// //init_ncs_cell(fp,PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->ncs_cell);
|
||||
//
|
||||
// //init_ul_hopping(fp);
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
nfapi_config_NB_IoT_t *config,
|
||||
nfapi_rf_config_t *rf_config,
|
||||
nfapi_uplink_reference_signal_config_t *ul_nrs_config,
|
||||
extra_phyConfig_t *extra_phy_parms)
|
||||
{
|
||||
|
||||
NB_IoT_DL_FRAME_PARMS *fp = &PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->frame_parms_NB_IoT;
|
||||
|
||||
// PHY_VARS_eNB *eNB = &PHY_vars_eNB_g[0][0];
|
||||
|
||||
LOG_I(PHY,"[eNB%d] CCid %d: Applying config_NB_IoT from sib2_NB\n",Mod_id,CC_id);
|
||||
|
||||
fp = (NB_IoT_DL_FRAME_PARMS*) malloc (sizeof(NB_IoT_DL_FRAME_PARMS));
|
||||
|
||||
|
||||
/*NPRACH_ConfigSIB_NB_r13----------------------------------------------------------*/
|
||||
|
||||
//MP: FAPI style approach: instead of a list they consider the 3 possible configuration separately
|
||||
|
||||
if(config->nprach_config_0_enabled.value == 1){
|
||||
LOG_I(PHY, "NPRACH Config #0 enabled\n");
|
||||
|
||||
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_0_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
|
||||
LOG_D(PHY," config#0: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length);
|
||||
//FIXME: MP: memory for the list should be allocated? initialization??
|
||||
fp->nprach_config_common.nprach_ParametersList.list[0].nprach_Periodicity = config->nprach_config_0_sf_periodicity.value;
|
||||
LOG_D(PHY,"config#0: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list[0].nprach_Periodicity);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[0].nprach_StartTime = config->nprach_config_0_start_time.value;
|
||||
LOG_D(PHY,"config#0: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list[0].nprach_StartTime);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[0].nprach_SubcarrierOffset = config->nprach_config_0_subcarrier_offset.value;
|
||||
LOG_D(PHY,"config#0: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list[0].nprach_SubcarrierOffset);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[0].nprach_NumSubcarriers = config->nprach_config_0_number_of_subcarriers.value;
|
||||
LOG_D(PHY,"config#0: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list[0].nprach_NumSubcarriers);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[0].numRepetitionsPerPreambleAttempt = config->nprach_config_0_number_of_repetitions_per_attempt.value;
|
||||
LOG_D(PHY,"config#0: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list[0].numRepetitionsPerPreambleAttempt);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/* eNB->nprach_config_common.nprach_CP_Length = config->nprach_config_0_cp_length.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_Periodicity = config->nprach_config_0_sf_periodicity.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_StartTime = config->nprach_config_0_start_time.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_SubcarrierOffset = config->nprach_config_0_subcarrier_offset.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_NumSubcarriers = config->nprach_config_0_number_of_subcarriers.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[0].numRepetitionsPerPreambleAttempt = config->nprach_config_0_number_of_repetitions_per_attempt.value;
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed)
|
||||
/*fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_0_subcarrier_MSG3_range_start;
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[0]->npdcch_StartSF_CSS_RA = extra_phy_parms->nprach_config_0_npdcch_startSF_CSS_RA;
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[0]->npdcch_NumRepetitions_RA = extra_phy_parms->nprach_config_0_npdcch_num_repetitions_RA;
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[0]->npdcch_Offset_RA = extra_phy_parms->nprach_config_0_npdcch_offset_RA;
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[0]->maxNumPreambleAttemptCE = extra_phy_parms->nprach_config_0_max_num_preamble_attempt_CE;
|
||||
*/
|
||||
//fp->nprach_config_common.rsrp_ThresholdsPrachInfoList.list /*OPTIONAL*/
|
||||
|
||||
}
|
||||
|
||||
if(config->nprach_config_1_enabled.value == 1){
|
||||
LOG_I(PHY, "NPRACH Config #1 enabled\n");
|
||||
|
||||
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_1_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
|
||||
LOG_D(PHY," config#1: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length);
|
||||
|
||||
//FIXME: MP: memory for the list should be allocated? initialization??
|
||||
fp->nprach_config_common.nprach_ParametersList.list[1].nprach_Periodicity = config->nprach_config_1_sf_periodicity.value;
|
||||
LOG_D(PHY,"config#1: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list[1].nprach_Periodicity);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[1].nprach_StartTime = config->nprach_config_1_start_time.value;
|
||||
LOG_D(PHY,"config#1: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list[1].nprach_StartTime);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[1].nprach_SubcarrierOffset = config->nprach_config_1_subcarrier_offset.value;
|
||||
LOG_D(PHY,"config#1: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list[1].nprach_SubcarrierOffset);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[1].nprach_NumSubcarriers = config->nprach_config_1_number_of_subcarriers.value;
|
||||
LOG_D(PHY,"config#1: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list[1].nprach_NumSubcarriers);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[1].numRepetitionsPerPreambleAttempt = config->nprach_config_1_number_of_repetitions_per_attempt.value;
|
||||
LOG_D(PHY,"config#1: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list[1].numRepetitionsPerPreambleAttempt);
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* eNB->nprach_config_common.nprach_CP_Length = config->nprach_config_1_cp_length.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_Periodicity = config->nprach_config_1_sf_periodicity.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_StartTime = config->nprach_config_1_start_time.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_SubcarrierOffset = config->nprach_config_1_subcarrier_offset.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_NumSubcarriers = config->nprach_config_1_number_of_subcarriers.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[1].numRepetitionsPerPreambleAttempt = config->nprach_config_1_number_of_repetitions_per_attempt.value;
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
//missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed)
|
||||
/*fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_1_subcarrier_MSG3_range_start;
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[1]->npdcch_StartSF_CSS_RA = extra_phy_parms->nprach_config_1_npdcch_startSF_CSS_RA;
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[1]->npdcch_NumRepetitions_RA = extra_phy_parms->nprach_config_1_npdcch_num_repetitions_RA;
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[1]->npdcch_Offset_RA = extra_phy_parms->nprach_config_1_npdcch_offset_RA;
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[1]->maxNumPreambleAttemptCE = extra_phy_parms->nprach_config_1_max_num_preamble_attempt_CE;
|
||||
*/
|
||||
//fp->nprach_config_common.rsrp_ThresholdsPrachInfoList.list /*OPTIONAL*/
|
||||
|
||||
}
|
||||
|
||||
if(config->nprach_config_2_enabled.value == 1){
|
||||
LOG_I(PHY, "NPRACH Config #2 enabled\n");
|
||||
|
||||
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_2_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
|
||||
LOG_D(PHY," config#2: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length);
|
||||
//FIXME: MP: memory for the list should be allocated? initialization?? where??
|
||||
fp->nprach_config_common.nprach_ParametersList.list[2].nprach_Periodicity = config->nprach_config_2_sf_periodicity.value;
|
||||
LOG_D(PHY,"config#2: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list[2].nprach_Periodicity);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[2].nprach_StartTime = config->nprach_config_2_start_time.value;
|
||||
LOG_D(PHY,"config#2: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list[2].nprach_StartTime);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[2].nprach_SubcarrierOffset = config->nprach_config_2_subcarrier_offset.value;
|
||||
LOG_D(PHY,"config#2: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list[2].nprach_SubcarrierOffset);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[2].nprach_NumSubcarriers = config->nprach_config_2_number_of_subcarriers.value;
|
||||
LOG_D(PHY,"config#2: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list[2].nprach_NumSubcarriers);
|
||||
fp->nprach_config_common.nprach_ParametersList.list[2].numRepetitionsPerPreambleAttempt = config->nprach_config_2_number_of_repetitions_per_attempt.value;
|
||||
LOG_D(PHY,"config#2: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list[2].numRepetitionsPerPreambleAttempt);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
eNB->nprach_config_common.nprach_CP_Length = config->nprach_config_2_cp_length.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_Periodicity = config->nprach_config_2_sf_periodicity.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_StartTime = config->nprach_config_2_start_time.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_SubcarrierOffset = config->nprach_config_2_subcarrier_offset.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_NumSubcarriers = config->nprach_config_2_number_of_subcarriers.value;
|
||||
eNB->nprach_config_common.nprach_ParametersList.list[2].numRepetitionsPerPreambleAttempt = config->nprach_config_2_number_of_repetitions_per_attempt.value;
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
//missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed)
|
||||
/*fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_2_subcarrier_MSG3_range_start;
|
||||
LOG_D(PHY,"config#2: nprach_SubcarrierMSG3_RangeStart= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierMSG3_RangeStart);
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_StartSF_CSS_RA = extra_phy_parms->nprach_config_2_npdcch_startSF_CSS_RA;
|
||||
LOG_D(PHY,"config#2: npdcch_StartSF_CSS_RA= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_StartSF_CSS_RA);
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_NumRepetitions_RA = extra_phy_parms->nprach_config_2_npdcch_num_repetitions_RA;
|
||||
LOG_D(PHY,"config#2: npdcch_NumRepetitions_RA= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_NumRepetitions_RA);
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_Offset_RA = extra_phy_parms->nprach_config_2_npdcch_offset_RA;
|
||||
LOG_D(PHY,"config#2: npdcch_Offset_RA= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_Offset_RA);
|
||||
fp->nprach_config_common.nprach_ParametersList.list.array[2]->maxNumPreambleAttemptCE = extra_phy_parms->nprach_config_2_max_num_preamble_attempt_CE;
|
||||
LOG_D(PHY,"config#2: maxNumPreambleAttemptCE= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->maxNumPreambleAttemptCE);
|
||||
*/
|
||||
//fp->nprach_config_common.rsrp_ThresholdsPrachInfoList.list /*OPTIONAL*/
|
||||
|
||||
}
|
||||
|
||||
//TODO: Should modify to compute_nprach_seq --> nprach.
|
||||
//compute_prach_seq(&fp->prach_config_common,fp->frame_type,PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->X_u);
|
||||
|
||||
|
||||
/*NPDSCH ConfigCommon-------------------------------------------------------------------*/
|
||||
//NPDSCH_ConfigCommon_NB_r13_t b;
|
||||
|
||||
//FIXME: the FAPI specs pag 140 fix a range of value (0->255) but i don't find any similar correspondence in the 3GPP specs (TS 36.331 pag 608 and TS 36.213 ch 16.2.2)
|
||||
fp->npdsch_config_common.nrs_Power = rf_config->reference_signal_power.value;
|
||||
|
||||
/*NPUSCH ConfigCommon-------------------------------------------------------------------*/
|
||||
//NPUSCH_ConfigCommon_NB_r13_t c;
|
||||
|
||||
fp->npusch_config_common.dmrs_Config.threeTone_BaseSequence = config->three_tone_base_sequence.value;
|
||||
LOG_D(PHY,"npusch_config_common.dmrs_Config.threeTone_BaseSequence = %d\n",fp->npusch_config_common.dmrs_Config.threeTone_BaseSequence);
|
||||
fp->npusch_config_common.dmrs_Config.sixTone_BaseSequence = config->six_tone_base_sequence.value;
|
||||
LOG_D(PHY,"npusch_config_common.dmrs_Config.sixTone_BaseSequence = %d\n",fp->npusch_config_common.dmrs_Config.sixTone_BaseSequence);
|
||||
fp->npusch_config_common.dmrs_Config.threeTone_CyclicShift = config->three_tone_cyclic_shift.value;
|
||||
LOG_D(PHY,"npusch_config_common.dmrs_Config.threeTone_CyclicShift = %d\n",fp->npusch_config_common.dmrs_Config.threeTone_CyclicShift);
|
||||
fp->npusch_config_common.dmrs_Config.sixTone_CyclicShift = config->six_tone_cyclic_shift.value;
|
||||
LOG_D(PHY,"npusch_config_common.dmrs_Config.sixTone_CyclicShift = %d\n",fp->npusch_config_common.dmrs_Config.sixTone_CyclicShift);
|
||||
fp->npusch_config_common.dmrs_Config.twelveTone_BaseSequence= config->twelve_tone_base_sequence.value;
|
||||
LOG_D(PHY,"npusch_config_common.dmrs_Config.twelveTone_BaseSequence = %d\n",fp->npusch_config_common.dmrs_Config.twelveTone_BaseSequence);
|
||||
|
||||
|
||||
fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled = ul_nrs_config->uplink_rs_hopping.value;
|
||||
LOG_D(PHY,"npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled = %d\n",fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled);
|
||||
LOG_D(PHY,"**%s**\n",fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled == 1 ? "RS_GROUP_HOPPING" : "RS_NO_HOPPING");
|
||||
fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupAssignmentNPUSCH = ul_nrs_config->group_assignment.value;
|
||||
LOG_D(PHY,"npusch_config_common.ul_ReferenceSignalsNPUSCH.groupAssignmentNPUSCH = %d]n",fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupAssignmentNPUSCH);
|
||||
|
||||
|
||||
|
||||
//MP: FAPI missed parameters (may not needed at eNB side and some of them are optional by the 3GPP specs)
|
||||
//fp->npusch_config_common.ack_NACK_NumRepetitions_Msg4 --> list of size maxNPRACH_Resources_NB_r13 (3 elements)
|
||||
//fp->npusch_config_common.srs_SubframeConfig /*OPTIONAL*/
|
||||
|
||||
|
||||
//No Frequency hopping in NULSCH for NB-IoT and not init_ncs_cell used for PUCCH
|
||||
|
||||
|
||||
/*UL Power Control Config Common---------------------------------------------------------*/
|
||||
//F nothing has been defined in FAPI specs for this (may because are only UE stuffs)
|
||||
/*fp->ul_power_control_config_common.p0_NominalNPUSCH = extra_phy_parms->p0_nominal_npusch;
|
||||
fp->ul_power_control_config_common.alpha = extra_phy_parms->alpha;
|
||||
fp->ul_power_control_config_common.deltaPreambleMsg3 = extra_phy_parms->delta_preamle_MSG*/
|
||||
|
||||
/*DL gap Config - OPTIONAL----------------------------------------------------------------*/
|
||||
//DL_GapConfig_NB_r13_t a;
|
||||
if(config->dl_gap_config_enable.value == 1){
|
||||
fp->DL_gap_config.dl_GapDurationCoeff= config->dl_gap_periodicity.value;
|
||||
fp->DL_gap_config.dl_GapPeriodicity = config->dl_gap_periodicity.value;
|
||||
fp->DL_gap_config.dl_GapThreshold = config->dl_gap_threshold.value;
|
||||
}
|
||||
|
||||
LOG_I(PHY,"SIB-2 configure complete\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void phy_config_dedicated_eNB_NB_IoT(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
uint16_t rnti,
|
||||
extra_phyConfig_t *extra_parms)
|
||||
{
|
||||
PHY_VARS_eNB_NB_IoT *eNB = PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id];
|
||||
NB_IoT_eNB_NPDCCH_t *npdcch;
|
||||
//uint8_t UE_id = find_ue_NB_IoT(rnti,eNB);
|
||||
uint8_t UE_id = 0;
|
||||
if (UE_id == -1) {
|
||||
|
||||
LOG_E( PHY, "[eNB %"PRIu8"] find_ue() returns -1\n", Mod_id);
|
||||
return;
|
||||
}
|
||||
|
||||
//configure UE specific parameters for NPDCCH Search Space
|
||||
|
||||
if (eNB->npdcch[UE_id]) {
|
||||
npdcch = eNB->npdcch[UE_id];
|
||||
npdcch->rnti[0] = rnti;
|
||||
npdcch->npdcch_NumRepetitions[0] = extra_parms->npdcch_NumRepetitions; //Rmax maybe is the only one needed
|
||||
//npdcch->npdcch_Offset_USS = extra_parms->npdcch_Offset_USS;
|
||||
//npdcch->npdcch_StartSF_USS = extra_parms->npdcch_StartSF_USS;
|
||||
|
||||
LOG_I(PHY,"phy_config_dedicated_eNB_NB_IoT: npdcch_NumRepetitions = %d\n",npdcch->npdcch_NumRepetitions[0]);
|
||||
|
||||
} else {
|
||||
LOG_E(PHY,"[eNB %d] Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, UE_id);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// void phy_init_lte_top_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms)
|
||||
// {
|
||||
|
||||
// // crcTableInit();
|
||||
|
||||
// // ccodedot11_init();
|
||||
// // ccodedot11_init_inv();
|
||||
|
||||
// // ccodelte_init();
|
||||
// // ccodelte_init_inv();
|
||||
|
||||
// // treillis_table_init();
|
||||
|
||||
// // phy_generate_viterbi_tables();
|
||||
// // phy_generate_viterbi_tables_lte();
|
||||
|
||||
// // init_td8();
|
||||
// // init_td16();
|
||||
// // #ifdef __AVX2__
|
||||
// // init_td16avx2();
|
||||
// // #endif
|
||||
|
||||
// // lte_sync_time_init(frame_parms);
|
||||
|
||||
// // generate_ul_ref_sigs();
|
||||
// generate_ul_ref_sigs_rx_NB_IoT();
|
||||
|
||||
// // generate_64qam_table();
|
||||
// // generate_16qam_table();
|
||||
// // generate_RIV_tables();
|
||||
|
||||
// // init_unscrambling_lut();
|
||||
// // init_scrambling_lut();
|
||||
// // //set_taus_seed(1328);
|
||||
|
||||
// }
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "defs.h"
|
||||
#include "log.h"
|
||||
#include "PHY/impl_defs_lte_NB_IoT.h"
|
||||
|
||||
uint16_t dl_S_table_normal[10]={3,9,10,11,12,3,9,10,11,6};
|
||||
uint16_t dl_S_table_extended[10]={3,8,9,10,3,8,9,5,0,0};
|
||||
@@ -219,3 +220,154 @@ void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
printf("frame_parms->samples_per_tti=%d\n",frame_parms->samples_per_tti);
|
||||
printf("frame_parms->symbols_per_tti=%d\n",frame_parms->symbols_per_tti);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////// NB-IoT ///////////////////////////////////////////////////////////////
|
||||
|
||||
int init_frame_parms_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
{
|
||||
|
||||
uint8_t log2_osf;
|
||||
|
||||
#if DISABLE_LOG_X
|
||||
printf("Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf);
|
||||
#else
|
||||
LOG_I(PHY,"Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf);
|
||||
#endif
|
||||
|
||||
|
||||
frame_parms->nb_prefix_samples0 = 160;
|
||||
frame_parms->nb_prefix_samples = 144;
|
||||
frame_parms->symbols_per_tti = 14;
|
||||
|
||||
|
||||
|
||||
switch(osf) {
|
||||
case 1:
|
||||
log2_osf = 0;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
log2_osf = 1;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
log2_osf = 2;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
log2_osf = 3;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
log2_osf = 4;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Illegal oversampling %d\n",osf);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
|
||||
case 100:
|
||||
if (osf>1) {
|
||||
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (frame_parms->threequarter_fs) {
|
||||
frame_parms->ofdm_symbol_size = 1536;
|
||||
frame_parms->samples_per_tti = 23040;
|
||||
frame_parms->first_carrier_offset = 1536-600;
|
||||
frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2;
|
||||
frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2;
|
||||
}
|
||||
else {
|
||||
frame_parms->ofdm_symbol_size = 2048;
|
||||
frame_parms->samples_per_tti = 30720;
|
||||
frame_parms->first_carrier_offset = 2048-600;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 75:
|
||||
if (osf>1) {
|
||||
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
frame_parms->ofdm_symbol_size = 1536;
|
||||
frame_parms->samples_per_tti = 23040;
|
||||
frame_parms->first_carrier_offset = 1536-450;
|
||||
frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2;
|
||||
frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2;
|
||||
|
||||
break;
|
||||
|
||||
case 50:
|
||||
if (osf>1) {
|
||||
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
frame_parms->ofdm_symbol_size = 1024*osf;
|
||||
frame_parms->samples_per_tti = 15360*osf;
|
||||
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300;
|
||||
frame_parms->nb_prefix_samples>>=(1-log2_osf);
|
||||
frame_parms->nb_prefix_samples0>>=(1-log2_osf);
|
||||
|
||||
break;
|
||||
|
||||
case 25:
|
||||
if (osf>2) {
|
||||
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
frame_parms->ofdm_symbol_size = 512*osf;
|
||||
|
||||
|
||||
frame_parms->samples_per_tti = 7680*osf;
|
||||
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150;
|
||||
frame_parms->nb_prefix_samples>>=(2-log2_osf);
|
||||
frame_parms->nb_prefix_samples0>>=(2-log2_osf);
|
||||
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 15:
|
||||
frame_parms->ofdm_symbol_size = 256*osf;
|
||||
frame_parms->samples_per_tti = 3840*osf;
|
||||
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90;
|
||||
frame_parms->nb_prefix_samples>>=(3-log2_osf);
|
||||
frame_parms->nb_prefix_samples0>>=(3-log2_osf);
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
frame_parms->ofdm_symbol_size = 128*osf;
|
||||
frame_parms->samples_per_tti = 1920*osf;
|
||||
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36;
|
||||
frame_parms->nb_prefix_samples>>=(4-log2_osf);
|
||||
frame_parms->nb_prefix_samples0>>=(4-log2_osf);
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("init_frame_parms: Error: Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms);
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
printf("lte_parms.c: Setting N_RB_DL to %d, ofdm_symbol_size %d\n",frame_parms->N_RB_DL, frame_parms->ofdm_symbol_size);
|
||||
|
||||
|
||||
// frame_parms->tdd_config=3;
|
||||
return(0);
|
||||
}
|
||||
|
||||
80
openair1/PHY/LTE_ESTIMATION/defs_NB_IoT.h
Normal file
80
openair1/PHY/LTE_ESTIMATION/defs_NB_IoT.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef __LTE_ESTIMATION_DEFS_NB_IOT__H__
|
||||
#define __LTE_ESTIMATION_DEFS_NB_IOT__H__
|
||||
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
|
||||
/*
|
||||
int lte_est_timing_advance(NB_IoT_DL_FRAME_PARMS *frame_parms,
|
||||
NB_IoT_eNB_SRS *lte_eNb_srs,
|
||||
unsigned int *eNb_id,
|
||||
unsigned char clear,
|
||||
unsigned char number_of_cards,
|
||||
short coef);
|
||||
*/
|
||||
|
||||
////////// Vincent: NB-IoT DL synchronization //////////////////////////////////////////////////
|
||||
|
||||
int lte_sync_time_init_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms );
|
||||
|
||||
void lte_sync_time_free_NB_IoT(void);
|
||||
|
||||
int lte_sync_time_NB_IoT(int **rxdata, ///rx data in time domain
|
||||
NB_IoT_DL_FRAME_PARMS *frame_parms,
|
||||
int *eNB_id);
|
||||
|
||||
void lte_sync_timefreq_NB_IoT(PHY_VARS_UE_NB_IoT *ue,int band,unsigned int DL_freq);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int NB_IoT_est_timing_advance_pusch(PHY_VARS_eNB_NB_IoT* phy_vars_eNB,module_id_t UE_id);
|
||||
|
||||
////////// Vincent: NB-IoT specific adapted function for channel estimation ////////////////////
|
||||
/*
|
||||
int ul_channel_estimation_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
eNB_rxtx_proc_t *proc,
|
||||
uint8_t eNB_id,
|
||||
uint8_t UE_id,
|
||||
unsigned char l,
|
||||
unsigned char Ns,
|
||||
uint8_t N_sc_RU,
|
||||
uint8_t pilot_pos1,
|
||||
uint8_t pilot_pos2,
|
||||
uint8_t cooperation_flag); */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int16_t lte_ul_freq_offset_estimation_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *ul_ch_estimates,
|
||||
uint16_t nb_rb);
|
||||
|
||||
void freq_equalization_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **rxdataF_comp,
|
||||
int **ul_ch_mag,
|
||||
int **ul_ch_mag_b,
|
||||
unsigned char symbol,
|
||||
unsigned short Msc_RS,
|
||||
unsigned char Qm);
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
337
openair1/PHY/LTE_ESTIMATION/freq_equalization_NB_IoT.c
Normal file
337
openair1/PHY/LTE_ESTIMATION/freq_equalization_NB_IoT.c
Normal file
@@ -0,0 +1,337 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "PHY/extern_NB_IoT.h"
|
||||
//#include "PHY/sse_intrin.h"
|
||||
|
||||
// This is 512/(1:256) in __m128i format
|
||||
int16_t inv_ch_NB_IoT[256*8] = {512,512,512,512,512,512,512,512,
|
||||
256,256,256,256,256,256,256,256,
|
||||
170,170,170,170,170,170,170,170,
|
||||
128,128,128,128,128,128,128,128,
|
||||
102,102,102,102,102,102,102,102,
|
||||
85,85,85,85,85,85,85,85,
|
||||
73,73,73,73,73,73,73,73,
|
||||
64,64,64,64,64,64,64,64,
|
||||
56,56,56,56,56,56,56,56,
|
||||
51,51,51,51,51,51,51,51,
|
||||
46,46,46,46,46,46,46,46,
|
||||
42,42,42,42,42,42,42,42,
|
||||
39,39,39,39,39,39,39,39,
|
||||
36,36,36,36,36,36,36,36,
|
||||
34,34,34,34,34,34,34,34,
|
||||
32,32,32,32,32,32,32,32,
|
||||
30,30,30,30,30,30,30,30,
|
||||
28,28,28,28,28,28,28,28,
|
||||
26,26,26,26,26,26,26,26,
|
||||
25,25,25,25,25,25,25,25,
|
||||
24,24,24,24,24,24,24,24,
|
||||
23,23,23,23,23,23,23,23,
|
||||
22,22,22,22,22,22,22,22,
|
||||
21,21,21,21,21,21,21,21,
|
||||
20,20,20,20,20,20,20,20,
|
||||
19,19,19,19,19,19,19,19,
|
||||
18,18,18,18,18,18,18,18,
|
||||
18,18,18,18,18,18,18,18,
|
||||
17,17,17,17,17,17,17,17,
|
||||
17,17,17,17,17,17,17,17,
|
||||
16,16,16,16,16,16,16,16,
|
||||
16,16,16,16,16,16,16,16,
|
||||
15,15,15,15,15,15,15,15,
|
||||
15,15,15,15,15,15,15,15,
|
||||
14,14,14,14,14,14,14,14,
|
||||
14,14,14,14,14,14,14,14,
|
||||
13,13,13,13,13,13,13,13,
|
||||
13,13,13,13,13,13,13,13,
|
||||
13,13,13,13,13,13,13,13,
|
||||
12,12,12,12,12,12,12,12,
|
||||
12,12,12,12,12,12,12,12,
|
||||
12,12,12,12,12,12,12,12,
|
||||
11,11,11,11,11,11,11,11,
|
||||
11,11,11,11,11,11,11,11,
|
||||
11,11,11,11,11,11,11,11,
|
||||
11,11,11,11,11,11,11,11,
|
||||
10,10,10,10,10,10,10,10,
|
||||
10,10,10,10,10,10,10,10,
|
||||
10,10,10,10,10,10,10,10,
|
||||
10,10,10,10,10,10,10,10,
|
||||
10,10,10,10,10,10,10,10,
|
||||
9,9,9,9,9,9,9,9,
|
||||
9,9,9,9,9,9,9,9,
|
||||
9,9,9,9,9,9,9,9,
|
||||
9,9,9,9,9,9,9,9,
|
||||
9,9,9,9,9,9,9,9,
|
||||
8,8,8,8,8,8,8,8,
|
||||
8,8,8,8,8,8,8,8,
|
||||
8,8,8,8,8,8,8,8,
|
||||
8,8,8,8,8,8,8,8,
|
||||
8,8,8,8,8,8,8,8,
|
||||
8,8,8,8,8,8,8,8,
|
||||
8,8,8,8,8,8,8,8,
|
||||
8,8,8,8,8,8,8,8,
|
||||
7,7,7,7,7,7,7,7,
|
||||
7,7,7,7,7,7,7,7,
|
||||
7,7,7,7,7,7,7,7,
|
||||
7,7,7,7,7,7,7,7,
|
||||
7,7,7,7,7,7,7,7,
|
||||
7,7,7,7,7,7,7,7,
|
||||
7,7,7,7,7,7,7,7,
|
||||
7,7,7,7,7,7,7,7,
|
||||
7,7,7,7,7,7,7,7,
|
||||
6,6,6,6,6,6,6,6,
|
||||
6,6,6,6,6,6,6,6,
|
||||
6,6,6,6,6,6,6,6,
|
||||
6,6,6,6,6,6,6,6,
|
||||
6,6,6,6,6,6,6,6,
|
||||
6,6,6,6,6,6,6,6,
|
||||
6,6,6,6,6,6,6,6,
|
||||
6,6,6,6,6,6,6,6,
|
||||
6,6,6,6,6,6,6,6,
|
||||
6,6,6,6,6,6,6,6,
|
||||
6,6,6,6,6,6,6,6,
|
||||
6,6,6,6,6,6,6,6,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
5,5,5,5,5,5,5,5,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
3,3,3,3,3,3,3,3,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
2,2,2,2,2,2,2,2,
|
||||
};
|
||||
|
||||
void freq_equalization_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int32_t **ul_ch_mag,
|
||||
int32_t **ul_ch_magb,
|
||||
uint8_t symbol,
|
||||
uint16_t Msc_RS,
|
||||
uint8_t Qm)
|
||||
{
|
||||
uint16_t re;
|
||||
int16_t amp;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *ul_ch_mag128,*ul_ch_magb128,*rxdataF_comp128;
|
||||
rxdataF_comp128 = (__m128i *)&rxdataF_comp[0][symbol*frame_parms->N_RB_DL*12];
|
||||
ul_ch_mag128 = (__m128i *)&ul_ch_mag[0][symbol*frame_parms->N_RB_DL*12];
|
||||
ul_ch_magb128 = (__m128i *)&ul_ch_magb[0][symbol*frame_parms->N_RB_DL*12];
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *ul_ch_mag128,*ul_ch_magb128,*rxdataF_comp128;
|
||||
rxdataF_comp128 = (int16x8_t*)&rxdataF_comp[0][symbol*frame_parms->N_RB_DL*12];
|
||||
ul_ch_mag128 = (int16x8_t*)&ul_ch_mag[0][symbol*frame_parms->N_RB_DL*12];
|
||||
ul_ch_magb128 = (int16x8_t*)&ul_ch_magb[0][symbol*frame_parms->N_RB_DL*12];
|
||||
#endif
|
||||
ul_ch_magb128 = ul_ch_magb128;
|
||||
for (re=0; re<(Msc_RS>>2); re++) {
|
||||
|
||||
amp=(*((int16_t*)&ul_ch_mag128[re]));
|
||||
|
||||
if (amp>255)
|
||||
amp=255;
|
||||
|
||||
// printf("freq_eq: symbol %d re %d => %d,%d,%d, (%d) (%d,%d) => ",symbol,re,*((int16_t*)(&ul_ch_mag128[re])),amp,inv_ch[8*amp],*((int16_t*)(&ul_ch_mag128[re]))*inv_ch[8*amp],*(int16_t*)&(rxdataF_comp128[re]),*(1+(int16_t*)&(rxdataF_comp128[re])));
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
rxdataF_comp128[re] = _mm_mullo_epi16(rxdataF_comp128[re],*((__m128i *)&inv_ch_NB_IoT[8*amp]));
|
||||
|
||||
// if (Qm==4)
|
||||
// ul_ch_mag128[re] = _mm_set1_epi16(324); // this is 512*2/sqrt(10)
|
||||
// else {
|
||||
// ul_ch_mag128[re] = _mm_set1_epi16(316); // this is 512*4/sqrt(42)
|
||||
// ul_ch_magb128[re] = _mm_set1_epi16(158); // this is 512*2/sqrt(42)
|
||||
// }
|
||||
#elif defined(__arm__)
|
||||
rxdataF_comp128[re] = vmulq_s16(rxdataF_comp128[re],*((int16x8_t *)&inv_ch_NB_IoT[8*amp]));
|
||||
|
||||
// if (Qm==4)
|
||||
// ul_ch_mag128[re] = vdupq_n_s16(324); // this is 512*2/sqrt(10)
|
||||
//else {
|
||||
// ul_ch_mag128[re] = vdupq_n_s16(316); // this is 512*4/sqrt(42)
|
||||
// ul_ch_magb128[re] = vdupq_n_s16(158); // this is 512*2/sqrt(42)
|
||||
//}
|
||||
#endif
|
||||
// printf("(%d,%d)\n",*(int16_t*)&(rxdataF_comp128[re]),*(1+(int16_t*)&(rxdataF_comp128[re])));
|
||||
|
||||
}
|
||||
}
|
||||
75
openair1/PHY/LTE_ESTIMATION/lte_adjust_sync_NB_IoT.c
Normal file
75
openair1/PHY/LTE_ESTIMATION/lte_adjust_sync_NB_IoT.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
//#include "PHY/types.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
//#include "PHY/extern.h"
|
||||
|
||||
//#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#define DEBUG_PHY
|
||||
|
||||
int NB_IoT_est_timing_advance_pusch(PHY_VARS_eNB_NB_IoT* eNB,uint8_t UE_id)
|
||||
{
|
||||
static int first_run=1;
|
||||
static int max_pos_fil2=0;
|
||||
int temp, i, aa, max_pos=0, max_val=0;
|
||||
short Re,Im,coef=24576;
|
||||
short ncoef = 32768 - coef;
|
||||
|
||||
NB_IoT_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
||||
NB_IoT_eNB_PUSCH *eNB_pusch_vars = eNB->pusch_vars[UE_id];
|
||||
int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time[0];
|
||||
uint8_t cyclic_shift = 0;
|
||||
int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
|
||||
|
||||
|
||||
for (i = 0; i < frame_parms->ofdm_symbol_size; i++) {
|
||||
temp = 0;
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||
Re = ((int16_t*)ul_ch_estimates_time[aa])[(i<<1)];
|
||||
Im = ((int16_t*)ul_ch_estimates_time[aa])[1+(i<<1)];
|
||||
temp += (Re*Re/2) + (Im*Im/2);
|
||||
}
|
||||
|
||||
if (temp > max_val) {
|
||||
max_pos = i;
|
||||
max_val = temp;
|
||||
}
|
||||
}
|
||||
|
||||
if (max_pos>frame_parms->ofdm_symbol_size/2)
|
||||
max_pos = max_pos-frame_parms->ofdm_symbol_size;
|
||||
|
||||
// filter position to reduce jitter
|
||||
if (first_run == 1) {
|
||||
first_run=0;
|
||||
max_pos_fil2 = max_pos;
|
||||
} else
|
||||
max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15;
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc.frame_rx,max_pos,max_pos_fil2,sync_pos);
|
||||
#endif //DEBUG_PHY
|
||||
|
||||
return(max_pos_fil2-sync_pos);
|
||||
}
|
||||
636
openair1/PHY/LTE_ESTIMATION/lte_sync_time_NB_IoT.c
Normal file
636
openair1/PHY/LTE_ESTIMATION/lte_sync_time_NB_IoT.c
Normal file
@@ -0,0 +1,636 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/* file: lte_sync_time.c
|
||||
purpose: coarse timing synchronization for LTE (using PSS)
|
||||
author: florian.kaltenberger@eurecom.fr, oscar.tonelli@yahoo.it
|
||||
date: 22.10.2009
|
||||
*/
|
||||
|
||||
//#include <string.h>
|
||||
#include "defs_NB_IoT.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "PHY/extern_NB_IoT.h"
|
||||
// #include "SCHED/extern_NB_IoT.h"
|
||||
#include <math.h>
|
||||
|
||||
#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "RRC/LITE/extern.h"
|
||||
#include "PHY_INTERFACE/extern.h"
|
||||
#endif
|
||||
//#define DEBUG_PHY
|
||||
|
||||
int* sync_corr_ue0 = NULL;
|
||||
// int* sync_corr_ue1 = NULL;
|
||||
// int* sync_corr_ue2 = NULL;
|
||||
int sync_tmp[2048*4] __attribute__((aligned(32)));
|
||||
short syncF_tmp[2048*2] __attribute__((aligned(32)));
|
||||
|
||||
|
||||
|
||||
int lte_sync_time_init_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *common_vars
|
||||
{
|
||||
|
||||
int i,k,k2,l;
|
||||
|
||||
sync_corr_ue0_NB_IoT = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti);
|
||||
// sync_corr_ue1 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti);
|
||||
// sync_corr_ue2 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti);
|
||||
|
||||
if (sync_corr_ue0) {
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[openair][LTE_PHY][SYNC] sync_corr_ue allocated at %p\n", sync_corr_ue0);
|
||||
#endif
|
||||
//common_vars->sync_corr = sync_corr;
|
||||
} else {
|
||||
msg("[openair][LTE_PHY][SYNC] sync_corr_ue0 not allocated\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// if (sync_corr_ue1) {
|
||||
// #ifdef DEBUG_PHY
|
||||
// msg("[openair][LTE_PHY][SYNC] sync_corr_ue allocated at %p\n", sync_corr_ue1);
|
||||
// #endif
|
||||
// //common_vars->sync_corr = sync_corr;
|
||||
// } else {
|
||||
// msg("[openair][LTE_PHY][SYNC] sync_corr_ue1 not allocated\n");
|
||||
// return(-1);
|
||||
// }
|
||||
|
||||
// if (sync_corr_ue2) {
|
||||
// #ifdef DEBUG_PHY
|
||||
// msg("[openair][LTE_PHY][SYNC] sync_corr_ue allocated at %p\n", sync_corr_ue2);
|
||||
// #endif
|
||||
// //common_vars->sync_corr = sync_corr;
|
||||
// } else {
|
||||
// msg("[openair][LTE_PHY][SYNC] sync_corr_ue2 not allocated\n");
|
||||
// return(-1);
|
||||
// }
|
||||
|
||||
// primary_synch0_time = (int *)malloc16((frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
|
||||
// Consider the CPs 10 normal length + 1 longer due to first symbol in slot
|
||||
primary_synch0_time_NB_IoT = (int16_t *)malloc16((frame_parms->ofdm_symbol_size*11 + frame_parms->nb_prefix_samples*10 + frame_parms->nb_prefix_samples0)*sizeof(int16_t)*2); // 11 symbols per subframe dedicated to primary synchro
|
||||
|
||||
if (primary_synch0_time_NB_IoT) {
|
||||
// bzero(primary_synch0_time,(frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
bzero(primary_synch0_time_NB_IoT,(frame_parms->ofdm_symbol_size)*sizeof(int16_t)*2*11);
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[openair][LTE_PHY][SYNC] primary_synch0_time allocated at %p\n", primary_synch0_time_NB_IoT);
|
||||
#endif
|
||||
} else {
|
||||
msg("[openair][LTE_PHY][SYNC] primary_synch0_time not allocated\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// primary_synch1_time = (int *)malloc16((frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
// primary_synch1_time = (int16_t *)malloc16((frame_parms->ofdm_symbol_size)*sizeof(int16_t)*2);
|
||||
|
||||
// if (primary_synch1_time) {
|
||||
// // bzero(primary_synch1_time,(frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
// bzero(primary_synch1_time,(frame_parms->ofdm_symbol_size)*sizeof(int16_t)*2);
|
||||
// #ifdef DEBUG_PHY
|
||||
// msg("[openair][LTE_PHY][SYNC] primary_synch1_time allocated at %p\n", primary_synch1_time);
|
||||
// #endif
|
||||
// } else {
|
||||
// msg("[openair][LTE_PHY][SYNC] primary_synch1_time not allocated\n");
|
||||
// return(-1);
|
||||
// }
|
||||
|
||||
// // primary_synch2_time = (int *)malloc16((frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
// primary_synch2_time = (int16_t *)malloc16((frame_parms->ofdm_symbol_size)*sizeof(int16_t)*2);
|
||||
|
||||
// if (primary_synch2_time) {
|
||||
// // bzero(primary_synch2_time,(frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples)*sizeof(int));
|
||||
// bzero(primary_synch2_time,(frame_parms->ofdm_symbol_size)*sizeof(int16_t)*2);
|
||||
// #ifdef DEBUG_PHY
|
||||
// msg("[openair][LTE_PHY][SYNC] primary_synch2_time allocated at %p\n", primary_synch2_time);
|
||||
// #endif
|
||||
// } else {
|
||||
// msg("[openair][LTE_PHY][SYNC] primary_synch2_time not allocated\n");
|
||||
// return(-1);
|
||||
// }
|
||||
|
||||
|
||||
// generate oversampled sync_time sequences
|
||||
|
||||
if (frame_parms->NB_IoT_RB_ID <= (frame_parms->N_RB_DL>>1)) { // NB-IoT RB is in the first half
|
||||
k = frame_parms->ofdm_symbol_size - frame_parms->N_RB_DL*6 + frame_parms->NB_IoT_RB_ID*12;
|
||||
}else{// second half: DC carrier offset
|
||||
k = 1 + 6*(2*frame_parms->NB_IoT_RB_ID - frame_parms->N_RB_DL);
|
||||
}
|
||||
|
||||
for (l=0; l<11 ; l++){
|
||||
k2 = k;
|
||||
for (i=0; i<12; i++) { // 12 subcarriers in NB-IoT
|
||||
|
||||
syncF_tmp[2*k2] = primary_synch_NB_IoT[12*l + 2*i]>>2; //we need to shift input to avoid overflow in fft
|
||||
syncF_tmp[2*k2+1] = primary_synch_NB_IoT[12*l + 2*i+1]>>2;
|
||||
k2++;
|
||||
|
||||
}
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft128((short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft512((short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft1024((short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft1536((short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp,
|
||||
1); /// complex output
|
||||
break;
|
||||
case 100:
|
||||
idft2048((short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i=0; i<frame_parms->ofdm_symbol_size; i++)
|
||||
if (l < 4){ // Skip longest CP length
|
||||
((int32_t*)primary_synch0_time_NB_IoT)[l*(frame_parms->nb_prefix_samples + frame_parms->ofdm_symbol_size) + i] = sync_tmp[i];
|
||||
}else{ // take into account the longest CP length is second slot of subframe
|
||||
((int32_t*)primary_synch0_time_NB_IoT)[frame_parms->nb_prefix_samples0 + frame_parms->ofdm_symbol_size +
|
||||
(l-1)*(frame_parms->nb_prefix_samples + frame_parms->ofdm_symbol_size) + i] = sync_tmp[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// k=frame_parms->ofdm_symbol_size-36;
|
||||
|
||||
// for (i=0; i<72; i++) {
|
||||
// syncF_tmp[2*k] = primary_synch1[2*i]>>2; //we need to shift input to avoid overflow in fft
|
||||
// syncF_tmp[2*k+1] = primary_synch1[2*i+1]>>2;
|
||||
// k++;
|
||||
|
||||
// if (k >= frame_parms->ofdm_symbol_size) {
|
||||
// k++; // skip DC carrier
|
||||
// k-=frame_parms->ofdm_symbol_size;
|
||||
// }
|
||||
// }
|
||||
|
||||
// switch (frame_parms->N_RB_DL) {
|
||||
// case 6:
|
||||
// idft128((short*)syncF_tmp, /// complex input
|
||||
// (short*)sync_tmp, /// complex output
|
||||
// 1);
|
||||
// break;
|
||||
// case 25:
|
||||
// idft512((short*)syncF_tmp, /// complex input
|
||||
// (short*)sync_tmp, /// complex output
|
||||
// 1);
|
||||
// break;
|
||||
// case 50:
|
||||
// idft1024((short*)syncF_tmp, /// complex input
|
||||
// (short*)sync_tmp, /// complex output
|
||||
// 1);
|
||||
// break;
|
||||
|
||||
// case 75:
|
||||
// idft1536((short*)syncF_tmp, /// complex input
|
||||
// (short*)sync_tmp, /// complex output
|
||||
// 1);
|
||||
// break;
|
||||
// case 100:
|
||||
// idft2048((short*)syncF_tmp, /// complex input
|
||||
// (short*)sync_tmp, /// complex output
|
||||
// 1);
|
||||
// break;
|
||||
// default:
|
||||
// LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
|
||||
// break;
|
||||
// }
|
||||
|
||||
// for (i=0; i<frame_parms->ofdm_symbol_size; i++)
|
||||
// ((int32_t*)primary_synch1_time)[i] = sync_tmp[i];
|
||||
|
||||
// k=frame_parms->ofdm_symbol_size-36;
|
||||
|
||||
// for (i=0; i<72; i++) {
|
||||
// syncF_tmp[2*k] = primary_synch2[2*i]>>2; //we need to shift input to avoid overflow in fft
|
||||
// syncF_tmp[2*k+1] = primary_synch2[2*i+1]>>2;
|
||||
// k++;
|
||||
|
||||
// if (k >= frame_parms->ofdm_symbol_size) {
|
||||
// k++; // skip DC carrier
|
||||
// k-=frame_parms->ofdm_symbol_size;
|
||||
// }
|
||||
// }
|
||||
|
||||
// switch (frame_parms->N_RB_DL) {
|
||||
// case 6:
|
||||
// idft128((short*)syncF_tmp, /// complex input
|
||||
// (short*)sync_tmp, /// complex output
|
||||
// 1);
|
||||
// break;
|
||||
// case 25:
|
||||
// idft512((short*)syncF_tmp, /// complex input
|
||||
// (short*)sync_tmp, /// complex output
|
||||
// 1);
|
||||
// break;
|
||||
// case 50:
|
||||
// idft1024((short*)syncF_tmp, /// complex input
|
||||
// (short*)sync_tmp, /// complex output
|
||||
// 1);
|
||||
// break;
|
||||
|
||||
// case 75:
|
||||
// idft1536((short*)syncF_tmp, /// complex input
|
||||
// (short*)sync_tmp, /// complex output
|
||||
// 1);
|
||||
// break;
|
||||
// case 100:
|
||||
// idft2048((short*)syncF_tmp, /// complex input
|
||||
// (short*)sync_tmp, /// complex output
|
||||
// 1);
|
||||
// break;
|
||||
// default:
|
||||
// LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
|
||||
// break;
|
||||
// }
|
||||
|
||||
// for (i=0; i<frame_parms->ofdm_symbol_size; i++)
|
||||
// ((int32_t*)primary_synch2_time)[i] = sync_tmp[i];
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
write_output("primary_sync0.m","psync0",primary_synch0_time,frame_parms->ofdm_symbol_size,1,1);
|
||||
// write_output("primary_sync1.m","psync1",primary_synch1_time,frame_parms->ofdm_symbol_size,1,1);
|
||||
// write_output("primary_sync2.m","psync2",primary_synch2_time,frame_parms->ofdm_symbol_size,1,1);
|
||||
#endif
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
void lte_sync_time_free_NB_IoT(void)
|
||||
{
|
||||
|
||||
|
||||
if (sync_corr_ue0) {
|
||||
msg("Freeing sync_corr_ue (%p)...\n",sync_corr_ue0);
|
||||
free(sync_corr_ue0);
|
||||
}
|
||||
|
||||
// if (sync_corr_ue1) {
|
||||
// msg("Freeing sync_corr_ue (%p)...\n",sync_corr_ue1);
|
||||
// free(sync_corr_ue1);
|
||||
// }
|
||||
|
||||
// if (sync_corr_ue2) {
|
||||
// msg("Freeing sync_corr_ue (%p)...\n",sync_corr_ue2);
|
||||
// free(sync_corr_ue2);
|
||||
// }
|
||||
|
||||
if (primary_synch0_time_NB_IoT) {
|
||||
msg("Freeing primary_sync0_time ...\n");
|
||||
free(primary_synch0_time_NB_IoT);
|
||||
}
|
||||
|
||||
// if (primary_synch1_time) {
|
||||
// msg("Freeing primary_sync1_time ...\n");
|
||||
// free(primary_synch1_time);
|
||||
// }
|
||||
|
||||
// if (primary_synch2_time) {
|
||||
// msg("Freeing primary_sync2_time ...\n");
|
||||
// free(primary_synch2_time);
|
||||
// }
|
||||
|
||||
sync_corr_ue0_NB_IoT = NULL;
|
||||
// sync_corr_ue1 = NULL;
|
||||
// sync_corr_ue2 = NULL;
|
||||
primary_synch0_time_NB_IoT = NULL;
|
||||
// primary_synch1_time = NULL;
|
||||
// primary_synch2_time = NULL;
|
||||
}
|
||||
|
||||
static inline int abs32(int x)
|
||||
{
|
||||
return (((int)((short*)&x)[0])*((int)((short*)&x)[0]) + ((int)((short*)&x)[1])*((int)((short*)&x)[1]));
|
||||
}
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
int debug_cnt=0;
|
||||
#endif
|
||||
|
||||
#define SHIFT 17
|
||||
|
||||
int lte_sync_time_NB_IoT(int **rxdata, ///rx data in time domain
|
||||
NB_IoT_DL_FRAME_PARMS *frame_parms,
|
||||
int *eNB_id)
|
||||
{
|
||||
|
||||
|
||||
|
||||
// perform a time domain correlation using the oversampled sync sequence
|
||||
|
||||
unsigned int n, ar, /*s,*/ peak_pos, peak_val/*, sync_source*/;
|
||||
int result;//result2;
|
||||
// int sync_out[3] = {0,0,0},sync_out2[3] = {0,0,0};
|
||||
// int tmp[3] = {0,0,0};
|
||||
int sync_out = 0;//sync_out2 = 0;
|
||||
int tmp = 0;
|
||||
// int length = LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti>>1;
|
||||
int length = LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti;
|
||||
|
||||
//msg("[SYNC TIME] Calling sync_time.\n");
|
||||
if (sync_corr_ue0 == NULL) {
|
||||
msg("[SYNC TIME] sync_corr_ue0 not yet allocated! Exiting.\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// if (sync_corr_ue1 == NULL) {
|
||||
// msg("[SYNC TIME] sync_corr_ue1 not yet allocated! Exiting.\n");
|
||||
// return(-1);
|
||||
// }
|
||||
|
||||
// if (sync_corr_ue2 == NULL) {
|
||||
// msg("[SYNC TIME] sync_corr_ue2 not yet allocated! Exiting.\n");
|
||||
// return(-1);
|
||||
// }
|
||||
|
||||
peak_val = 0;
|
||||
peak_pos = 0;
|
||||
// sync_source = 0;
|
||||
|
||||
|
||||
for (n=0; n<length; n+=4) {
|
||||
|
||||
#ifdef RTAI_ENABLED
|
||||
|
||||
// This is necessary since the sync takes a long time and it seems to block all other threads thus screwing up RTAI. If we pause it for a little while during its execution we give RTAI a chance to catch up with its other tasks.
|
||||
if ((n%frame_parms->samples_per_tti == 0) && (n>0) && (openair_daq_vars.sync_state==0)) {
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[SYNC TIME] pausing for 1000ns, n=%d\n",n);
|
||||
#endif
|
||||
rt_sleep(nano2count(1000));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
sync_corr_ue0[n] = 0;
|
||||
// sync_corr_ue0[n+length] = 0;
|
||||
// sync_corr_ue1[n] = 0;
|
||||
// sync_corr_ue1[n+length] = 0;
|
||||
// sync_corr_ue2[n] = 0;
|
||||
// sync_corr_ue2[n+length] = 0;
|
||||
|
||||
// for (s=0; s<3; s++) {
|
||||
// sync_out[s]=0;
|
||||
// sync_out2[s]=0;
|
||||
// }
|
||||
|
||||
// if (n<(length-frame_parms->ofdm_symbol_size-frame_parms->nb_prefix_samples)) {
|
||||
if (n<(length-frame_parms->ofdm_symbol_size)) {
|
||||
|
||||
//calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n];
|
||||
// for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
for (ar=0; ar<1; ar++) {
|
||||
|
||||
result = dot_product((short*)primary_synch0_time_NB_IoT, (short*) &(rxdata[ar][n]), 11*frame_parms->ofdm_symbol_size, SHIFT);
|
||||
// result2 = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n+length]), 11*frame_parms->ofdm_symbol_size, SHIFT);
|
||||
|
||||
((short*)sync_corr_ue0_NB_IoT)[2*n] += ((short*) &result)[0];
|
||||
((short*)sync_corr_ue0_NB_IoT)[2*n+1] += ((short*) &result)[1];
|
||||
// ((short*)sync_corr_ue0)[2*(length+n)] += ((short*) &result2)[0];
|
||||
// ((short*)sync_corr_ue0)[(2*(length+n))+1] += ((short*) &result2)[1];
|
||||
((short*)sync_out)[0] += ((short*) &result)[0];
|
||||
((short*)sync_out)[1] += ((short*) &result)[1];
|
||||
// ((short*)sync_out2)[0] += ((short*) &result2)[0];
|
||||
// ((short*)sync_out2)[1] += ((short*) &result2)[1];
|
||||
}
|
||||
|
||||
// for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
// result = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
// result2 = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
// ((short*)sync_corr_ue1)[2*n] += ((short*) &result)[0];
|
||||
// ((short*)sync_corr_ue1)[2*n+1] += ((short*) &result)[1];
|
||||
// ((short*)sync_corr_ue1)[2*(length+n)] += ((short*) &result2)[0];
|
||||
// ((short*)sync_corr_ue1)[(2*(length+n))+1] += ((short*) &result2)[1];
|
||||
|
||||
// ((short*)sync_out)[2] += ((short*) &result)[0];
|
||||
// ((short*)sync_out)[3] += ((short*) &result)[1];
|
||||
// ((short*)sync_out2)[2] += ((short*) &result2)[0];
|
||||
// ((short*)sync_out2)[3] += ((short*) &result2)[1];
|
||||
// }
|
||||
|
||||
// for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
|
||||
// result = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
// result2 = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
// ((short*)sync_corr_ue2)[2*n] += ((short*) &result)[0];
|
||||
// ((short*)sync_corr_ue2)[2*n+1] += ((short*) &result)[1];
|
||||
// ((short*)sync_corr_ue2)[2*(length+n)] += ((short*) &result2)[0];
|
||||
// ((short*)sync_corr_ue2)[(2*(length+n))+1] += ((short*) &result2)[1];
|
||||
// ((short*)sync_out)[4] += ((short*) &result)[0];
|
||||
// ((short*)sync_out)[5] += ((short*) &result)[1];
|
||||
// ((short*)sync_out2)[4] += ((short*) &result2)[0];
|
||||
// ((short*)sync_out2)[5] += ((short*) &result2)[1];
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// calculate the absolute value of sync_corr[n]
|
||||
|
||||
sync_corr_ue0_NB_IoT[n] = abs32(sync_corr_ue0_NB_IoT[n]);
|
||||
// sync_corr_ue0[n+length] = abs32(sync_corr_ue0[n+length]);
|
||||
// sync_corr_ue1[n] = abs32(sync_corr_ue1[n]);
|
||||
// sync_corr_ue1[n+length] = abs32(sync_corr_ue1[n+length]);
|
||||
// sync_corr_ue2[n] = abs32(sync_corr_ue2[n]);
|
||||
// sync_corr_ue2[n+length] = abs32(sync_corr_ue2[n+length]);
|
||||
|
||||
// for (s=0; s<3; s++) {
|
||||
tmp = (abs32(sync_out)>>1); // + (abs32(sync_out2)>>1);
|
||||
|
||||
if (tmp>peak_val) {
|
||||
peak_val = tmp;
|
||||
peak_pos = n;
|
||||
// sync_source = s;
|
||||
/*
|
||||
printf("s %d: n %d sync_out %d, sync_out2 %d (sync_corr %d,%d), (%d,%d) (%d,%d)\n",s,n,abs32(sync_out[s]),abs32(sync_out2[s]),sync_corr_ue0[n],
|
||||
sync_corr_ue0[n+length],((int16_t*)&sync_out[s])[0],((int16_t*)&sync_out[s])[1],((int16_t*)&sync_out2[s])[0],((int16_t*)&sync_out2[s])[1]);
|
||||
*/
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
// *eNB_id = sync_source;
|
||||
|
||||
LOG_D(PHY,"[UE] lte_sync_time: Peak found at pos %d, val = %d (%d dB)\n",peak_pos,peak_val,dB_fixed(peak_val)/2);
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
if (debug_cnt == 0) {
|
||||
write_output("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
|
||||
// write_output("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2);
|
||||
// write_output("sync_corr2_ue.m","synccorr2",sync_corr_ue2,2*length,1,2);
|
||||
write_output("rxdata0.m","rxd0",rxdata[0],length<<1,1,1);
|
||||
// exit(-1);
|
||||
} else {
|
||||
debug_cnt++;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
return(peak_pos);
|
||||
|
||||
}
|
||||
|
||||
//#define DEBUG_PHY
|
||||
|
||||
// int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
// LTE_DL_FRAME_PARMS *frame_parms,
|
||||
// uint32_t length,
|
||||
// uint32_t *peak_val_out,
|
||||
// uint32_t *sync_corr_eNB)
|
||||
// {
|
||||
|
||||
// // perform a time domain correlation using the oversampled sync sequence
|
||||
|
||||
// unsigned int n, ar, peak_val, peak_pos;
|
||||
// uint64_t mean_val;
|
||||
// int result;
|
||||
// short *primary_synch_time;
|
||||
// int eNB_id = frame_parms->Nid_cell%3;
|
||||
|
||||
// // msg("[SYNC TIME] Calling sync_time_eNB(%p,%p,%d,%d)\n",rxdata,frame_parms,eNB_id,length);
|
||||
// if (sync_corr_eNB == NULL) {
|
||||
// LOG_E(PHY,"[SYNC TIME] sync_corr_eNB not yet allocated! Exiting.\n");
|
||||
// return(-1);
|
||||
// }
|
||||
|
||||
// switch (eNB_id) {
|
||||
// case 0:
|
||||
// primary_synch_time = (short*)primary_synch0_time;
|
||||
// break;
|
||||
|
||||
// case 1:
|
||||
// primary_synch_time = (short*)primary_synch1_time;
|
||||
// break;
|
||||
|
||||
// case 2:
|
||||
// primary_synch_time = (short*)primary_synch2_time;
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// LOG_E(PHY,"[SYNC TIME] Illegal eNB_id!\n");
|
||||
// return (-1);
|
||||
// }
|
||||
|
||||
// peak_val = 0;
|
||||
// peak_pos = 0;
|
||||
// mean_val = 0;
|
||||
|
||||
// for (n=0; n<length; n+=4) {
|
||||
|
||||
// sync_corr_eNB[n] = 0;
|
||||
|
||||
// if (n<(length-frame_parms->ofdm_symbol_size-frame_parms->nb_prefix_samples)) {
|
||||
|
||||
// //calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n];
|
||||
// for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
|
||||
// result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
// //((short*)sync_corr)[2*n] += ((short*) &result)[0];
|
||||
// //((short*)sync_corr)[2*n+1] += ((short*) &result)[1];
|
||||
// sync_corr_eNB[n] += abs32(result);
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// /*
|
||||
// if (eNB_id == 2) {
|
||||
// printf("sync_time_eNB %d : %d,%d (%d)\n",n,sync_corr_eNB[n],mean_val,
|
||||
// peak_val);
|
||||
// }
|
||||
// */
|
||||
// mean_val += sync_corr_eNB[n];
|
||||
|
||||
// if (sync_corr_eNB[n]>peak_val) {
|
||||
// peak_val = sync_corr_eNB[n];
|
||||
// peak_pos = n;
|
||||
// }
|
||||
// }
|
||||
|
||||
// mean_val/=length;
|
||||
|
||||
// *peak_val_out = peak_val;
|
||||
|
||||
// if (peak_val <= (40*(uint32_t)mean_val)) {
|
||||
// LOG_D(PHY,"[SYNC TIME] No peak found (%u,%u,%"PRIu64",%"PRIu64")\n",peak_pos,peak_val,mean_val,40*mean_val);
|
||||
// return(-1);
|
||||
// } else {
|
||||
// LOG_D(PHY,"[SYNC TIME] Peak found at pos %u, val = %u, mean_val = %"PRIu64"\n",peak_pos,peak_val,mean_val);
|
||||
// return(peak_pos);
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// #ifdef PHY_ABSTRACTION
|
||||
// #include "SIMULATION/TOOLS/defs.h"
|
||||
// #include "SIMULATION/RF/defs.h"
|
||||
// //extern channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
|
||||
|
||||
// int lte_sync_time_eNB_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
// uint8_t sect_id,
|
||||
// int32_t *sync_val)
|
||||
// {
|
||||
|
||||
// uint8_t UE_id;
|
||||
// uint8_t CC_id = phy_vars_eNB->CC_id;
|
||||
|
||||
// msg("[PHY] EMUL lte_sync_time_eNB_emul eNB %d, sect_id %d\n",phy_vars_eNB->Mod_id,sect_id);
|
||||
// *sync_val = 0;
|
||||
|
||||
// for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
|
||||
// //msg("[PHY] EMUL : eNB %d checking UE %d (PRACH %d) PL %d dB\n",phy_vars_eNB->Mod_id,UE_id,PHY_vars_UE_g[UE_id]->generate_prach,UE2eNB[UE_id][phy_vars_eNB->Mod_id]->path_loss_dB);
|
||||
// if ((PHY_vars_UE_g[UE_id][CC_id]->generate_prach == 1) && (phy_vars_eNB->Mod_id == (UE_id % NB_eNB_INST))) {
|
||||
// *sync_val = 1;
|
||||
// return(0);
|
||||
// }
|
||||
// }
|
||||
|
||||
// return(-1);
|
||||
// }
|
||||
// #endif
|
||||
356
openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq_NB_IoT.c
Normal file
356
openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq_NB_IoT.c
Normal file
@@ -0,0 +1,356 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_ESTIMATION/lte_sync_timefreq.c
|
||||
* \brief Initial time frequency scan of entire LTE band
|
||||
* \author R. Knopp
|
||||
* \date 2014
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: raymond.knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
/* file: lte_sync_timefreq.c
|
||||
purpose: scan for likely cells over entire LTE band using PSS. Provides coarse frequency offset in addtition to 10 top likelihoods per PSS sequence
|
||||
author: raymond.knopp@eurecom.fr
|
||||
date: 23.01.2015
|
||||
*/
|
||||
|
||||
//#include "defs.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "PHY/extern_NB_IoT.h"
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#include "pss6144.h"
|
||||
extern void print_shorts(char*,__m128i*);
|
||||
#endif
|
||||
|
||||
void lte_sync_timefreq_NB_IoT(PHY_VARS_UE_NB_IoT *ue,int band,unsigned int DL_freq)
|
||||
{
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
UE_SCAN_INFO_NB_IoT_t *scan_info = &ue->scan_info[band];
|
||||
int16_t spectrum[12288] __attribute__((aligned(32)));
|
||||
int16_t spectrum_p5ms[12288] __attribute__((aligned(32)));
|
||||
int i,f,band_idx;
|
||||
__m128i autocorr0[256/4],autocorr1[256/4],autocorr2[256/4];
|
||||
__m128i autocorr0_t[256/4],autocorr1_t[256/4],autocorr2_t[256/4];
|
||||
__m128i tmp_t[256/4];
|
||||
int32_t *rxp;
|
||||
int16_t *sp;
|
||||
__m128i *sp2 = NULL;
|
||||
__m128i s;
|
||||
int re,re256;
|
||||
__m128i mmtmp00,mmtmp01,mmtmp02,mmtmp10,mmtmp11,mmtmp12;
|
||||
int maxcorr[3],minamp,pos=0,pssind;
|
||||
int16_t *pss6144_0 = NULL, *pss6144_1 = NULL, *pss6144_2 = NULL;
|
||||
|
||||
/* char fname[100],vname[100];*/
|
||||
|
||||
|
||||
for (i=0; i<38400*4; i+=3072) { // steps of 200 us with 100 us overlap, 0 to 5s
|
||||
// write_output("rxsig0.m","rxs0",ue->lte_ue_common_vars.rxdata[0],30720,1,1);
|
||||
|
||||
//for (i = 15360-3072*2; i<15360+3072+1; i+=3072) {
|
||||
|
||||
|
||||
//compute frequency-domain representation of 6144-sample chunk
|
||||
|
||||
rxp = &ue->common_vars.rxdata[0][i];
|
||||
sp=spectrum;
|
||||
|
||||
while (1) {
|
||||
|
||||
//compute frequency-domain representation of 6144-sample chunk
|
||||
dft6144((int16_t *)rxp,
|
||||
sp);
|
||||
|
||||
|
||||
/*
|
||||
printf("i %d: sp %p\n",i,sp);
|
||||
if (i==12288) {
|
||||
write_output("scan6144F.m","s6144F",sp,6144,1,1);
|
||||
write_output("scan6144.m","s6144",rxp,6144,1,1);
|
||||
write_output("pss0_6144.m","pss0",pss6144_0_0,256,1,1);
|
||||
}*/
|
||||
|
||||
for (f = -2000; f<2000; f++) { // this is -10MHz to 10 MHz in 5 kHz steps
|
||||
|
||||
if ((f<-256)||(f>=0)) { // no split around DC
|
||||
// printf("No split, f %d (%d)\n",f,f&3);
|
||||
|
||||
// align filters and input buffer pointer to 128-bit
|
||||
switch (f&3) {
|
||||
case 0:
|
||||
pss6144_0 = &pss6144_0_0[0];
|
||||
pss6144_1 = &pss6144_1_0[0];
|
||||
pss6144_2 = &pss6144_2_0[0];
|
||||
sp2 = (f<0) ? (__m128i*)&sp[12288+(f<<1)] : (__m128i*)&sp[(f<<1)];
|
||||
break;
|
||||
|
||||
case 1:
|
||||
pss6144_0 = &pss6144_0_1[0];
|
||||
pss6144_1 = &pss6144_1_1[0];
|
||||
pss6144_2 = &pss6144_2_1[0];
|
||||
sp2 = (f<0) ? (__m128i*)&sp[12286+(f<<1)] : (__m128i*)&sp[-2+(f<<1)];
|
||||
break;
|
||||
|
||||
case 2:
|
||||
pss6144_0 = &pss6144_0_2[0];
|
||||
pss6144_1 = &pss6144_1_2[0];
|
||||
pss6144_2 = &pss6144_2_2[0];
|
||||
sp2 = (f<0) ? (__m128i*)&sp[12284+(f<<1)] : (__m128i*)&sp[-4+(f<<1)];
|
||||
break;
|
||||
|
||||
case 3:
|
||||
pss6144_0 = &pss6144_0_3[0];
|
||||
pss6144_1 = &pss6144_1_3[0];
|
||||
pss6144_2 = &pss6144_2_3[0];
|
||||
sp2 = (f<0) ? (__m128i*)&sp[12282+(f<<1)] : (__m128i*)&sp[-6+(f<<1)];
|
||||
break;
|
||||
}
|
||||
|
||||
re256=32;
|
||||
|
||||
for (re = 0; re<256/4; re++) { // loop over 256 points of upsampled PSS
|
||||
// printf("f %d, re %d\n",f,re);
|
||||
s = sp2[re];
|
||||
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp01 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp02 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
s = _mm_shufflelo_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_shufflehi_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_sign_epi16(s,*(__m128i*)&conjugate[0]);
|
||||
mmtmp10 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp11 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp12 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
autocorr0[re256] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp00,mmtmp10),_mm_unpackhi_epi32(mmtmp00,mmtmp10));
|
||||
autocorr1[re256] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp01,mmtmp11),_mm_unpackhi_epi32(mmtmp01,mmtmp11));
|
||||
autocorr2[re256] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp02,mmtmp12),_mm_unpackhi_epi32(mmtmp02,mmtmp12));
|
||||
|
||||
re256 = (re256+1)&0x3f;
|
||||
}
|
||||
} else { // Split around DC, this is the negative frequencies
|
||||
// printf("split around DC, f %d (f/4 %d, f&3 %d)\n",f,f>>2,f&3);
|
||||
|
||||
// align filters and input buffer pointer to 128-bit
|
||||
switch (f&3) {
|
||||
case 0:
|
||||
pss6144_0 = &pss6144_0_0[0];
|
||||
pss6144_1 = &pss6144_1_0[0];
|
||||
pss6144_2 = &pss6144_2_0[0];
|
||||
sp2 = (__m128i*)&sp[12288+(f<<1)];
|
||||
break;
|
||||
|
||||
case 1:
|
||||
pss6144_0 = &pss6144_0_1[0];
|
||||
pss6144_1 = &pss6144_1_1[0];
|
||||
pss6144_2 = &pss6144_2_1[0];
|
||||
sp2 = (__m128i*)&sp[12286+(f<<1)];
|
||||
break;
|
||||
|
||||
case 2:
|
||||
pss6144_0 = &pss6144_0_2[0];
|
||||
pss6144_1 = &pss6144_1_2[0];
|
||||
pss6144_2 = &pss6144_2_2[0];
|
||||
sp2 = (__m128i*)&sp[12284+(f<<1)];
|
||||
break;
|
||||
|
||||
case 3:
|
||||
pss6144_0 = &pss6144_0_3[0];
|
||||
pss6144_1 = &pss6144_1_3[0];
|
||||
pss6144_2 = &pss6144_2_3[0];
|
||||
sp2 = (__m128i*)&sp[12282+(f<<1)];
|
||||
break;
|
||||
}
|
||||
|
||||
re256 = 32;
|
||||
|
||||
for (re = 0; re<(-f+3)/4; re++) { // loop over 256 points of upsampled PSS
|
||||
s = sp2[re];
|
||||
/* printf("re %d, %p\n",re,&sp2[re]);
|
||||
print_shorts("s",&s);
|
||||
print_shorts("pss",&((__m128i*)pss6144_0)[re]);*/
|
||||
|
||||
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp01 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp02 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
s = _mm_shufflelo_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_shufflehi_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_sign_epi16(s,*(__m128i*)&conjugate[0]);
|
||||
mmtmp10 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp11 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp12 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
autocorr0[re256] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp00,mmtmp10),_mm_unpackhi_epi32(mmtmp00,mmtmp10));
|
||||
autocorr1[re256] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp01,mmtmp11),_mm_unpackhi_epi32(mmtmp01,mmtmp11));
|
||||
autocorr2[re256] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp02,mmtmp12),_mm_unpackhi_epi32(mmtmp02,mmtmp12));
|
||||
|
||||
re256 = (re256+1)&0x3f;
|
||||
}
|
||||
|
||||
// This is the +ve frequencies
|
||||
|
||||
// align filters to 128-bit
|
||||
sp2 = (__m128i*)&sp[0];
|
||||
|
||||
switch (f&3) {
|
||||
case 0:
|
||||
pss6144_0 = &pss6144_0_0[256];
|
||||
pss6144_1 = &pss6144_1_0[256];
|
||||
pss6144_2 = &pss6144_2_0[256];
|
||||
break;
|
||||
|
||||
case 1:
|
||||
pss6144_0 = &pss6144_0_1[256];
|
||||
pss6144_1 = &pss6144_1_1[256];
|
||||
pss6144_2 = &pss6144_2_1[256];
|
||||
break;
|
||||
|
||||
case 2:
|
||||
pss6144_0 = &pss6144_0_2[256];
|
||||
pss6144_1 = &pss6144_1_2[256];
|
||||
pss6144_2 = &pss6144_2_2[256];
|
||||
break;
|
||||
|
||||
case 3:
|
||||
pss6144_0 = &pss6144_0_3[256];
|
||||
pss6144_1 = &pss6144_1_3[256];
|
||||
pss6144_2 = &pss6144_2_3[256];
|
||||
break;
|
||||
}
|
||||
|
||||
for (re = 0; re<(256+f)/4; re++) { // loop over 256 points of upsampled PSS
|
||||
s = sp2[re];
|
||||
/* printf("re %d %p\n",re,&sp2[re]);
|
||||
print_shorts("s",&s);
|
||||
print_shorts("pss",&((__m128i*)pss6144_0)[re]);*/
|
||||
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp01 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp02 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
s = _mm_shufflelo_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_shufflehi_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_sign_epi16(s,*(__m128i*)&conjugate[0]);
|
||||
mmtmp10 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp11 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp12 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
autocorr0[re256] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp00,mmtmp10),_mm_unpackhi_epi32(mmtmp00,mmtmp10));
|
||||
autocorr1[re256] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp01,mmtmp11),_mm_unpackhi_epi32(mmtmp01,mmtmp11));
|
||||
autocorr2[re256] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp02,mmtmp12),_mm_unpackhi_epi32(mmtmp02,mmtmp12));
|
||||
|
||||
re256 = (re256+1)&0x3f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ifft, accumulate energy over two half-frames
|
||||
idft256((int16_t*)autocorr0,(int16_t*)tmp_t,1);
|
||||
/*
|
||||
if (i==12288) {
|
||||
sprintf(fname,"corr256F_%d.m",abs(f));
|
||||
sprintf(vname,"c256F_%d",abs(f));
|
||||
write_output(fname,vname,autocorr0,256,1,1);
|
||||
sprintf(fname,"corr256_%d.m",abs(f));
|
||||
sprintf(vname,"c256_%d",abs(f));
|
||||
write_output(fname,vname,tmp_t,256,1,1);
|
||||
}*/
|
||||
|
||||
memset((void*)autocorr0_t,0,256*4);
|
||||
memset((void*)autocorr1_t,0,256*4);
|
||||
memset((void*)autocorr2_t,0,256*4);
|
||||
|
||||
for (re=0; re<(256/4); re++)
|
||||
autocorr0_t[re] = _mm_add_epi32(autocorr0_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
|
||||
|
||||
idft256((int16_t*)autocorr1,(int16_t*)tmp_t,1);
|
||||
|
||||
for (re=0; re<(256/4); re++)
|
||||
autocorr1_t[re] = _mm_add_epi32(autocorr1_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
|
||||
|
||||
idft256((int16_t*)autocorr2,(int16_t*)tmp_t,1);
|
||||
|
||||
for (re=0; re<(256/4); re++)
|
||||
autocorr2_t[re] = _mm_add_epi32(autocorr2_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
|
||||
|
||||
|
||||
//compute max correlation over time window
|
||||
maxcorr[0] = 0;
|
||||
maxcorr[1] = 0;
|
||||
maxcorr[2] = 0;
|
||||
|
||||
for (re=0; re<256; re++) {
|
||||
|
||||
if (((int32_t*)autocorr0_t)[re] > maxcorr[0]) {
|
||||
maxcorr[0]=((int32_t*)autocorr0_t)[re];
|
||||
}
|
||||
|
||||
if (((int32_t*)autocorr1_t)[re] > maxcorr[1])
|
||||
maxcorr[1]=((int32_t*)autocorr1_t)[re];
|
||||
|
||||
if (((int32_t*)autocorr2_t)[re] > maxcorr[2])
|
||||
maxcorr[2]=((int32_t*)autocorr2_t)[re];
|
||||
}
|
||||
|
||||
|
||||
for (pssind=0; pssind<3; pssind++) {
|
||||
|
||||
minamp=(int)((1<<30)-1);
|
||||
|
||||
for (band_idx=0; band_idx<10; band_idx++)
|
||||
if (minamp > scan_info->amp[pssind][band_idx]) {
|
||||
minamp = scan_info->amp[pssind][band_idx];
|
||||
pos = band_idx;
|
||||
}
|
||||
|
||||
if (maxcorr[pssind]>minamp) {
|
||||
scan_info->amp[pssind][pos]=maxcorr[pssind];
|
||||
scan_info->freq_offset_Hz[pssind][pos]=((f+128)*5000)+DL_freq;
|
||||
printf("pss %d, amp %d (%d>%d) freq %u (%d), i %d\n",pssind,dB_fixed(maxcorr[pssind]),maxcorr[pssind],minamp,((f+128)*5000)+DL_freq,f,i);
|
||||
}
|
||||
} // loop on pss index
|
||||
}
|
||||
|
||||
if (rxp == &ue->common_vars.rxdata[0][i+38400*4]) {
|
||||
rxp = &ue->common_vars.rxdata[0][i+38400*4];
|
||||
sp=spectrum_p5ms;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}// loop on time index i
|
||||
|
||||
for (band_idx=0; band_idx<10; band_idx++)
|
||||
printf("pss 0: level %d dB, freq %u\n", dB_fixed(scan_info->amp[0][band_idx]),scan_info->freq_offset_Hz[0][band_idx]);
|
||||
|
||||
for (band_idx=0; band_idx<10; band_idx++)
|
||||
printf("pss 1: level %d dB, freq %u\n", dB_fixed(scan_info->amp[1][band_idx]),scan_info->freq_offset_Hz[1][band_idx]);
|
||||
|
||||
for (band_idx=0; band_idx<10; band_idx++)
|
||||
printf("pss 2: level %d dB, freq %u\n", dB_fixed(scan_info->amp[2][band_idx]),scan_info->freq_offset_Hz[2][band_idx]);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
1717
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation_NB_IoT.c
Normal file
1717
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation_NB_IoT.c
Normal file
File diff suppressed because it is too large
Load Diff
64
openair1/PHY/LTE_REFSIG/defs_NB_IoT.h
Normal file
64
openair1/PHY/LTE_REFSIG/defs_NB_IoT.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*******************************************************************************
|
||||
|
||||
*******************************************************************************/
|
||||
/*! \file PHY/LTE_REFSIG/defs_NB_IoT.c
|
||||
* \function called by lte_dl_cell_spec_NB_IoT.c , TS 36-211, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
/* Definitions for NB_IoT Reference signals */
|
||||
|
||||
#ifndef __LTE_REFSIG_DEFS_NB_IOT__H__
|
||||
#define __LTE_REFSIG_DEFS_NB_IOT__H__
|
||||
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "PHY/defs.h"
|
||||
/** @ingroup _PHY_REF_SIG
|
||||
* @{
|
||||
*/
|
||||
/*!\brief This function generates the LTE Gold sequence (36-211, Sec 7.2), specifically for DL reference signals.
|
||||
@param frame_parms LTE DL Frame parameters
|
||||
@param lte_gold_table pointer to table where sequences are stored
|
||||
@param Nid_cell Cell Id for NB_IoT (to compute sequences for local and adjacent cells) */
|
||||
|
||||
void lte_gold_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t lte_gold_table_NB_IoT[20][2][14],
|
||||
uint16_t Nid_cell);
|
||||
|
||||
|
||||
|
||||
unsigned int lte_gold_generic_NB_IoT(unsigned int *x1, unsigned int *x2, unsigned char reset);
|
||||
|
||||
/*! \brief This function generates the Narrowband reference signal (NRS) sequence (36-211, Sec 6.10.1.1)
|
||||
@param phy_vars_eNB Pointer to eNB variables
|
||||
@param output Output vector for OFDM symbol (Frequency Domain)
|
||||
@param amp Q15 amplitude
|
||||
@param Ns Slot number (0..19)
|
||||
@param l symbol (0,1) - Note 1 means 3!
|
||||
@param p antenna index
|
||||
@param RB_IoT_ID the ID of the RB dedicated for NB_IoT
|
||||
*/
|
||||
int lte_dl_cell_spec_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
|
||||
int32_t *output,
|
||||
short amp,
|
||||
unsigned char Ns,
|
||||
unsigned char l,
|
||||
unsigned char p,
|
||||
unsigned short RB_IoT_ID);
|
||||
|
||||
|
||||
unsigned int lte_gold_generic_NB_IoT(unsigned int *x1,
|
||||
unsigned int *x2,
|
||||
unsigned char reset);
|
||||
|
||||
void generate_ul_ref_sigs_rx_NB_IoT(void);
|
||||
|
||||
void free_ul_ref_sigs_NB_IoT(void);
|
||||
|
||||
#endif
|
||||
47
openair1/PHY/LTE_REFSIG/first_synchro_NB_IoT.m
Normal file
47
openair1/PHY/LTE_REFSIG/first_synchro_NB_IoT.m
Normal file
@@ -0,0 +1,47 @@
|
||||
function [ theta_estim, estim_CFO ] = Fc_first_synchro( observation, L_frame, L_sub_frame, FFT_size, L_symbol, N_subframe_observation, L_CP, SNR, type_first_estim )
|
||||
% This function performs the estimation of the beginning of symbols as well
|
||||
% as the estimation of CFO. It allows for a coarse synchronization
|
||||
|
||||
gamma = zeros(1,L_frame);
|
||||
epsilon = zeros(1,L_frame);
|
||||
|
||||
for n = 1 : 1 : length(gamma)
|
||||
|
||||
gamma(n) = sum(observation(n:n+L_CP-1).*conj(observation(n+FFT_size:n+FFT_size+L_CP-1)));
|
||||
epsilon(n) = sum(abs(observation(n:n+L_CP-1)).^2 + abs(observation(n+FFT_size:n+FFT_size+L_CP-1)).^2);
|
||||
end
|
||||
|
||||
rho = 10^(SNR/20)/(10^(SNR/20)+1);
|
||||
theta = 2*abs(gamma)-rho*(epsilon);
|
||||
|
||||
% Estimation of the symbol start and the corresponding CFO
|
||||
|
||||
theta_reshape = reshape(theta,L_symbol,N_subframe_observation*L_sub_frame);
|
||||
% gamma_reshape = reshape(gamma,L_symbol,N_subframe_observation*L_sub_frame); % useful for estimation of CFO
|
||||
[~,index_max] = max(theta_reshape); % where theta is max symbol by symbol
|
||||
|
||||
switch type_first_estim
|
||||
case 1
|
||||
%estimation by mean
|
||||
theta_estim = sum(index_max)/length(index_max); % estimation by mean
|
||||
estim_CFO = -1/(2*pi)*atan(imag(gamma(round(theta_estim)))/real(gamma(round(theta_estim))));
|
||||
case 2
|
||||
%estimation by majority
|
||||
counter_index = zeros(1,L_symbol);
|
||||
for k = 1 : 1 : length(index_max)
|
||||
|
||||
counter_index(index_max(k)) = counter_index(index_max(k)) + 1; % add the number of index_max
|
||||
|
||||
end
|
||||
|
||||
[~,theta_estim] = max(counter_index); % get the max of index max -> theta estim
|
||||
% index_index_max = find(index_max == theta_estim);
|
||||
% estim_CFO = -1/(2*pi)*atan(imag(gamma(round(theta_estim)))/real(gamma(round(theta_estim))));
|
||||
estim_CFO_vec = -1/(2*pi)*atan(imag(gamma(round(theta_estim:L_symbol:end)))./real(gamma(round(theta_estim:L_symbol:end))));
|
||||
% estim_CFO_vec2 = -1/(2*pi)*atan(imag(gamma_reshape(theta_estim,index_max(index_index_max)))./real(gamma_reshape(theta_estim,index_max(index_index_max))));
|
||||
estim_CFO = sum(estim_CFO_vec)/length(estim_CFO_vec);
|
||||
% estim_CFO_2 = sum(estim_CFO_vec2)/length(estim_CFO_vec2);
|
||||
otherwise
|
||||
print('error: type of estimation not defined')
|
||||
end
|
||||
|
||||
161
openair1/PHY/LTE_REFSIG/lte_dl_cell_spec_NB_IoT.c
Normal file
161
openair1/PHY/LTE_REFSIG/lte_dl_cell_spec_NB_IoT.c
Normal file
@@ -0,0 +1,161 @@
|
||||
/***********************************************************************
|
||||
|
||||
**********************************************************************/
|
||||
/*! \file PHY/LTE_REFSIG/lte_dl_cell_spec_NB_IoT.c
|
||||
* \function called by pilots_NB_IoT.c , TS 36-211, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
/* check if this is required for NB-IoT
|
||||
#ifdef USER_MODE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
*/
|
||||
#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
|
||||
int lte_dl_cell_spec_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
|
||||
int32_t *output,
|
||||
short amp,
|
||||
unsigned char Ns,
|
||||
unsigned char l,
|
||||
unsigned char p,
|
||||
unsigned short RB_IoT_ID) // the ID of the RB dedicated for NB_IoT
|
||||
{
|
||||
unsigned char nu,m;
|
||||
unsigned char mprime,mprime_dword,mprime_qpsk_symb;
|
||||
unsigned short k,a;
|
||||
unsigned short NB_IoT_start,bandwidth_even_odd;
|
||||
int32_t qpsk[4];
|
||||
|
||||
a = (amp*ONE_OVER_SQRT2_Q15_NB_IoT)>>15;
|
||||
((short *)&qpsk[0])[0] = a;
|
||||
((short *)&qpsk[0])[1] = a;
|
||||
((short *)&qpsk[1])[0] = -a;
|
||||
((short *)&qpsk[1])[1] = a;
|
||||
((short *)&qpsk[2])[0] = a;
|
||||
((short *)&qpsk[2])[1] = -a;
|
||||
((short *)&qpsk[3])[0] = -a;
|
||||
((short *)&qpsk[3])[1] = -a;
|
||||
|
||||
if ((p==0) && (l==0) )
|
||||
nu = 0;
|
||||
else if ((p==0) && (l>0))
|
||||
nu = 3;
|
||||
else if ((p==1) && (l==0))
|
||||
nu = 3;
|
||||
else if ((p==1) && (l>0))
|
||||
nu = 0;
|
||||
else {
|
||||
printf("lte_dl_cell_spec_NB_IoT: p %d, l %d -> ERROR\n",p,l);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
//mprime = 110 - eNB->frame_parms.N_RB_DL;
|
||||
mprime = 109;
|
||||
// testing if the total number of RBs is even or odd
|
||||
bandwidth_even_odd = phy_vars_eNB->frame_parms.N_RB_DL % 2; // 0 even, 1 odd
|
||||
|
||||
//mprime = 0; // mprime = 0,1 for NB_IoT // for LTE , maximum number of resources blocks (110) - the total number of RB in the selected bandwidth (.... 15 , 25 , 50, 100)
|
||||
k = (nu + phy_vars_eNB->frame_parms.nushift)%6;
|
||||
|
||||
if(RB_IoT_ID < (phy_vars_eNB->frame_parms.N_RB_DL/2))
|
||||
{ //XXX this mod operation is not valid since the second member is not an integer but double (for the moment i put a cast)
|
||||
NB_IoT_start = phy_vars_eNB->frame_parms.ofdm_symbol_size - 12*(phy_vars_eNB->frame_parms.N_RB_DL/2) - (bandwidth_even_odd*6) + 12*(RB_IoT_ID%((int)(ceil(phy_vars_eNB->frame_parms.N_RB_DL/(float)2))));
|
||||
} else {
|
||||
//XXX invalid mod operation (put a cast for the moment)
|
||||
NB_IoT_start = 1 + (bandwidth_even_odd*6) + 12*(RB_IoT_ID%((int)(ceil(phy_vars_eNB->frame_parms.N_RB_DL/(float)2))));
|
||||
}
|
||||
|
||||
k+=NB_IoT_start;
|
||||
|
||||
DevAssert( Ns < 20 );
|
||||
DevAssert( l < 2 );
|
||||
|
||||
for (m=0; m<2; m++) {
|
||||
mprime_dword = mprime>>4;
|
||||
mprime_qpsk_symb = mprime&0xf;
|
||||
|
||||
output[k] = qpsk[(phy_vars_eNB->lte_gold_table_NB_IoT[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb)) & 3]; //TODO should be defined one for NB-IoT
|
||||
|
||||
mprime++;
|
||||
k+=6;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
int lte_dl_cell_spec_NB_IoT(PHY_VARS_eNB_NB_IoT *phy_vars_eNB,
|
||||
int32_t *output,
|
||||
short amp,
|
||||
unsigned char Ns,
|
||||
unsigned char l,
|
||||
unsigned char p,
|
||||
unsigned short RB_IoT_ID) // the ID of the RB dedicated for NB_IoT
|
||||
{
|
||||
unsigned char nu,m;
|
||||
unsigned short k,a;
|
||||
unsigned short NB_IoT_start,bandwidth_even_odd;
|
||||
int32_t qpsk[4];
|
||||
|
||||
a = (amp*ONE_OVER_SQRT2_Q15_NB_IoT)>>15;
|
||||
((short *)&qpsk[0])[0] = a;
|
||||
((short *)&qpsk[0])[1] = a;
|
||||
((short *)&qpsk[1])[0] = -a;
|
||||
((short *)&qpsk[1])[1] = a;
|
||||
((short *)&qpsk[2])[0] = a;
|
||||
((short *)&qpsk[2])[1] = -a;
|
||||
((short *)&qpsk[3])[0] = -a;
|
||||
((short *)&qpsk[3])[1] = -a;
|
||||
|
||||
if ((p==0) && (l==0) )
|
||||
nu = 0;
|
||||
else if ((p==0) && (l>0))
|
||||
nu = 3;
|
||||
else if ((p==1) && (l==0))
|
||||
nu = 3;
|
||||
else if ((p==1) && (l>0))
|
||||
nu = 0;
|
||||
else {
|
||||
printf("lte_dl_cell_spec_NB_IoT: p %d, l %d -> ERROR\n",p,l);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// testing if the total number of RBs is even or odd
|
||||
bandwidth_even_odd = phy_vars_eNB->frame_parms.N_RB_DL % 2; // 0 even, 1 odd
|
||||
|
||||
//mprime = 0; // mprime = 0,1 for NB_IoT // for LTE , maximum number of resources blocks (110) - the total number of RB in the selected bandwidth (.... 15 , 25 , 50, 100)
|
||||
k = (nu + phy_vars_eNB->frame_parms.nushift)%6;
|
||||
|
||||
if(RB_IoT_ID < (phy_vars_eNB->frame_parms.N_RB_DL/2))
|
||||
{ //XXX this mod operation is not valid since the second member is not an integer but double (for the moment i put a cast)
|
||||
NB_IoT_start = phy_vars_eNB->frame_parms.ofdm_symbol_size - 12*(phy_vars_eNB->frame_parms.N_RB_DL/2) - (bandwidth_even_odd*6) + 12*(RB_IoT_ID%((int)(ceil(phy_vars_eNB->frame_parms.N_RB_DL/(float)2))));
|
||||
} else {
|
||||
//XXX invalid mod operation (put a cast for the moment)
|
||||
NB_IoT_start = (bandwidth_even_odd*6) + 12*(RB_IoT_ID%((int)(ceil(phy_vars_eNB->frame_parms.N_RB_DL/(float)2))));
|
||||
}
|
||||
|
||||
k+=NB_IoT_start;
|
||||
|
||||
DevAssert( Ns < 20 );
|
||||
DevAssert( l < 2 );
|
||||
|
||||
for (m=0; m<2; m++) {
|
||||
output[k] = qpsk[(phy_vars_eNB->lte_gold_table_NB_IoT[Ns][l][0]) & 3]; //TODO should be defined one for NB-IoT
|
||||
k+=6;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
*/
|
||||
82
openair1/PHY/LTE_REFSIG/lte_gold_NB_IoT.c
Normal file
82
openair1/PHY/LTE_REFSIG/lte_gold_NB_IoT.c
Normal file
@@ -0,0 +1,82 @@
|
||||
/***********************************************************************
|
||||
|
||||
**********************************************************************/
|
||||
/*! \file PHY/LTE_REFSIG/lte_gold_NB_IoT.c
|
||||
* \function called by lte_dl_cell_spec_NB_IoT.c , TS 36-211, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
//#include "defs.h"
|
||||
#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
|
||||
|
||||
void lte_gold_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table_NB_IoT[20][2][14],uint16_t Nid_cell) // Nid_cell = Nid_cell_NB_IoT
|
||||
{
|
||||
unsigned char ns,l,Ncp=1;
|
||||
unsigned int n,x1,x2;
|
||||
|
||||
for (ns=0; ns<20; ns++) {
|
||||
|
||||
for (l=0; l<2; l++) {
|
||||
|
||||
x2 = Ncp + (Nid_cell<<1) + (((1+(Nid_cell<<1))*(1 + (l+5) + (7*(1+ns))))<<10); //cinit
|
||||
|
||||
x1 = 1+ (1<<31);
|
||||
x2 = x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31);
|
||||
|
||||
// skip first 50 double words (1600 bits)
|
||||
for (n=1; n<50; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
}
|
||||
|
||||
for (n=0; n<14; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
lte_gold_table_NB_IoT[ns][l][n] = x1^x2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// \brief gold sequenquence generator
|
||||
//\param x1
|
||||
//\param x2 this should be set to c_init if reset=1
|
||||
//\param reset resets the generator
|
||||
//\return 32 bits of the gold sequence
|
||||
|
||||
unsigned int lte_gold_generic_NB_IoT(unsigned int *x1, unsigned int *x2, unsigned char reset)
|
||||
{
|
||||
int n;
|
||||
if (reset) {
|
||||
*x1 = 1+ (1<<31);
|
||||
*x2=*x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31);
|
||||
|
||||
for (n=1; n<50; n++) {
|
||||
*x1 = (*x1>>1) ^ (*x1>>4);
|
||||
*x1 = *x1 ^ (*x1<<31) ^ (*x1<<28);
|
||||
*x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4);
|
||||
*x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28);
|
||||
}
|
||||
}
|
||||
|
||||
*x1 = (*x1>>1) ^ (*x1>>4);
|
||||
*x1 = *x1 ^ (*x1<<31) ^ (*x1<<28);
|
||||
*x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4);
|
||||
*x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28);
|
||||
return(*x1^*x2);
|
||||
}
|
||||
|
||||
|
||||
328
openair1/PHY/LTE_REFSIG/lte_ul_ref_NB_IoT.c
Normal file
328
openair1/PHY/LTE_REFSIG/lte_ul_ref_NB_IoT.c
Normal file
@@ -0,0 +1,328 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
/*! \file PHY/LTE_REFSIG/lte_ul_ref_NB_IoT.c
|
||||
* \function called by lte_dl_cell_spec_NB_IoT.c , TS 36-211, V13.4.0 2017-02
|
||||
* \author: Vincent Savaux
|
||||
* \date 2018
|
||||
* \version 0.0
|
||||
* \company b<>com
|
||||
* \email: vincent.savaux@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifdef MAIN
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#endif
|
||||
// #include "defs.h"
|
||||
#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
|
||||
// uint16_t dftsizes[33] = {12,24,36,48,60,72,96,108,120,144,180,192,216,240,288,300,324,360,384,432,480,540,576,600,648,720,864,900,960,972,1080,1152,1200};
|
||||
|
||||
// uint16_t ref_primes[33] = {11,23,31,47,59,71,89,107,113,139,179,191,211,239,283,293,317,359,383,431,479,523,571,599,647,719,863,887,953,971,1069,1151,1193};
|
||||
|
||||
uint16_t sequence_length[4] = {100,100,100,100}; //the "32" value corresponds to the max gold sequence length
|
||||
|
||||
// int16_t *ul_ref_sigs[30][33];
|
||||
int16_t *ul_ref_sigs_rx_NB_IoT[30][4]; //these contain the sequences in repeated format and quantized to QPSK ifdef IFFT_FPGA
|
||||
int16_t *ul_ref_sigs_f2_rx_NB_IoT[16]; //this table contain the 16 possible pilots for format 2 NPUSCH
|
||||
uint16_t u_max[4] = {16,12,14,30}; // maximum u value, see 36.211, Section 10.1.4
|
||||
|
||||
/* 36.211 table 5.5.1.2-1 */
|
||||
char ref12_NB_IoT[360] = {-1,1,3,-3,3,3,1,1,3,1,-3,3,1,1,3,3,3,-1,1,-3,-3,1,-3,3,1,1,-3,-3,-3,-1,-3,-3,1,-3,1,-1,-1,1,1,1,1,-1,-3,-3,1,-3,3,-1,-1,3,1,-1,1,-1,-3,-1,1,-1,1,3,1,-3,3,-1,-1,1,1,-1,-1,3,-3,1,-1,3,-3,-3,-3,3,1,-1,3,3,-3,1,-3,-1,-1,-1,1,-3,3,-1,1,-3,3,1,1,-3,3,1,-1,-1,-1,1,1,3,-1,1,1,-3,-1,3,3,-1,-3,1,1,1,1,1,-1,3,-1,1,1,-3,-3,-1,-3,-3,3,-1,3,1,-1,-1,3,3,-3,1,3,1,3,3,1,-3,1,1,-3,1,1,1,-3,-3,-3,1,3,3,-3,3,-3,1,1,3,-1,-3,3,3,-3,1,-1,-3,-1,3,1,3,3,3,-1,1,3,-1,1,-3,-1,-1,1,1,3,1,-1,-3,1,3,1,-1,1,3,3,3,-1,-1,3,-1,-3,1,1,3,-3,3,-3,-3,3,1,3,-1,-3,3,1,1,-3,1,-3,-3,-1,-1,1,-3,-1,3,1,3,1,-1,-1,3,-3,-1,-3,-1,-1,-3,1,1,1,1,3,1,-1,1,-3,-1,-1,3,-1,1,-3,-3,-3,-3,-3,1,-1,-3,1,1,-3,-3,-3,-3,-1,3,-3,1,-3,3,1,1,-1,-3,-1,-3,1,-1,1,3,-1,1,1,1,3,1,3,3,-1,1,-1,-3,-3,1,1,-3,3,3,1,3,3,1,-3,-1,-1,3,1,3,-3,-3,3,-3,1,-1,-1,3,-1,-3,-3,-1,-3,-1,-3,3,1,-1,1,3,-3,-3,-1,3,-3,3,-1,3,3,-3,3,3,-1,-1,3,-3,-3,-1,-1,-3,-1,3,-3,3,1,-1};
|
||||
|
||||
/* 36.211 table 5.5.1.2-2 */
|
||||
// char ref24[720] = {
|
||||
// -1,3,1,-3,3,-1,1,3,-3,3,1,3,-3,3,1,1,-1,1,3,-3,3,-3,-1,-3,-3,3,-3,-3,-3,1,-3,-3,3,-1,1,1,1,3,1,-1,3,-3,-3,1,3,1,1,-3,3,-1,3,3,1,1,-3,3,3,3,3,1,-1,3,-1,1,1,-1,-3,-1,-1,1,3,3,-1,-3,1,1,3,-3,1,1,-3,-1,-1,1,3,1,3,1,-1,3,1,1,-3,-1,-3,-1,-1,-1,-1,-3,-3,-1,1,1,3,3,-1,3,-1,1,-1,-3,1,-1,-3,-3,1,-3,-1,-1,-3,1,1,3,-1,1,3,1,-3,1,-3,1,1,-1,-1,3,-1,-3,3,-3,-3,-3,1,1,1,1,-1,-1,3,-3,-3,3,-3,1,-1,-1,1,-1,1,1,-1,-3,-1,1,-1,3,-1,-3,-3,3,3,-1,-1,-3,-1,3,1,3,1,3,1,1,-1,3,1,-1,1,3,-3,-1,-1,1,-3,1,3,-3,1,-1,-3,3,-3,3,-1,-1,-1,-1,1,-3,-3,-3,1,-3,-3,-3,1,-3,1,1,-3,3,3,-1,-3,-1,3,-3,3,3,3,-1,1,1,-3,1,-1,1,1,-3,1,1,-1,1,-3,-3,3,-1,3,-1,-1,-3,-3,-3,-1,-3,-3,1,-1,1,3,3,-1,1,-1,3,1,3,3,-3,-3,1,3,1,-1,-3,-3,-3,3,3,-3,3,3,-1,-3,3,-1,1,-3,1,1,3,3,1,1,1,-1,-1,1,-3,3,-1,1,1,-3,3,3,-1,-3,3,-3,-1,-3,-1,3,-1,-1,-1,-1,-3,-1,3,3,1,-1,1,3,3,3,-1,1,1,-3,1,3,-1,-3,3,-3,-3,3,1,3,1,-3,3,1,3,1,1,3,3,-1,-1,-3,1,-3,-1,3,1,1,3,-1,-1,1,-3,1,3,-3,1,-1,-3,-1,3,1,3,1,-1,-3,-3,-1,-1,-3,-3,-3,-1,-1,-3,3,-1,-1,-1,-1,1,1,-3,3,1,3,3,1,-1,1,-3,1,-3,1,1,-3,-1,1,3,-1,3,3,-1,-3,1,-1,-3,3,3,3,-1,1,1,3,-1,-3,-1,3,-1,-1,-1,1,1,1,1,1,-1,3,-1,-3,1,1,3,-3,1,-3,-1,1,1,-3,-3,3,1,1,-3,1,3,3,1,-1,-3,3,-1,3,3,3,-3,1,-1,1,-1,-3,-1,1,3,-1,3,-3,-3,-1,-3,3,-3,-3,-3,-1,-1,-3,-1,-3,3,1,3,-3,-1,3,-1,1,-1,3,-3,1,-1,-3,-3,1,1,-1,1,-1,1,-1,3,1,-3,-1,1,-1,1,-1,-1,3,3,-3,-1,1,-3,-3,-1,-3,3,1,-1,-3,-1,-3,-3,3,-3,3,-3,-1,1,3,1,-3,1,3,3,-1,-3,-1,-1,-1,-1,3,3,3,1,3,3,-3,1,3,-1,3,-1,3,3,-3,3,1,-1,3,3,1,-1,3,3,-1,-3,3,-3,-1,-1,3,-1,3,-1,-1,1,1,1,1,-1,-1,-3,-1,3,1,-1,1,-1,3,-1,3,1,1,-1,-1,-3,1,1,-3,1,3,-3,1,1,-3,-3,-1,-1,-3,-1,1,3,1,1,-3,-1,-1,-3,3,-3,3,1,-3,3,-3,1,-1,1,-3,1,1,1,-1,-3,3,3,1,1,3,-1,-3,-1,-1,-1,3,1,-3,-3,-1,3,-3,-1,-3,-1,-3,-1,-1,-3,-1,-1,1,-3,-1,-1,1,-1,-3,1,1,-3,1,-3,-3,3,1,1,-1,3,-1,-1,1,1,-1,-1,-3,-1,3,-1,3,-1,1,3,1,-1,3,1,3,-3,-3,1,-1,-1,1,3
|
||||
// };
|
||||
|
||||
// 36.211, Section 10.1.4.1.2, Table 10.1.4.1.2-1
|
||||
char ref3[36] = {1, -3, -3, 1, -3, -1, 1, -3, 3, 1, -1, -1, 1, -1, 1, 1, -1, 3, 1, 1, -3, 1, 1, -1, 1, 1, 3, 1, 3, -1, 1, 3, 1, 1, 3, 3 };
|
||||
|
||||
// 36.211, Section 10.1.4.1.2, Table 10.1.4.1.2-2
|
||||
char ref6[84] = {1, 1, 1, 1, 3, -3, 1, 1, 3, 1, -3, 3, 1, -1, -1, -1, 1, -3, 1, -1, 3, -3, -1, -1, 1, 3, 1, -1, -1, 3, 1, -3, -3, 1, 3, 1, -1, -1, 1, -3, -3, -1,
|
||||
-1, -1, -1, 3, -3, -1, 3, -1, 1, -3, -3, 3, 3, -1, 3, -3, -1, 1, 3, -3, 3, -1, 3, 3, -3, 1, 3, 1, -3, -1, -3, 1, -3, 3, -3, -1, -3, 3, -3, 1, 1, -3};
|
||||
|
||||
// NB-IoT: 36.211, Section 10.1.4.1.1, Table 10.1.4.1.1-1
|
||||
int16_t w_n[256] = {
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
|
||||
1, 1,-1,-1, 1, 1,-1,-1, 1, 1,-1,-1, 1, 1,-1,-1,
|
||||
1,-1,-1, 1, 1,-1,-1, 1, 1,-1,-1, 1, 1,-1,-1, 1,
|
||||
1, 1, 1, 1,-1,-1,-1,-1, 1, 1, 1, 1,-1,-1,-1,-1,
|
||||
1,-1, 1,-1,-1, 1,-1, 1, 1,-1, 1,-1,-1, 1,-1, 1,
|
||||
1, 1,-1,-1,-1,-1, 1, 1, 1, 1,-1,-1,-1,-1, 1, 1,
|
||||
1,-1,-1, 1,-1, 1, 1,-1, 1,-1,-1, 1,-1, 1, 1,-1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,-1,-1,-1,-1,-1,-1,-1,-1,
|
||||
1,-1, 1,-1, 1,-1, 1,-1,-1, 1,-1, 1,-1, 1,-1, 1,
|
||||
1, 1,-1,-1, 1, 1,-1,-1,-1,-1, 1, 1,-1,-1, 1, 1,
|
||||
1,-1,-1, 1, 1,-1,-1, 1,-1, 1, 1,-1,-1, 1, 1,-1,
|
||||
1, 1, 1, 1,-1,-1,-1,-1,-1,-1,-1,-1, 1, 1, 1, 1,
|
||||
1,-1, 1,-1,-1, 1,-1, 1,-1, 1,-1, 1, 1,-1, 1,-1,
|
||||
1, 1,-1,-1,-1,-1, 1, 1,-1,-1, 1, 1, 1, 1,-1,-1,
|
||||
1,-1,-1, 1,-1, 1, 1,-1,-1, 1, 1,-1, 1,-1,-1, 1
|
||||
};
|
||||
|
||||
|
||||
|
||||
// void generate_ul_ref_sigs(void)
|
||||
// {
|
||||
// double qbar,phase;
|
||||
// unsigned int u,v,Msc_RS,q,m,n;
|
||||
|
||||
// // These are the Zadoff-Chu sequences (for RB 3-100)
|
||||
// for (Msc_RS=2; Msc_RS<33; Msc_RS++) {
|
||||
// for (u=0; u<30; u++) {
|
||||
// for (v=0; v<2; v++) {
|
||||
// qbar = ref_primes[Msc_RS] * (u+1)/(double)31;
|
||||
// ul_ref_sigs[u][v][Msc_RS] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[Msc_RS]);
|
||||
|
||||
// if ((((int)floor(2*qbar))&1) == 0)
|
||||
// q = (int)(floor(qbar+.5)) - v;
|
||||
// else
|
||||
// q = (int)(floor(qbar+.5)) + v;
|
||||
|
||||
// #ifdef MAIN
|
||||
// printf("Msc_RS %d (%d), u %d, v %d -> q %d (qbar %f)\n",Msc_RS,dftsizes[Msc_RS],u,v,q,qbar);
|
||||
// #endif
|
||||
|
||||
// for (n=0; n<dftsizes[Msc_RS]; n++) {
|
||||
// m=n%ref_primes[Msc_RS];
|
||||
// phase = (double)q*m*(m+1)/ref_primes[Msc_RS];
|
||||
// ul_ref_sigs[u][v][Msc_RS][n<<1] =(int16_t)(floor(32767*cos(M_PI*phase)));
|
||||
// ul_ref_sigs[u][v][Msc_RS][1+(n<<1)] =-(int16_t)(floor(32767*sin(M_PI*phase)));
|
||||
// #ifdef MAIN
|
||||
|
||||
// if (Msc_RS<5)
|
||||
// printf("(%d,%d) ",ul_ref_sigs[u][v][Msc_RS][n<<1],ul_ref_sigs[u][v][Msc_RS][1+(n<<1)]);
|
||||
|
||||
// #endif
|
||||
// }
|
||||
|
||||
// #ifdef MAIN
|
||||
|
||||
// if (Msc_RS<5)
|
||||
// printf("\n");
|
||||
|
||||
// #endif
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// // These are the sequences for RB 1
|
||||
// for (u=0; u<30; u++) {
|
||||
// ul_ref_sigs[u][0][0] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[0]);
|
||||
|
||||
// for (n=0; n<dftsizes[0]; n++) {
|
||||
// ul_ref_sigs[u][0][0][n<<1] =(int16_t)(floor(32767*cos(M_PI*ref12[(u*12) + n]/4)));
|
||||
// ul_ref_sigs[u][0][0][1+(n<<1)]=(int16_t)(floor(32767*sin(M_PI*ref12[(u*12) + n]/4)));
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// // These are the sequences for RB 2
|
||||
// for (u=0; u<30; u++) {
|
||||
// ul_ref_sigs[u][0][1] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[1]);
|
||||
|
||||
// for (n=0; n<dftsizes[1]; n++) {
|
||||
// ul_ref_sigs[u][0][1][n<<1] =(int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4)));
|
||||
// ul_ref_sigs[u][0][1][1+(n<<1)]=(int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4)));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/*void generate_ul_ref_sigs_rx_NB_IoT(void)
|
||||
{
|
||||
|
||||
unsigned int u,index_Nsc_RU,n; // Vincent: index_Nsc_RU 0,1,2,3 ---> number of sc 1,3,6,12
|
||||
uint8_t npusch_format = 1; // NB-IoT: format 1 (data), or 2: ack. Should be defined in higher layer
|
||||
int16_t a;
|
||||
int16_t qpsk[2];
|
||||
unsigned int x1, x2=35; // NB-IoT: defined in 36.211, Section 10.1.4.1.1
|
||||
int16_t ref_sigs_sc1[2*sequence_length[0]];
|
||||
uint32_t s;
|
||||
|
||||
a = (ONE_OVER_SQRT2_Q15_NB_IoT)>>15;
|
||||
qpsk[0] = a;
|
||||
qpsk[1] = -a;
|
||||
s = lte_gold_generic_NB_IoT(&x1, &x2, 1);
|
||||
|
||||
for (index_Nsc_RU=0; index_Nsc_RU<4; index_Nsc_RU++) {
|
||||
for (u=0; u<u_max[index_Nsc_RU]; u++) {
|
||||
// ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU] = (int16_t*)malloc16(2*sizeof(int16_t)*sequence_length[index_Nsc_RU]);
|
||||
switch (index_Nsc_RU){
|
||||
case 0: // 36.211, Section 10.1.4.1.1
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU] = (int16_t*)malloc(sizeof(int16_t)*(2*sequence_length[index_Nsc_RU]*12+24)); // *12 is mandatory to fit channel estimation functions
|
||||
// NB-IoT: for same reason, +24 is added in order to fit the possible subcarrier start shift when index_Nsc_RU = 0, 1, 2 --> see ul_sc_start in channel estimation function
|
||||
for (n=0; n<sequence_length[index_Nsc_RU]; n++) {
|
||||
if (n!=0 && n%32==0)
|
||||
{
|
||||
s = lte_gold_generic_NB_IoT(&x1, &x2, 0);
|
||||
}
|
||||
ref_sigs_sc1[n<<1] = qpsk[(s>>(n%32))&1]*w_n[16*u+n%16];
|
||||
// ref_sigs_sc1[1+(n<<1)] = qpsk[(s>>n)&1]*w_n[16*u+n%16];
|
||||
ref_sigs_sc1[1+(n<<1)] = ref_sigs_sc1[n<<1];
|
||||
|
||||
}
|
||||
if (npusch_format==1){
|
||||
for (n=0; n<sequence_length[index_Nsc_RU]; n++) {
|
||||
// ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][n<<1] = ref_sigs_sc1[n<<1];
|
||||
// ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][1+(n<<1)]= ref_sigs_sc1[1+(n<<1)];
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][12*(n<<1)+24] = ref_sigs_sc1[n<<1]; // ul_ref_sigs_rx_NB_IoT is filled every 12 RE, real part
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][1+12*(n<<1)+24]= ref_sigs_sc1[1+(n<<1)]; // ul_ref_sigs_rx_NB_IoT is filled every 12 RE, imaginary part
|
||||
}
|
||||
}
|
||||
if (npusch_format==2){// NB-IoT: to be implemented
|
||||
printf("Not coded yet\n");
|
||||
}
|
||||
break;
|
||||
case 1: // 36.211, Section 10.1.4.1.2
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU] = (int16_t*)malloc(sizeof(int16_t)*(2*12+24)); // *12 is mandatory to fit channel estimation functions
|
||||
for (n=0; n<sequence_length[index_Nsc_RU]; n++) {
|
||||
// ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][n<<1] = (int16_t)(floor(32767*cos(M_PI*ref3[(u*3) + n]/4 + alpha3[threetnecyclicshift])));
|
||||
// ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][1+(n<<1)]= (int16_t)(floor(32767*sin(M_PI*ref3[(u*3) + n]/4 + alpha3[threetnecyclicshift])));
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][(n<<1)+24] = (int16_t)(floor(32767*cos(M_PI*ref3[(u*3) + n]/4 )));
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][1+(n<<1)+24]= (int16_t)(floor(32767*sin(M_PI*ref3[(u*3) + n]/4 )));
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU] = (int16_t*)malloc(sizeof(int16_t)*(2*12+24)); // *12 is mandatory to fit channel estimation functions
|
||||
for (n=0; n<sequence_length[index_Nsc_RU]; n++) {
|
||||
// ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][n<<1] = (int16_t)(floor(32767*cos(M_PI*ref6[(u*6) + n]/4 + alpha6[sixtonecyclichift])));
|
||||
// ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][1+(n<<1)]= (int16_t)(floor(32767*sin(M_PI*ref6[(u*6) + n]/4 + alpha6[sixtonecyclichift])));
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][(n<<1)+24] = (int16_t)(floor(32767*cos(M_PI*ref6[(u*6) + n]/4 )));
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][1+(n<<1)+24]= (int16_t)(floor(32767*sin(M_PI*ref6[(u*6) + n]/4 )));
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU] = (int16_t*)malloc(sizeof(int16_t)*(2*12+24)); // *12 is mandatory to fit channel estimation functions
|
||||
for (n=0; n<sequence_length[index_Nsc_RU]; n++) {
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][n<<1] = (int16_t)(floor(32767*cos(M_PI*ref12_NB_IoT[(u*12) + n]/4)));
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][1+(n<<1)]= (int16_t)(floor(32767*sin(M_PI*ref12_NB_IoT[(u*12) + n]/4)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}*/
|
||||
|
||||
void generate_ul_ref_sigs_rx_NB_IoT(void)
|
||||
{
|
||||
|
||||
unsigned int u,index_Nsc_RU,n,m; // Vincent: index_Nsc_RU 0,1,2,3 ---> number of sc 1,3,6,12
|
||||
//uint8_t npusch_format = 1; // NB-IoT: format 1 (data), or 2: ack. Should be defined in higher layer
|
||||
int16_t a;
|
||||
int16_t qpsk[2];
|
||||
unsigned int x1, x2; // NB-IoT: defined in 36.211, Section 10.1.4.1.1
|
||||
int16_t ref_sigs_sc1[2*sequence_length[0]]; // this is for format 1
|
||||
//int16_t ref_sigs_sc1_f2[2*sequence_length[0]]; // this is for format 2
|
||||
uint32_t s;
|
||||
|
||||
a = ONE_OVER_SQRT2_Q15_NB_IoT;
|
||||
qpsk[0] = a;
|
||||
qpsk[1] = -a;
|
||||
|
||||
//printf("\n\n\n in generate_ul_ref_sigs_rx_NB_IoT %d \n\n\n",a);
|
||||
for (index_Nsc_RU=0; index_Nsc_RU<4; index_Nsc_RU++)
|
||||
{
|
||||
for (u=0; u<u_max[index_Nsc_RU]; u++)
|
||||
{
|
||||
// ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU] = (int16_t*)malloc16(2*sizeof(int16_t)*sequence_length[index_Nsc_RU]);
|
||||
switch (index_Nsc_RU)
|
||||
{
|
||||
case 0: // 36.211, Section 10.1.4.1.1
|
||||
x2=35;
|
||||
s = lte_gold_generic_NB_IoT(&x1, &x2, 1);
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU] = (int16_t*)malloc(sizeof(int16_t)*(2*sequence_length[index_Nsc_RU]*12+24)); // *12 is mandatory to fit channel estimation functions
|
||||
ul_ref_sigs_f2_rx_NB_IoT[u] = (int16_t*)malloc(sizeof(int16_t)*(2*12*12+24)); // first "*12" is mandatory to fit channel estimation functions; first "*12" is the length of pilot sequence for format 2
|
||||
// NB-IoT: for same reason, +24 is added in order to fit the possible subcarrier start shift when index_Nsc_RU = 0, 1, 2 --> see ul_sc_start in channel estimation function
|
||||
for (n=0; n<sequence_length[index_Nsc_RU]; n++)
|
||||
{
|
||||
if (n>0 && n%32==0)
|
||||
{
|
||||
s = lte_gold_generic_NB_IoT(&x1, &x2, 0);
|
||||
}
|
||||
ref_sigs_sc1[n<<1] = qpsk[(s>>(n%32))&1]*w_n[16*u+n%16];
|
||||
// ref_sigs_sc1[1+(n<<1)] = qpsk[(s>>n)&1]*w_n[16*u+n%16];
|
||||
ref_sigs_sc1[1+(n<<1)] = ref_sigs_sc1[n<<1];
|
||||
|
||||
}
|
||||
|
||||
for (n=0; n<sequence_length[index_Nsc_RU]; n++)
|
||||
{
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][12*(n<<1)+24] = ref_sigs_sc1[n<<1]; // ul_ref_sigs_rx_NB_IoT is filled every 12 RE, real part
|
||||
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU][1+12*(n<<1)+24]= ref_sigs_sc1[1+(n<<1)]; // ul_ref_sigs_rx_NB_IoT is filled every 12 RE, imaginary part
|
||||
}
|
||||
for (n=0; n<4; n++)
|
||||
{
|
||||
for (m=0; m<3; m++)
|
||||
{
|
||||
ul_ref_sigs_f2_rx_NB_IoT[u][12*((3*n+m)<<1)+24] = ref_sigs_sc1[n<<1]; // ul_ref_sigs_rx_NB_IoT is filled every 12 RE, real part
|
||||
ul_ref_sigs_f2_rx_NB_IoT[u][1+12*((3*n+m)<<1)+24] = ref_sigs_sc1[1+(n<<1)]; // ul_ref_sigs_rx_NB_IoT is filled every 12 RE, imaginary part
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void free_ul_ref_sigs_NB_IoT(void)
|
||||
{
|
||||
|
||||
unsigned int u,index_Nsc_RU;
|
||||
|
||||
for (index_Nsc_RU=0; index_Nsc_RU<4; index_Nsc_RU++) {
|
||||
for (u=0; u<30; u++) {
|
||||
if (ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU])
|
||||
free16(ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU],4*sizeof(int16_t)*sequence_length[index_Nsc_RU]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// void free_ul_ref_sigs(void)
|
||||
// {
|
||||
|
||||
// unsigned int u,index_Nsc_RU;
|
||||
|
||||
// for (index_Nsc_RU=0; index_Nsc_RU<4; index_Nsc_RU++) {
|
||||
// for (u=0; u<30; u++) {
|
||||
// if (ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU])
|
||||
// free16(ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU],4*sizeof(int16_t)*sequence_length[index_Nsc_RU]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
#ifdef MAIN
|
||||
main()
|
||||
{
|
||||
|
||||
//generate_ul_ref_sigs();
|
||||
generate_ul_ref_sigs_rx();
|
||||
free_ul_ref_sigs();
|
||||
}
|
||||
#endif
|
||||
166
openair1/PHY/LTE_REFSIG/main_synchro_NPSS_NB_IoT.m
Normal file
166
openair1/PHY/LTE_REFSIG/main_synchro_NPSS_NB_IoT.m
Normal file
@@ -0,0 +1,166 @@
|
||||
clear all
|
||||
close all
|
||||
|
||||
% description: test synchro using CP for time-freq. synchro
|
||||
% and ZC sequence for beginning of the radio frame estimation
|
||||
% date : 09/03/2017
|
||||
% author : Vincent Savaux, b<>com, Rennes, France
|
||||
% email: vincent.savaux@b-com.com
|
||||
|
||||
% Parameters
|
||||
|
||||
u = 5; % root of ZC sequence
|
||||
size_RB = 12; % number of sub-carrier per RB
|
||||
N_ZC = size_RB-1;
|
||||
L_sub_frame = 14;
|
||||
j = 1i;
|
||||
CFO = 0.1; % normalized CFO
|
||||
N_frames = 4; % at least 3
|
||||
N_sub_frame = 10*N_frames; % how many simulated sub_frame you want
|
||||
FFT_size = 128;
|
||||
N_zeros = (FFT_size-size_RB)/2; % Number of zero subcarriers in upper and lower frequencies
|
||||
L_CP = round(4.6875/(66.7)*FFT_size); % Number of samples of the CP
|
||||
L_symbol = (FFT_size + L_CP);
|
||||
L_frame = (FFT_size + L_CP)*L_sub_frame*10;
|
||||
L_signal = (FFT_size + L_CP)*L_sub_frame*N_sub_frame;
|
||||
normalized_time = 0 : 1 : L_signal-1;
|
||||
SNR_start = 0; % in dB
|
||||
SNR_end = 30; % in dB
|
||||
N_subframe_observation = 10; % length of observation for syncronization
|
||||
N_loop = 1000; % number of runs, for good statistics
|
||||
type_first_estim = 2; % 1 -> estimation by mean, 2-> estimation by majority
|
||||
|
||||
matrix_error_theta_1 = zeros(N_loop,SNR_end-SNR_start+1);
|
||||
matrix_error_theta_2 = zeros(N_loop,SNR_end-SNR_start+1);
|
||||
matrix_error_angle_1 = zeros(N_loop,SNR_end-SNR_start+1);
|
||||
matrix_error_angle_2 = zeros(N_loop,SNR_end-SNR_start+1);
|
||||
matrix_error_angle_3 = zeros(N_loop,SNR_end-SNR_start+1);
|
||||
matrix_error_BOF = zeros(N_loop,SNR_end-SNR_start+1);
|
||||
|
||||
for SNR = SNR_start : 2 : SNR_end
|
||||
for loop = 1 : N_loop
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Creation of the signal
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
% ZC sequence in frequency domain
|
||||
|
||||
vec_n = 0:N_ZC-1;
|
||||
f_ZC_sequence = exp(-j*pi*u*vec_n.*(vec_n+1)/N_ZC);
|
||||
f_NPSS_symbol = [f_ZC_sequence.';0]; % one NPSS symbol
|
||||
f_NPSS_frame = [zeros(size_RB,3),kron(ones(1,L_sub_frame-3),f_NPSS_symbol)];
|
||||
|
||||
% OFDM sub_frame in frequency domain -> modulation : QPSK
|
||||
%random QPSK elements:
|
||||
f_OFDM_frames = (2*randi([0,1],size_RB,L_sub_frame*N_sub_frame)-1) + j*(2*randi([0,1],size_RB,L_sub_frame*N_sub_frame)-1);
|
||||
|
||||
%replace the k*6th subframes by f_NPSS_frame:
|
||||
f_LTE_frames = f_OFDM_frames;
|
||||
for k = 0 : N_frames-1
|
||||
|
||||
N_index = k*10*L_sub_frame + 85;
|
||||
f_LTE_frames(:,N_index:N_index+13) = f_NPSS_frame;
|
||||
|
||||
end
|
||||
|
||||
% IFFT: get frames in time domain (Parralel representation)
|
||||
|
||||
f_zero_carriers = zeros(N_zeros,L_sub_frame*N_sub_frame);
|
||||
f_ups_LTE_frames = [f_zero_carriers;f_LTE_frames;f_zero_carriers]; % add zero carriers up and down the symbols
|
||||
t_P_LTE_frames = ifft(f_ups_LTE_frames,FFT_size);
|
||||
|
||||
% Add CP (Parralel representation)
|
||||
|
||||
t_P_LTE_frames_CP = [t_P_LTE_frames(end-L_CP+1:end,:);t_P_LTE_frames];
|
||||
|
||||
% Parralel to series conversion
|
||||
|
||||
t_S_LTE_frames = reshape(t_P_LTE_frames_CP,1,[]);
|
||||
|
||||
% Add a channel frequency offset (CFO)
|
||||
|
||||
t_S_received_frames = t_S_LTE_frames.*exp(j*2*pi*CFO*normalized_time/FFT_size);
|
||||
|
||||
% Add noise
|
||||
|
||||
P_signal = sum(abs(t_S_received_frames).^2)/length(t_S_received_frames);
|
||||
P_noise = P_signal*10^(-SNR/20);
|
||||
|
||||
init_noise = randn(size(t_S_received_frames));
|
||||
normalized_noise = init_noise/sqrt(sum(abs(init_noise).^2)/length(init_noise));
|
||||
noise = sqrt(P_noise)*normalized_noise;
|
||||
|
||||
t_S_noisy_frames = t_S_received_frames + noise;
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Time and frequency synchronization
|
||||
% The principle is based on the croos-correlation between the received
|
||||
% sequence and the transmitted SC sequence.
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
% Get an observation, the duration of which is one frame length. The
|
||||
% beginning of the stored samples is at 1 frame +- 0.5 frame
|
||||
|
||||
index_start = L_frame + randi([-L_frame/2,L_frame/2],1);
|
||||
observation = t_S_noisy_frames(index_start:index_start+1.5*L_frame-1);
|
||||
f_oversampl_NPSS_symbol = [f_zero_carriers(:,1);f_NPSS_symbol;f_zero_carriers(:,1)];
|
||||
t_NPPS_unit = ifft(f_oversampl_NPSS_symbol,FFT_size);
|
||||
t_NPPS_correl = [t_NPPS_unit(end-L_CP+1:end);t_NPPS_unit];
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Estimation of start of the symbols and the CFO
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
[ theta_estim, estim_CFO ] = first_synchro( observation, L_frame, L_sub_frame, FFT_size, L_symbol, N_subframe_observation, L_CP, SNR, type_first_estim );
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Time and frequency synchronization
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
new_index_start = index_start + theta_estim - 1;
|
||||
new_vec_time = new_index_start-1 : 1 : new_index_start+1.5*L_frame-2;
|
||||
new_observation = t_S_noisy_frames(new_index_start:new_index_start+1.5*L_frame-1).*exp(-j*2*pi*estim_CFO*new_vec_time/FFT_size);
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Second synchronization: beginning of frame (BOF)
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
[ BOF ] = second_synchro( new_observation, f_NPSS_symbol , L_frame, L_symbol, FFT_size, L_CP, N_zeros );
|
||||
|
||||
|
||||
exact_index = L_symbol - rem(index_start,L_symbol) + 2;
|
||||
[error_theta_1,ind_error1] = min([abs(exact_index - theta_estim-L_symbol), abs(exact_index - theta_estim),abs(exact_index - theta_estim+L_symbol)]);
|
||||
% [error_theta_2,ind_error2] = min([abs(exact_index - theta_estim_2-137), abs(exact_index - theta_estim_2),abs(exact_index - theta_estim_2+137)]);
|
||||
|
||||
error_CFO_1 = CFO - estim_CFO;
|
||||
% error_CFO_2 = CFO - estim_CFO_1;
|
||||
% error_CFO_3 = CFO - estim_CFO_2;
|
||||
|
||||
vec_exact_index = 85 : 140 : N_frames*140;
|
||||
estim_BOF = ceil((index_start-1)/L_symbol) + BOF ;
|
||||
error_BOF = min(abs(estim_BOF-vec_exact_index));
|
||||
|
||||
matrix_error_theta_1(loop,SNR-SNR_start+1) = error_theta_1;
|
||||
% matrix_error_theta_2(loop,SNR-SNR_start+1) = error_theta_2;
|
||||
matrix_error_angle_1(loop,SNR-SNR_start+1) = error_CFO_1;
|
||||
% matrix_error_angle_2(loop,SNR-SNR_start+1) = error_CFO_2;
|
||||
% matrix_error_angle_3(loop,SNR-SNR_start+1) = error_CFO_3;
|
||||
matrix_error_BOF(loop,SNR-SNR_start+1) = error_BOF;
|
||||
|
||||
end
|
||||
end
|
||||
plot(SNR_start:2:SNR_end,sqrt(sum(abs(matrix_error_theta_1(:,1:2:SNR_end+1)).^2)/N_loop))
|
||||
hold
|
||||
% plot(SNR_start:2:SNR_end,sqrt(sum(abs(matrix_error_theta_2(:,1:2:SNR_end+1)).^2)/N_loop))
|
||||
figure
|
||||
plot(SNR_start:2:SNR_end,sqrt(sum(abs(matrix_error_angle_1(:,1:2:SNR_end+1)).^2)/N_loop))
|
||||
hold
|
||||
% plot(SNR_start:SNR_end,sum(abs(matrix_error_angle_2(:,1:31)))/N_loop)
|
||||
% plot(SNR_start:SNR_end,sum(abs(matrix_error_angle_3(:,1:31)))/N_loop)
|
||||
% plot(SNR_start:2:SNR_end,sqrt(sum(abs(matrix_error_angle_2(:,1:2:SNR_end+1)).^2)/N_loop),'s')
|
||||
% plot(SNR_start:2:SNR_end,sqrt(sum(abs(matrix_error_angle_3(:,1:2:SNR_end+1)).^2)/N_loop),'d')
|
||||
figure
|
||||
plot(SNR_start:2:SNR_end,sqrt(sum(abs(matrix_error_BOF(:,1:2:SNR_end+1)).^2)/N_loop))
|
||||
hold
|
||||
save
|
||||
|
||||
18
openair1/PHY/LTE_REFSIG/primary_synch_NB_IoT.h
Normal file
18
openair1/PHY/LTE_REFSIG/primary_synch_NB_IoT.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/***********************************************************************
|
||||
|
||||
**********************************************************************/
|
||||
/*! \file PHY/LTE_REFSIG/primary_synch_NB_IoT.c
|
||||
* \Narrowband Primary Synchronisation Signal(NPSS) for NB-IoT, TS 36-212, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
// 12x11= 132 RE ( x 2= 264 since Re,Img).
|
||||
// For the In-band case: the RE dedicated to LTE pilots are supposed to overwrite 16 REs of the NPSS signal.
|
||||
|
||||
short primary_synch_NB_IoT[264] = {32767,0,-31440,-9232,-21458,-24764,-4664,32433,-31440,9231,13611,29805,-31440,9231,-4664,32433,-21458,-24764,-31440,-9232,32767,-1,0,0,32767,0,-31440,-9232,-21458,-24764,-4664,32433,-31440,9231,13611,29805,-31440,9231,-4664,32433,-21458,-24764,-31440,-9232,32767,-1,0,0,32767,0,-31440,-9232,-21458,-24764,-4664,32433,-31440,9231,13611,29805,-31440,9231,-4664,32433,-21458,-24764,-31440,-9232,32767,-1,0,0,32767,0,-31440,-9232,-21458,-24764,-4664,32433,-31440,9231,13611,29805,-31440,9231,-4664,32433,-21458,-24764,-31440,-9232,32767,-1,0,0,-32767,0,31439,9231,21457,24763,4663,-32434,31439,-9232,-13612,-29806,31439,-9232,4663,-32434,21457,24763,31439,9231,-32767,0,0,0,-32767,0,31439,9231,21457,24763,4663,-32434,31439,-9232,-13612,-29806,31439,-9232,4663,-32434,21457,24763,31439,9231,-32767,0,0,0,32767,0,-31440,-9232,-21458,-24764,-4664,32433,-31440,9231,13611,29805,-31440,9231,-4664,32433,-21458,-24764,-31440,-9232,32767,-1,0,0,32767,0,-31440,-9232,-21458,-24764,-4664,32433,-31440,9231,13611,29805,-31440,9231,-4664,32433,-21458,-24764,-31440,-9232,32767,-1,0,0,32767,0,-31440,-9232,-21458,-24764,-4664,32433,-31440,9231,13611,29805,-31440,9231,-4664,32433,-21458,-24764,-31440,-9232,32767,-1,0,0,-32767,0,31439,9231,21457,24763,4663,-32434,31439,-9232,-13612,-29806,31439,-9232,4663,-32434,21457,24763,31439,9231,-32767,0,0,0,32767,0,-31440,-9232,-21458,-24764,-4664,32433,-31440,9231,13611,29805,-31440,9231,-4664,32433,-21458,-24764,-31440,-9232,32767,-1,0,0};
|
||||
20
openair1/PHY/LTE_REFSIG/second_synchro_NB_IoT.m
Normal file
20
openair1/PHY/LTE_REFSIG/second_synchro_NB_IoT.m
Normal file
@@ -0,0 +1,20 @@
|
||||
function [ BOF ] = Fc_second_synchro( new_observation, f_NPSS_symbol , L_frame, L_symbol, FFT_size, L_CP , N_zeros )
|
||||
%UNTITLED2 Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
% new_obs_reshape = reshape(new_observation(1:L_frame), L_symbol, []);
|
||||
new_obs_reshape = reshape(new_observation, L_symbol, []);
|
||||
t_new_obs_CP_remov = new_obs_reshape(L_CP+1:end,:);
|
||||
f_new_symbols = fft(t_new_obs_CP_remov,FFT_size);
|
||||
|
||||
for n = 1 : length(f_new_symbols(1,:))
|
||||
corr(:,n) = xcorr(f_new_symbols(N_zeros+1:N_zeros+12,n),f_NPSS_symbol);
|
||||
mean = sum(abs(corr(:,n)));
|
||||
mm(n) = sum((abs(corr(:,n))-mean).^2);
|
||||
end
|
||||
|
||||
for k = 1 : length(mm) - 13
|
||||
min_var(k) = sum(mm(k:k+13));
|
||||
end
|
||||
[~,BOF] = min(min_var);
|
||||
end
|
||||
|
||||
482
openair1/PHY/LTE_TRANSPORT/SIB_NB_IoT.c
Normal file
482
openair1/PHY/LTE_TRANSPORT/SIB_NB_IoT.c
Normal file
@@ -0,0 +1,482 @@
|
||||
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/SIB_NB_IoT.c
|
||||
* \Fucntions for the generation of SIB information for NB_IoT, TS 36-212, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2018
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
|
||||
#include "PHY/LTE_TRANSPORT/proto_NB_IoT.h"
|
||||
//#include "PHY/CODING/defs_NB_IoT.h"
|
||||
//#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
|
||||
//#include "PHY/impl_defs_lte_NB_IoT.h"
|
||||
//#include "PHY/impl_defs_top_NB_IoT.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int generate_SIB1(NB_IoT_eNB_NDLSCH_t *sib1_struct,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int RB_IoT_ID,
|
||||
uint8_t operation_mode,
|
||||
uint8_t release_v13_5_0)
|
||||
{
|
||||
int done=0;
|
||||
uint8_t *sib1_pdu = sib1_struct->harq_process->pdu;
|
||||
uint8_t opr_mode = 3;
|
||||
if(operation_mode>=2)
|
||||
{
|
||||
opr_mode =0;
|
||||
}
|
||||
uint8_t tmp =0;
|
||||
uint8_t rep_val = 0;
|
||||
uint8_t start_frame = get_start_frame_SIB1_NB_IoT(frame_parms, get_rep_num_SIB1_NB_IoT(sib1_struct->repetition_number_SIB1));
|
||||
|
||||
switch( get_rep_num_SIB1_NB_IoT(sib1_struct->repetition_number_SIB1) )
|
||||
{
|
||||
case 4:
|
||||
rep_val = 64;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
rep_val = 32;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
rep_val = 16;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Error in SIB1");
|
||||
|
||||
}
|
||||
|
||||
uint8_t var = 0;
|
||||
|
||||
if(start_frame == 1)
|
||||
{
|
||||
var =1;
|
||||
}
|
||||
|
||||
if(start_frame>=16)
|
||||
{
|
||||
tmp = 1;
|
||||
}
|
||||
|
||||
uint8_t born_inf = 0 + start_frame*tmp;
|
||||
uint8_t born_sup = 16 + start_frame*tmp;
|
||||
|
||||
if((subframe == 4) && (frame%2 == var) && (born_inf<= frame % rep_val) && (frame % rep_val < born_sup ))
|
||||
{
|
||||
LOG_D(PHY,"[%3d][%2d] Generating SIB1\n",frame,subframe);
|
||||
int G = get_G_SIB1_NB_IoT(frame_parms,operation_mode);
|
||||
|
||||
if( frame % rep_val == var )
|
||||
{
|
||||
dlsch_encoding_NB_IoT(sib1_pdu,
|
||||
sib1_struct,
|
||||
8, ///// number_of_subframes_required
|
||||
G); //// this vallue is fixed, should take into account in future the case of stand-alone & guard-band
|
||||
|
||||
dlsch_scrambling_Gen_NB_IoT(frame_parms,
|
||||
sib1_struct,
|
||||
8*G,
|
||||
frame,
|
||||
subframe*2,
|
||||
sib1_struct->rnti,
|
||||
release_v13_5_0,
|
||||
1);
|
||||
}
|
||||
|
||||
dlsch_modulation_NB_IoT(txdataF,
|
||||
amp,
|
||||
frame_parms,
|
||||
opr_mode, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
|
||||
sib1_struct,
|
||||
G, // number of bits per subframe
|
||||
((frame%16)/2),
|
||||
4,
|
||||
RB_IoT_ID);
|
||||
done =1;
|
||||
frame_parms->flag_free_sf =1;
|
||||
|
||||
}
|
||||
|
||||
return(done);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int generate_SIB23(NB_IoT_eNB_NDLSCH_t *SIB23,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int RB_IoT_ID,
|
||||
uint8_t release_v13_5_0)
|
||||
{
|
||||
int done=0;
|
||||
|
||||
if( SIB23->active == 1 )
|
||||
{
|
||||
//LOG_I(PHY,"[Frame: %d][Subframe: %d]sent SIB23\n",frame,subframe);
|
||||
|
||||
uint8_t *SIB23_pdu = SIB23->harq_process->pdu;
|
||||
uint32_t rep = SIB23->resource_assignment;
|
||||
uint8_t eutra_control_region = 3;
|
||||
|
||||
uint32_t counter_rep = SIB23->counter_repetition_number;
|
||||
uint32_t pointer_to_sf = SIB23->pointer_to_subframe; /// to identify wich encoded subframe to transmit
|
||||
|
||||
int G = get_G_NB_IoT(frame_parms);
|
||||
uint8_t Nsf = SIB23->resource_assignment; //value 2 or 8
|
||||
|
||||
if(counter_rep == rep)
|
||||
{
|
||||
dlsch_encoding_NB_IoT(SIB23_pdu,
|
||||
SIB23,
|
||||
Nsf, ///// number_of_subframes_required
|
||||
G); //// this vallue is fixed, should take into account in future the case of stand-alone & guard-band
|
||||
|
||||
dlsch_scrambling_Gen_NB_IoT(frame_parms,
|
||||
SIB23,
|
||||
Nsf*G,
|
||||
frame,
|
||||
subframe*2,
|
||||
SIB23->rnti,
|
||||
release_v13_5_0,
|
||||
1);
|
||||
}
|
||||
|
||||
dlsch_modulation_NB_IoT(txdataF,
|
||||
amp,
|
||||
frame_parms,
|
||||
eutra_control_region, //should be replace by start_symbole // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
|
||||
SIB23,
|
||||
G, // number of bits per subframe
|
||||
pointer_to_sf,
|
||||
subframe,
|
||||
RB_IoT_ID);
|
||||
|
||||
SIB23->counter_repetition_number--;
|
||||
SIB23->pointer_to_subframe++;
|
||||
|
||||
frame_parms->flag_free_sf =1;
|
||||
|
||||
if(SIB23->counter_repetition_number == 0)
|
||||
{
|
||||
SIB23->active = 0;
|
||||
|
||||
}
|
||||
done =1;
|
||||
}
|
||||
|
||||
return(done);
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
int generate_NDLSCH_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
NB_IoT_eNB_NDLSCH_t *RAR,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int RB_IoT_ID,
|
||||
uint8_t release_v13_5_0)
|
||||
{
|
||||
|
||||
int done = 0;
|
||||
|
||||
if( RAR->active == 1 )
|
||||
{
|
||||
uint8_t *RAR_pdu = RAR->harq_process->pdu;
|
||||
|
||||
if(RAR->active_msg2 == 1 && RAR_pdu!=NULL)
|
||||
{
|
||||
uint8_t one_byte = RAR_pdu[2]>>3;
|
||||
uint8_t subcarrier_spacing = one_byte & 0x01;
|
||||
eNB->ulsch_NB_IoT[0]->harq_process->subcarrier_spacing = subcarrier_spacing;
|
||||
}
|
||||
// make different between RAR data and NPDSCH data // add a flag in NPDSCH to switch between RA and normal data transmission
|
||||
uint32_t rep = RAR->repetition_number;
|
||||
uint8_t eutra_control_region = 3;
|
||||
|
||||
uint32_t counter_rep = RAR->counter_repetition_number;
|
||||
uint32_t counter_sf_rep = RAR->counter_current_sf_repetition; /// for identifiying when to trigger new scrambling
|
||||
uint32_t pointer_to_sf = RAR->pointer_to_subframe; /// to identify wich encoded subframe to transmit
|
||||
|
||||
int G = get_G_NB_IoT(frame_parms);
|
||||
uint8_t Nsf = RAR->number_of_subframes_for_resource_assignment;
|
||||
|
||||
//LOG_I(PHY,"[Frame: %d][Subframe: %d]sent RAR, rep : %d, counter_rep:%d, Num_res:%d\n",frame,subframe,rep,counter_rep,Nsf);
|
||||
|
||||
if( (counter_rep == rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0) )
|
||||
{
|
||||
|
||||
dlsch_encoding_NB_IoT(RAR_pdu,
|
||||
RAR,
|
||||
Nsf, ///// number_of_subframes_required
|
||||
G); //// this vallue is fixed, should take into account in future the case of stand-alone & guard-band
|
||||
|
||||
dlsch_scrambling_Gen_NB_IoT(frame_parms,
|
||||
RAR,
|
||||
Nsf*G,
|
||||
frame,
|
||||
subframe*2,
|
||||
RAR->rnti,
|
||||
release_v13_5_0,
|
||||
0);
|
||||
}
|
||||
|
||||
if( (counter_rep != rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0) )
|
||||
{
|
||||
|
||||
dlsch_scrambling_Gen_NB_IoT(frame_parms,
|
||||
RAR,
|
||||
Nsf*G,
|
||||
frame,
|
||||
subframe*2,
|
||||
RAR->rnti,
|
||||
release_v13_5_0,
|
||||
0);
|
||||
}
|
||||
|
||||
if( rep > 4)
|
||||
{
|
||||
|
||||
RAR->counter_current_sf_repetition++;
|
||||
|
||||
dlsch_modulation_NB_IoT(txdataF,
|
||||
amp,
|
||||
frame_parms,
|
||||
eutra_control_region, //should be replace by start_symbole // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
|
||||
RAR,
|
||||
G, // number of bits per subframe
|
||||
pointer_to_sf,
|
||||
subframe,
|
||||
RB_IoT_ID);
|
||||
|
||||
if(RAR->counter_current_sf_repetition == 4)
|
||||
{
|
||||
RAR->pointer_to_subframe++;
|
||||
RAR->counter_current_sf_repetition =0;
|
||||
|
||||
if (Nsf == RAR->pointer_to_subframe && (RAR->counter_repetition_number > 4))
|
||||
{
|
||||
RAR->counter_repetition_number = RAR->counter_repetition_number-4;
|
||||
RAR->pointer_to_subframe =0;
|
||||
RAR->counter_current_sf_repetition =0;
|
||||
|
||||
} else {
|
||||
|
||||
RAR->active = 0;
|
||||
RAR->active_msg2 = 0;
|
||||
done =1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
RAR->counter_current_sf_repetition++;
|
||||
|
||||
dlsch_modulation_NB_IoT(txdataF,
|
||||
amp,
|
||||
frame_parms,
|
||||
eutra_control_region, //should be replace by start_symbole // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
|
||||
RAR,
|
||||
G, // number of bits per subframe
|
||||
pointer_to_sf,
|
||||
subframe,
|
||||
RB_IoT_ID);
|
||||
|
||||
if(RAR->counter_current_sf_repetition == rep)
|
||||
{
|
||||
RAR->pointer_to_subframe++;
|
||||
RAR->counter_current_sf_repetition =0;
|
||||
|
||||
if (Nsf == RAR->pointer_to_subframe)
|
||||
{
|
||||
|
||||
RAR->active = 0;
|
||||
RAR->active_msg2 = 0;
|
||||
done =1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return(done);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int generate_NPDCCH_NB_IoT(NB_IoT_eNB_NPDCCH_t *DCI,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int RB_IoT_ID)
|
||||
{
|
||||
int done=0;
|
||||
|
||||
|
||||
for(int i=0; i<2; i++)
|
||||
{
|
||||
uint8_t ncce_index = 0; /// = DCI->ncce_index[i];
|
||||
uint8_t agr_level = 2; /// = DCI->aggregation_level[i];
|
||||
|
||||
if( DCI->active[i] == 1)
|
||||
{
|
||||
//LOG_I(PHY,"[Frame: %d][Subframe: %d]sent DCI\n",frame,subframe);
|
||||
uint8_t *DCI_pdu = DCI->pdu[i];
|
||||
uint32_t rep = DCI->dci_repetitions[i]; /// repetition number
|
||||
uint8_t eutra_control_region = 3;
|
||||
uint8_t num_bits_of_DCI =DCI->A[i]; //DCI->dci_bits_length; /// value to be passed through nfapi when filling the PHY structures
|
||||
uint32_t counter_rep = DCI->counter_repetition_number[i]; ////// Buffer for repetitions
|
||||
|
||||
int G = get_G_NB_IoT(frame_parms);
|
||||
//////////// uint8_t Nsf = DCI->number_of_subframes_for_resource_assignment;
|
||||
|
||||
if( counter_rep == rep)
|
||||
{
|
||||
|
||||
dci_encoding_NB_IoT(DCI_pdu, // Array of two DCI pdus, even if one DCI is to transmit , the number of DCI is indicated in dci_number
|
||||
DCI, ////uint8_t *e[2], // *e should be e[2][G]
|
||||
num_bits_of_DCI, //////A = number of bits of the DCI
|
||||
G,
|
||||
ncce_index,
|
||||
agr_level);
|
||||
|
||||
npdcch_scrambling_NB_IoT(frame_parms,
|
||||
DCI, // Input data
|
||||
G, // Total number of bits to transmit in one subframe(case of DCI = G)
|
||||
subframe*2, //XXX we pass the subframe // Slot number (0..19)
|
||||
ncce_index,
|
||||
agr_level);
|
||||
}
|
||||
|
||||
if( ((counter_rep %4)== 0) && (counter_rep != rep) )
|
||||
{
|
||||
npdcch_scrambling_NB_IoT(frame_parms,
|
||||
DCI, // Input data
|
||||
G, // Total number of bits to transmit in one subframe(case of DCI = G)
|
||||
subframe*2, //XXX we pass the subframe // Slot number (0..19)
|
||||
ncce_index,
|
||||
agr_level);
|
||||
}
|
||||
|
||||
dci_modulation_NB_IoT(txdataF,
|
||||
amp,
|
||||
frame_parms,
|
||||
eutra_control_region, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
|
||||
DCI,
|
||||
0, // npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
|
||||
agr_level,
|
||||
ncce_index,
|
||||
subframe,
|
||||
RB_IoT_ID);
|
||||
|
||||
DCI->counter_repetition_number[i]--;
|
||||
|
||||
if(DCI->counter_repetition_number[i] == 0)
|
||||
{
|
||||
//printf("DCI REP done\n");
|
||||
DCI->active[i] = 0;
|
||||
done =1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return(done);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////// backup ///////////////////////////
|
||||
//////////////////////////////////////////////////// SIB23 ////////////////////////////////////////////////////////////////////////
|
||||
/* if( (subframe >0) && (subframe !=5) && (With_NSSS == 0) && (frame%2==1) && (frame%64<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
|
||||
{
|
||||
|
||||
|
||||
if( subframe == 1 )
|
||||
{
|
||||
dlsch_encoding_NB_IoT(sib23_pdu,
|
||||
sib23,
|
||||
8, ///// number_of_subframes_required
|
||||
236); //////////// G*2
|
||||
|
||||
dlsch_scrambling_Gen_NB_IoT(fp, // is called only in subframe 4
|
||||
sib23,
|
||||
1888, ////// total_bits
|
||||
frame,
|
||||
subframe*2,
|
||||
eNB->ndlsch_SIB23->rnti);
|
||||
}
|
||||
|
||||
if( subframe < 5 )
|
||||
{
|
||||
|
||||
dlsch_modulation_NB_IoT(txdataF,
|
||||
AMP,
|
||||
fp,
|
||||
3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
|
||||
sib23,
|
||||
236, // number of bits per subframe
|
||||
(subframe-1), ///npdsch_data_subframe, data per subframe//subframe index of the data table of npdsch channel (G*Nsf) ((frame%32)/2),values are between 0..Nsf
|
||||
subframe,
|
||||
RB_IoT_ID);
|
||||
} else {
|
||||
|
||||
dlsch_modulation_NB_IoT(txdataF,
|
||||
AMP,
|
||||
fp,
|
||||
3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
|
||||
sib23,
|
||||
236, // number of bits per subframe
|
||||
(subframe-2),///npdsch_data_subframe, data per subframe//subframe index of the data table of npdsch channel (G*Nsf) ((frame%32)/2),values are between 0..Nsf
|
||||
subframe,
|
||||
RB_IoT_ID);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -2120,6 +2120,8 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
|
||||
// generate DCIs in order of decreasing aggregation level, then common/ue spec
|
||||
// MAC is assumed to have ordered the UE spec DCI according to the RNTI-based randomization
|
||||
for (L=3; L>=0; L--) {
|
||||
|
||||
//first common DCI
|
||||
for (i=0; i<num_common_dci; i++) {
|
||||
|
||||
if (dci_alloc[i].L == (uint8_t)L) {
|
||||
@@ -2140,6 +2142,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
|
||||
}
|
||||
}
|
||||
|
||||
//start the second loop from the end of the previous one for ue specific DCI
|
||||
for (; i<num_ue_spec_dci + num_common_dci; i++) {
|
||||
|
||||
if (dci_alloc[i].L == (uint8_t)L) {
|
||||
@@ -2157,9 +2160,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
|
||||
dci_alloc[i].L,
|
||||
dci_alloc[i].rnti);
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2368,7 +2371,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
|
||||
|
||||
return(num_pdcch_symbols);
|
||||
}
|
||||
|
||||
#ifdef PHY_ABSTRACTION
|
||||
uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t num_ue_spec_dci,
|
||||
|
||||
355
openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.c
Executable file
355
openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.c
Executable file
@@ -0,0 +1,355 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/dci_NB_IoT.c
|
||||
* \brief Implements PDCCH physical channel TX/RX procedures (36.211) and DCI encoding/decoding (36.212/36.213). Current LTE compliance V8.6 2009-03.
|
||||
* \author R. Knopp
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom, B-COM
|
||||
* \email: knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifdef USER_MODE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "PHY/defs_NB_IoT.h" // /LTE_TRANSPORT/defs_NB_IoT.h
|
||||
|
||||
|
||||
//static uint8_t d[2][3*(MAX_DCI_SIZE_BITS_NB_IoT + 16) + 96];
|
||||
//static uint8_t w[2][3*3*(MAX_DCI_SIZE_BITS_NB_IoT+16)];
|
||||
|
||||
void dci_encoding_NB_IoT(uint8_t *a, // Array of two DCI pdus, even if one DCI is to transmit , the number of DCI is indicated in dci_number
|
||||
NB_IoT_eNB_NPDCCH_t *dlcch, ////uint8_t *e[2], // *e should be e[2][G]
|
||||
uint8_t A,
|
||||
uint16_t G,
|
||||
uint8_t ncce_index,
|
||||
uint8_t agr_level) // Aggregation level
|
||||
{
|
||||
uint8_t D = (A + 16);
|
||||
uint32_t RCC;
|
||||
uint8_t occupation_size=1;
|
||||
|
||||
if(agr_level == 2 && ncce_index == 0)
|
||||
{
|
||||
occupation_size=1;
|
||||
}else{
|
||||
occupation_size=2;
|
||||
}
|
||||
memset((void *)dlcch->npdcch_d[ncce_index],LTE_NULL_NB_IoT,96);
|
||||
|
||||
ccode_encode_NB_IoT(A,2,a,dlcch->npdcch_d[ncce_index]+96,dlcch->rnti[ncce_index]); // CRC attachement & Tail-biting convolutional coding
|
||||
RCC = sub_block_interleaving_cc_NB_IoT(D,dlcch->npdcch_d[ncce_index]+96,dlcch->npdcch_w[ncce_index]); // Interleaving
|
||||
lte_rate_matching_cc_NB_IoT(RCC,(G/occupation_size),dlcch->npdcch_w[ncce_index],dlcch->npdcch_e[ncce_index]); // Rate Matching
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///The scrambling sequence shall be initialised at the start of the search space and after every 4th NPDCCH subframes.
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void npdcch_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
NB_IoT_eNB_NPDCCH_t *dlcch, // Input data
|
||||
int G, // Total number of bits to transmit in one subframe(case of DCI = G)
|
||||
uint8_t Ns, //XXX we pass the subframe // Slot number (0..19)
|
||||
uint8_t ncce_index,
|
||||
uint8_t agr_level) // Aggregation level
|
||||
{
|
||||
int i;
|
||||
uint32_t x1, x2, s=0;
|
||||
uint8_t reset;
|
||||
uint8_t occupation_size=1;
|
||||
|
||||
reset = 1;
|
||||
|
||||
if(agr_level == 2 && ncce_index == 0)
|
||||
{
|
||||
occupation_size=1;
|
||||
}else{
|
||||
occupation_size=2;
|
||||
}
|
||||
|
||||
x2 = ((Ns>>1)<<9) + frame_parms->Nid_cell; // This is c_init in 36.211 Sec 10.2.3.1
|
||||
|
||||
for (i=0; i<G/occupation_size; i++) {
|
||||
if ((i&0x1f)==0) {
|
||||
s = lte_gold_generic_NB_IoT(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
dlcch->npdcch_e[ncce_index][i] = (dlcch->npdcch_e[ncce_index][i]&1) ^ ((s>>(i&0x1f))&1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int dci_allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
uint32_t symbol_offset,
|
||||
uint8_t *x0,
|
||||
uint8_t pilots,
|
||||
uint8_t pilot_shift,
|
||||
int16_t amp,
|
||||
unsigned short id_offset,
|
||||
uint8_t ncce_index,
|
||||
uint8_t agr_level,
|
||||
uint32_t *re_allocated)
|
||||
{
|
||||
MIMO_mode_t mimo_mode = (frame_parms->mode1_flag==1)? SISO:ALAMOUTI;
|
||||
|
||||
uint32_t tti_offset,aa;
|
||||
uint8_t re;
|
||||
int16_t gain_lin_QPSK;
|
||||
uint8_t first_re,last_re;
|
||||
int32_t tmp_sample1,tmp_sample2;
|
||||
|
||||
gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
first_re = 0;
|
||||
last_re = 12;
|
||||
|
||||
|
||||
if(ncce_index == 0 && agr_level == 2)
|
||||
{
|
||||
|
||||
for (re=first_re; re<last_re; re++) { // re varies between 0 and 12 sub-carriers
|
||||
|
||||
tti_offset = symbol_offset + re; // symbol_offset = 512 * L , re_offset = 512 - 3*12 , re
|
||||
|
||||
if (pilots != 1 || (re%6 != ((id_offset + 3*pilot_shift) % 6) ) ) // if re is not a pilot
|
||||
{
|
||||
|
||||
if (mimo_mode == SISO) { //SISO mapping
|
||||
*re_allocated = *re_allocated + 1; // variable incremented but never used
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
((int16_t*)&txdataF[aa][tti_offset])[0] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
|
||||
}
|
||||
*jj = *jj + 1;
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
((int16_t*)&txdataF[aa][tti_offset])[1] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //Q //b_{i+1}
|
||||
}
|
||||
*jj = *jj + 1;
|
||||
|
||||
} else if (mimo_mode == ALAMOUTI) {
|
||||
|
||||
*re_allocated = *re_allocated + 1;
|
||||
|
||||
((int16_t*)&tmp_sample1)[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
((int16_t*)&tmp_sample1)[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
|
||||
// second antenna position n -> -x1*
|
||||
|
||||
((int16_t*)&tmp_sample2)[0] = (x0[*jj]==1) ? (gain_lin_QPSK) : -gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
((int16_t*)&tmp_sample2)[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
|
||||
// normalization for 2 tx antennas
|
||||
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
|
||||
// fill in the rest of the ALAMOUTI precoding
|
||||
if ( pilots != 1 || (re+1)%3 != id_offset) {
|
||||
((int16_t *)&txdataF[0][tti_offset+1])[0] += -((int16_t *)&txdataF[1][tti_offset])[0]; //x1
|
||||
((int16_t *)&txdataF[0][tti_offset+1])[1] += ((int16_t *)&txdataF[1][tti_offset])[1];
|
||||
((int16_t *)&txdataF[1][tti_offset+1])[0] += ((int16_t *)&txdataF[0][tti_offset])[0]; //x0*
|
||||
((int16_t *)&txdataF[1][tti_offset+1])[1] += -((int16_t *)&txdataF[0][tti_offset])[1];
|
||||
} else {
|
||||
((int16_t *)&txdataF[0][tti_offset+2])[0] += -((int16_t *)&txdataF[1][tti_offset])[0]; //x1
|
||||
((int16_t *)&txdataF[0][tti_offset+2])[1] += ((int16_t *)&txdataF[1][tti_offset])[1];
|
||||
((int16_t *)&txdataF[1][tti_offset+2])[0] += ((int16_t *)&txdataF[0][tti_offset])[0]; //x0*
|
||||
((int16_t *)&txdataF[1][tti_offset+2])[1] += -((int16_t *)&txdataF[0][tti_offset])[1];
|
||||
|
||||
re++; // skip pilots
|
||||
*re_allocated = *re_allocated + 1;
|
||||
}
|
||||
re++; // adjacent carriers are taken care of by precoding
|
||||
*re_allocated = *re_allocated + 1; // incremented variable but never used
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if(agr_level == 1) {
|
||||
|
||||
for (re=(first_re + ncce_index*6); re<(6 + ncce_index*6); re++) { // re varies between 0 and 6 or 6 and 12 sub-carriers
|
||||
|
||||
tti_offset = symbol_offset + re; // symbol_offset = 512 * L , re_offset = 512 - 3*12 , re
|
||||
|
||||
if (pilots != 1 || (re%6 != ((id_offset + 3*pilot_shift) % 6) ) ) // if re is not a pilot
|
||||
{
|
||||
|
||||
if (mimo_mode == SISO) { //SISO mapping
|
||||
*re_allocated = *re_allocated + 1; // variable incremented but never used
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
((int16_t*)&txdataF[aa][tti_offset])[0] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
|
||||
}
|
||||
*jj = *jj + 1;
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
((int16_t*)&txdataF[aa][tti_offset])[1] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //Q //b_{i+1}
|
||||
}
|
||||
*jj = *jj + 1;
|
||||
|
||||
} else if (mimo_mode == ALAMOUTI) {
|
||||
|
||||
*re_allocated = *re_allocated + 1;
|
||||
|
||||
((int16_t*)&tmp_sample1)[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
((int16_t*)&tmp_sample1)[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
|
||||
// second antenna position n -> -x1*
|
||||
|
||||
((int16_t*)&tmp_sample2)[0] = (x0[*jj]==1) ? (gain_lin_QPSK) : -gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
((int16_t*)&tmp_sample2)[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
|
||||
// normalization for 2 tx antennas
|
||||
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
|
||||
// fill in the rest of the ALAMOUTI precoding
|
||||
if ( pilots != 1 || (re+1)%3 != id_offset) {
|
||||
((int16_t *)&txdataF[0][tti_offset+1])[0] += -((int16_t *)&txdataF[1][tti_offset])[0]; //x1
|
||||
((int16_t *)&txdataF[0][tti_offset+1])[1] += ((int16_t *)&txdataF[1][tti_offset])[1];
|
||||
((int16_t *)&txdataF[1][tti_offset+1])[0] += ((int16_t *)&txdataF[0][tti_offset])[0]; //x0*
|
||||
((int16_t *)&txdataF[1][tti_offset+1])[1] += -((int16_t *)&txdataF[0][tti_offset])[1];
|
||||
} else {
|
||||
((int16_t *)&txdataF[0][tti_offset+2])[0] += -((int16_t *)&txdataF[1][tti_offset])[0]; //x1
|
||||
((int16_t *)&txdataF[0][tti_offset+2])[1] += ((int16_t *)&txdataF[1][tti_offset])[1];
|
||||
((int16_t *)&txdataF[1][tti_offset+2])[0] += ((int16_t *)&txdataF[0][tti_offset])[0]; //x0*
|
||||
((int16_t *)&txdataF[1][tti_offset+2])[1] += -((int16_t *)&txdataF[0][tti_offset])[1];
|
||||
|
||||
re++; // skip pilots
|
||||
*re_allocated = *re_allocated + 1;
|
||||
}
|
||||
re++; // adjacent carriers are taken care of by precoding
|
||||
*re_allocated = *re_allocated + 1; // incremented variable but never used
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
printf("Error in allocate RE of DCI NB_IoT");
|
||||
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int dci_modulation_NB_IoT(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t control_region_size, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
|
||||
NB_IoT_eNB_NPDCCH_t *dlcch,
|
||||
unsigned int npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
|
||||
uint8_t agr_level,
|
||||
uint8_t ncce_index,
|
||||
unsigned int subframe,
|
||||
unsigned short NB_IoT_RB_ID) /// NB_IoT_RB_ID should be initialized in the LTE_DL_FRAME_PARMS
|
||||
{
|
||||
|
||||
uint32_t jj = 0;
|
||||
uint32_t re_allocated,symbol_offset;
|
||||
uint16_t l;
|
||||
uint8_t id_offset,pilot_shift,pilots = 0;
|
||||
unsigned short bandwidth_even_odd;
|
||||
unsigned short NB_IoT_start, RB_IoT_ID;
|
||||
|
||||
re_allocated = 0;
|
||||
id_offset = 0;
|
||||
pilot_shift = 0;
|
||||
// testing if the total number of RBs is even or odd
|
||||
bandwidth_even_odd = frame_parms->N_RB_DL % 2; // 0 even, 1 odd
|
||||
RB_IoT_ID = NB_IoT_RB_ID;
|
||||
// step 5, 6, 7 // modulation and mapping (slot 1, symbols 0..3)
|
||||
for (l=control_region_size; l<14; l++) { // loop on OFDM symbols
|
||||
|
||||
if((l>=4 && l<=7) || (l>=11 && l<=13))
|
||||
{
|
||||
pilots = 1;
|
||||
if(l==4 || l==6 || l==11 || l==13)
|
||||
{
|
||||
pilot_shift = 1;
|
||||
}
|
||||
} else {
|
||||
pilots = 0;
|
||||
}
|
||||
id_offset = frame_parms->Nid_cell % 6; // Cell_ID_NB_IoT % 6
|
||||
if(RB_IoT_ID < (frame_parms->N_RB_DL/2))
|
||||
{
|
||||
NB_IoT_start = frame_parms->ofdm_symbol_size - 12*(frame_parms->N_RB_DL/2) - (bandwidth_even_odd*6) + 12*(RB_IoT_ID % (int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
} else {
|
||||
NB_IoT_start = 1 + (bandwidth_even_odd*6) + 12*(RB_IoT_ID % (int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
}
|
||||
symbol_offset = (14*subframe*frame_parms->ofdm_symbol_size) + frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start
|
||||
|
||||
|
||||
if(agr_level == 2)
|
||||
{
|
||||
dci_allocate_REs_in_RB_NB_IoT(frame_parms,
|
||||
txdataF,
|
||||
&jj,
|
||||
symbol_offset,
|
||||
&dlcch->npdcch_e[0],
|
||||
pilots,
|
||||
pilot_shift,
|
||||
amp,
|
||||
id_offset,
|
||||
ncce_index,
|
||||
agr_level,
|
||||
&re_allocated);
|
||||
} else {
|
||||
dci_allocate_REs_in_RB_NB_IoT(frame_parms,
|
||||
txdataF,
|
||||
&jj,
|
||||
symbol_offset,
|
||||
&dlcch->npdcch_e[ncce_index],
|
||||
pilots,
|
||||
pilot_shift,
|
||||
amp,
|
||||
id_offset,
|
||||
ncce_index,
|
||||
agr_level,
|
||||
&re_allocated);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return (re_allocated);
|
||||
}
|
||||
289
openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.h
Normal file
289
openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.h
Normal file
@@ -0,0 +1,289 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/dci_NB_IoT.h
|
||||
* \brief typedefs for NB-IoT DCI structures (DCI N0, N1 and N2) from 36-212, V13.2 Follow the spec V13.2
|
||||
* \author Nick Ho
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
* \company NTUST
|
||||
* \email: nick133371@gmail.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#ifndef __DCI_NB_IOT_H__
|
||||
#define __DCI_NB_IOT_H__
|
||||
|
||||
#include <stdint.h>
|
||||
//#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DCIFormatN0 = 0,
|
||||
DCIFormatN1,
|
||||
DCIFormatN1_RA,//is for initial RA procedure (semi-static information) so maybe is not needed
|
||||
DCIFormatN1_RAR,
|
||||
DCIFormatN2,
|
||||
DCIFormatN2_Ind,
|
||||
DCIFormatN2_Pag,
|
||||
}DCI_format_NB_IoT_t;
|
||||
|
||||
/// DCI Format Type 0 (180 kHz, 23 bits)
|
||||
struct DCIFormatN0{
|
||||
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
|
||||
uint8_t type;
|
||||
/// Subcarrier indication, 6 bits
|
||||
uint8_t scind;
|
||||
/// Resourse Assignment (RU Assignment), 3 bits
|
||||
uint8_t ResAssign;
|
||||
/// Modulation and Coding Scheme, 4 bits
|
||||
uint8_t mcs;
|
||||
/// New Data Indicator, 1 bits
|
||||
uint8_t ndi;
|
||||
/// Scheduling Delay, 2 bits
|
||||
uint8_t Scheddly;
|
||||
/// Repetition Number, 3 bits
|
||||
uint8_t RepNum;
|
||||
/// Redundancy version for HARQ (only use 0 and 2), 1 bits
|
||||
uint8_t rv;
|
||||
/// DCI subframe repetition Number, 2 bits
|
||||
uint8_t DCIRep;
|
||||
};
|
||||
|
||||
typedef struct DCIFormatN0 DCIFormatN0_t;
|
||||
|
||||
/// DCI Format Type N1 for User data
|
||||
struct DCIFormatN1{
|
||||
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1,1bits
|
||||
uint8_t type;
|
||||
//NPDCCH order indicator (set to 0), 1 bits
|
||||
uint8_t orderIndicator;
|
||||
// Scheduling Delay,3 bits
|
||||
uint8_t Scheddly;
|
||||
// Resourse Assignment (RU Assignment),3 bits
|
||||
uint8_t ResAssign;
|
||||
// Modulation and Coding Scheme,4 bits
|
||||
uint8_t mcs;
|
||||
// Repetition Number,4 bits
|
||||
uint8_t RepNum;
|
||||
// New Data Indicator,1 bits
|
||||
uint8_t ndi;
|
||||
// HARQ-ACK resource,4 bits
|
||||
uint8_t HARQackRes;
|
||||
// DCI subframe repetition Number,2 bits
|
||||
uint8_t DCIRep;
|
||||
};
|
||||
|
||||
|
||||
typedef struct DCIFormatN1 DCIFormatN1_t;
|
||||
|
||||
/// DCI Format Type N1 for initial RA
|
||||
struct DCIFormatN1_RA{
|
||||
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
|
||||
uint8_t type;
|
||||
//NPDCCH order indicator (set to 0),1 bits
|
||||
uint8_t orderIndicator;
|
||||
// Start number of NPRACH repetiiton, 2 bits
|
||||
uint8_t Scheddly;
|
||||
// Subcarrier indication of NPRACH, 6 bits
|
||||
uint8_t scind;
|
||||
// All the remainging bits, 13 bits
|
||||
uint8_t remaingingBits;
|
||||
};
|
||||
|
||||
typedef struct DCIFormatN1_RA DCIFormatN1_RA_t;
|
||||
|
||||
/// DCI Format Type N1 for User data
|
||||
struct DCIFormatN1_RAR{
|
||||
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1,1bits
|
||||
uint8_t type;
|
||||
//NPDCCH order indicator (set to 0), 1 bits
|
||||
uint8_t orderIndicator;
|
||||
// Scheduling Delay,3 bits
|
||||
uint8_t Scheddly;
|
||||
// Resourse Assignment (RU Assignment),3 bits
|
||||
uint8_t ResAssign;
|
||||
// Modulation and Coding Scheme,4 bits
|
||||
uint8_t mcs;
|
||||
// Repetition Number,4 bits
|
||||
uint8_t RepNum;
|
||||
// New Data Indicator,1 bits,reserved in the RAR
|
||||
uint8_t ndi;
|
||||
// HARQ-ACK resource,4 bits,reserved in the RAR
|
||||
uint8_t HARQackRes;
|
||||
// DCI subframe repetition Number,2 bits
|
||||
uint8_t DCIRep;
|
||||
};
|
||||
|
||||
typedef struct DCIFormatN1_RAR DCIFormatN1_RAR_t;
|
||||
|
||||
// DCI Format Type N2 for direct indication, 15 bits
|
||||
struct DCIFormatN2_Ind{
|
||||
//Flag for paging(1)/direct indication(0), set to 0,1 bits
|
||||
uint8_t type;
|
||||
//Direct indication information, 8 bits
|
||||
uint8_t directIndInf;
|
||||
// Reserved information bits, 6 bits
|
||||
uint8_t resInfoBits;
|
||||
};
|
||||
|
||||
typedef struct DCIFormatN2_Ind DCIFormatN2_Ind_t;
|
||||
|
||||
// DCI Format Type N2 for Paging, 15 bits
|
||||
struct DCIFormatN2_Pag{
|
||||
//Flag for paging(1)/direct indication(0), set to 1,1 bits
|
||||
uint8_t type;
|
||||
// Resourse Assignment (RU Assignment), 3 bits
|
||||
uint8_t ResAssign;
|
||||
// Modulation and Coding Scheme, 4 bits
|
||||
uint8_t mcs;
|
||||
// Repetition Number, 4 bits
|
||||
uint8_t RepNum;
|
||||
// Reserved 3 bits
|
||||
uint8_t DCIRep;
|
||||
};
|
||||
|
||||
typedef struct DCIFormatN2_Pag DCIFormatN2_Pag_t;
|
||||
|
||||
typedef union DCI_CONTENT {
|
||||
//
|
||||
DCIFormatN0_t DCIN0;
|
||||
//
|
||||
DCIFormatN1_t DCIN1;
|
||||
//
|
||||
DCIFormatN1_RA_t DCIN1_RA;
|
||||
//
|
||||
DCIFormatN1_RAR_t DCIN1_RAR;
|
||||
//
|
||||
DCIFormatN2_Ind_t DCIN2_Ind;
|
||||
//
|
||||
DCIFormatN2_Pag_t DCIN2_Pag;
|
||||
|
||||
}DCI_CONTENT;
|
||||
|
||||
/*Structure for packing*/
|
||||
|
||||
struct DCIN0{
|
||||
/// DCI subframe repetition Number, 2 bits
|
||||
uint8_t DCIRep:2;
|
||||
/// New Data Indicator, 1 bits
|
||||
uint8_t ndi:1;
|
||||
/// Repetition Number, 3 bits
|
||||
uint8_t RepNum:3;
|
||||
/// Redundancy version for HARQ (only use 0 and 2), 1 bits
|
||||
uint8_t rv:1;
|
||||
/// Modulation and Coding Scheme, 4 bits
|
||||
uint8_t mcs:4;
|
||||
/// Scheduling Delay, 2 bits
|
||||
uint8_t Scheddly:2;
|
||||
/// Resourse Assignment (RU Assignment), 3 bits
|
||||
uint8_t ResAssign:3;
|
||||
/// Subcarrier indication, 6 bits
|
||||
uint8_t scind:6;
|
||||
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
|
||||
uint8_t type:1;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
typedef struct DCIN0 DCIN0_t;
|
||||
#define sizeof_DCIN0_t 23
|
||||
|
||||
struct DCIN1_RAR{
|
||||
// DCI subframe repetition Number, 2 bits
|
||||
uint8_t DCIRep:2;
|
||||
// HARQ-ACK resource,4 bits
|
||||
uint8_t HARQackRes:4;
|
||||
// New Data Indicator,1 bits
|
||||
uint8_t ndi:1;
|
||||
// Repetition Number, 4 bits
|
||||
uint8_t RepNum:4;
|
||||
// Modulation and Coding Scheme, 4 bits
|
||||
uint8_t mcs:4;
|
||||
// Resourse Assignment (RU Assignment), 3 bits
|
||||
uint8_t ResAssign:3;
|
||||
// Scheduling Delay, 3 bits
|
||||
uint8_t Scheddly:3;
|
||||
//NPDCCH order indicator (set to 0),1 bits
|
||||
uint8_t orderIndicator:1;
|
||||
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
|
||||
uint8_t type:1;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
typedef struct DCIN1_RAR DCIN1_RAR_t;
|
||||
#define sizeof_DCIN1_RAR_t 23
|
||||
|
||||
struct DCIN1{
|
||||
// DCI subframe repetition Number, 2 bits
|
||||
uint8_t DCIRep:2;
|
||||
// HARQ-ACK resource,4 bits
|
||||
uint8_t HARQackRes:4;
|
||||
// New Data Indicator,1 bits
|
||||
uint8_t ndi:1;
|
||||
// Repetition Number, 4 bits
|
||||
uint8_t RepNum:4;
|
||||
// Modulation and Coding Scheme, 4 bits
|
||||
uint8_t mcs:4;
|
||||
// Resourse Assignment (RU Assignment), 3 bits
|
||||
uint8_t ResAssign:3;
|
||||
// Scheduling Delay, 3 bits
|
||||
uint8_t Scheddly:3;
|
||||
//NPDCCH order indicator (set to 0),1 bits
|
||||
uint8_t orderIndicator:1;
|
||||
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
|
||||
uint8_t type:1;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
typedef struct DCIN1 DCIN1_t;
|
||||
#define sizeof_DCIN1_t 23
|
||||
|
||||
// DCI Format Type N2 for direct indication, 15 bits
|
||||
struct DCIN2_Ind{
|
||||
// Reserved information bits, 6 bits
|
||||
uint8_t resInfoBits:6;
|
||||
//Direct indication information, 8 bits
|
||||
uint8_t directIndInf:8;
|
||||
//Flag for paging(1)/direct indication(0), set to 0,1 bits
|
||||
uint8_t type:1;
|
||||
} __attribute__ ((__packed__));;
|
||||
|
||||
typedef struct DCIN2_Ind DCIN2_Ind_t;
|
||||
#define sizeof_DCIN2_Ind_t 15
|
||||
|
||||
// DCI Format Type N2 for Paging, 15 bits
|
||||
struct DCIN2_Pag{
|
||||
// Reserved 3 bits
|
||||
uint8_t DCIRep:3;
|
||||
// Repetition Number, 4 bits
|
||||
uint8_t RepNum:4;
|
||||
// Modulation and Coding Scheme, 4 bits
|
||||
uint8_t mcs:4;
|
||||
// Resourse Assignment (RU Assignment), 3 bits
|
||||
uint8_t ResAssign:3;
|
||||
//Flag for paging(1)/direct indication(0), set to 1,1 bits
|
||||
uint8_t type:1;
|
||||
} __attribute__ ((__packed__));;
|
||||
|
||||
typedef struct DCIN2_Pag DCIN2_Pag_t;
|
||||
|
||||
#define sizeof_DCIN2_Pag_t 15
|
||||
|
||||
#define MAX_DCI_SIZE_BITS_NB_IoT 23
|
||||
|
||||
#endif
|
||||
508
openair1/PHY/LTE_TRANSPORT/dci_tools_NB_IoT.c
Normal file
508
openair1/PHY/LTE_TRANSPORT/dci_tools_NB_IoT.c
Normal file
@@ -0,0 +1,508 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/dci_tools_NB_IoT.c
|
||||
* \brief Support the packing of DCI N0, N1, and N2 follow the 36.213 V13.2
|
||||
* \author Nick Ho
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
* \company NTUST
|
||||
* \email: nick133371@gmail.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include "PHY/impl_defs_lte_NB_IoT.h"
|
||||
#include "openair1/PHY/extern_NB_IoT.h"
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/dlsch_tbs_full_NB_IoT.h"
|
||||
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
|
||||
// The table at 36.213 Table 16.4.1.3-1 map the Isf (DCI param) to the number of subframes (Nsf)
|
||||
int resource_to_subframe[8] = {1,2,3,4,5,6,8,10};
|
||||
|
||||
// The table at 36.213 Table 16.4.1-1, the part that Rmax<128 for scheduling delay K0
|
||||
int Scheddly_less_128[8] = {0,4,8,12,16,32,64,128};
|
||||
|
||||
// The table at 36.213 Table 16.4.1-1, the part that Rmax>=128 for scheduling delay K0
|
||||
int Scheddly_bigger_128[8] = {0,16,32,64,128,256,512,1024};
|
||||
|
||||
// The table at 36.213 Table 16.4.1.3-2 map the indext to value for repetition number for NPDSCH
|
||||
int Irep_to_Nrep[16] = {1,2,4,8,16,32,64,128,192,256,384,512,768,1024,1536,2048};
|
||||
|
||||
// The function : mapping from index to value for the 36.213 Table 16.4.1-1: K0 for DCI N1
|
||||
int Idelay_to_K0(uint8_t Sched_delay, int Rmax)
|
||||
{
|
||||
int k0=0;
|
||||
|
||||
if(Rmax <128)
|
||||
{
|
||||
k0 = Scheddly_less_128[Sched_delay];
|
||||
}else if(Rmax >=128)
|
||||
{
|
||||
k0 = Scheddly_bigger_128[Sched_delay];
|
||||
}
|
||||
return k0;
|
||||
}
|
||||
|
||||
// The implementation of 36.213-Table 16.6-1: NPDCCH UE-sepcific search space candidates
|
||||
int DCIrep_to_real_rep(uint8_t DCI_rep, int Rmax)
|
||||
{
|
||||
int R=0;
|
||||
if(Rmax == 1)
|
||||
{
|
||||
if(DCI_rep == 0)
|
||||
R = 1;
|
||||
}else if (Rmax == 2)
|
||||
{
|
||||
if(DCI_rep == 0)
|
||||
R = 1;
|
||||
else if(DCI_rep == 1)
|
||||
R = 2;
|
||||
}else if (Rmax == 4)
|
||||
{
|
||||
if(DCI_rep == 0)
|
||||
R = 1;
|
||||
else if(DCI_rep == 1)
|
||||
R = 2;
|
||||
else if(DCI_rep == 2)
|
||||
R = 4;
|
||||
}else if (Rmax >= 8)
|
||||
{
|
||||
if(DCI_rep == 0)
|
||||
R = Rmax/8;
|
||||
else if(DCI_rep == 1)
|
||||
R = Rmax/4;
|
||||
else if(DCI_rep == 2)
|
||||
R = Rmax/2;
|
||||
else if(DCI_rep == 3)
|
||||
R = Rmax;
|
||||
}
|
||||
|
||||
return R;
|
||||
}
|
||||
|
||||
|
||||
int generate_eNB_ulsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
DCI_CONTENT *DCI_Content,
|
||||
uint16_t rnti,
|
||||
NB_IoT_eNB_NPDCCH_t *ndlcch,
|
||||
uint8_t aggregation,
|
||||
uint8_t npdcch_start_symbol,
|
||||
uint8_t ncce_index)
|
||||
{
|
||||
|
||||
int i = 0; // index for showing the PDU content
|
||||
uint8_t *DCI_flip = NULL;
|
||||
ncce_index = 0;
|
||||
|
||||
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
|
||||
uint8_t type;
|
||||
/// Subcarrier indication, 6 bits
|
||||
uint8_t scind;
|
||||
/// Resourse Assignment (RU Assignment), 3 bits
|
||||
uint8_t ResAssign;
|
||||
/// Modulation and Coding Scheme, 4 bits
|
||||
uint8_t mcs;
|
||||
/// New Data Indicator, 1 bits
|
||||
uint8_t ndi;
|
||||
/// Scheduling Delay, 2 bits
|
||||
uint8_t Scheddly;
|
||||
/// Repetition Number, 3 bits
|
||||
uint8_t RepNum;
|
||||
/// Redundancy version for HARQ (only use 0 and 2), 1 bits
|
||||
uint8_t rv;
|
||||
/// DCI subframe repetition Number, 2 bits
|
||||
uint8_t DCIRep;
|
||||
|
||||
type = DCI_Content->DCIN0.type;
|
||||
scind = DCI_Content->DCIN0.scind;
|
||||
ResAssign = DCI_Content->DCIN0.ResAssign;
|
||||
mcs = DCI_Content->DCIN0.mcs;
|
||||
ndi = DCI_Content->DCIN0.ndi;
|
||||
Scheddly = DCI_Content->DCIN0.Scheddly;
|
||||
RepNum = DCI_Content->DCIN0.RepNum;
|
||||
rv = DCI_Content->DCIN0.rv;
|
||||
DCIRep = DCI_Content->DCIN0.DCIRep;
|
||||
|
||||
/*Now configure the npdcch structure*/
|
||||
|
||||
ndlcch->A[ncce_index] = sizeof_DCIN0_t; // number of bits in DCI
|
||||
|
||||
ndlcch->rnti[ncce_index] = rnti; //we store the RNTI (e.g. for RNTI will be used later)
|
||||
ndlcch->active[ncce_index] = 1; //will be activated by the corresponding NDSLCH pdu
|
||||
|
||||
ndlcch->dci_repetitions[ncce_index] = DCIrep_to_real_rep(DCIRep,4);// Rmax set to 4 at the moment, need to check the configuation for setting it
|
||||
|
||||
|
||||
DCI_flip = (uint8_t*)malloc(3*sizeof(uint8_t));
|
||||
|
||||
for(i=0; i<3; ++i){
|
||||
DCI_flip[i] = 0x0;
|
||||
}
|
||||
|
||||
// Generate DCI N0 checking the TS.36.213
|
||||
DCI_flip[0] = (type << 7) | (scind << 1) | (ResAssign>>2);
|
||||
DCI_flip[1] = (uint8_t)(ResAssign << 6) | (Scheddly << 4) | mcs;
|
||||
DCI_flip[2] = (rv << 7) | (RepNum << 4) | (ndi << 3) |(DCIRep <<1);
|
||||
|
||||
ndlcch->pdu[ncce_index] = DCI_flip;
|
||||
|
||||
printf("DCI N0 content:");
|
||||
for (i =0;i<3;i++)
|
||||
printf("%d ",DCI_flip[i]);
|
||||
printf("\n");
|
||||
/*
|
||||
* TS 36.213 ch 16.4.1.5
|
||||
* ITBS is always set equivalent to IMCS for data
|
||||
* ISF = ResAssign
|
||||
*/
|
||||
|
||||
ndlcch->counter_repetition_number[ncce_index] = DCIrep_to_real_rep(DCIRep,4);//Rmax set to 4 at the moment, need to check the configuation for setting it
|
||||
|
||||
LOG_I(PHY,"DCI packing for N0 done \n");
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
DCI_CONTENT *DCI_Content,
|
||||
uint16_t rnti,
|
||||
DCI_format_NB_IoT_t dci_format,
|
||||
NB_IoT_eNB_NPDCCH_t *ndlcch,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t aggregation, //////????? maybe add the ncce index ??????????
|
||||
uint8_t npdcch_start_symbol,
|
||||
uint8_t ncce_index)
|
||||
{
|
||||
|
||||
int i = 0;
|
||||
uint8_t *DCI_flip = NULL;
|
||||
|
||||
//N1 parameters
|
||||
|
||||
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
|
||||
uint8_t type = 0;
|
||||
//NPDCCH order indicator (set to 0),1 bits
|
||||
uint8_t orderIndicator = 0;
|
||||
// Scheduling Delay, 3 bits
|
||||
uint8_t Sched_delay = 0;
|
||||
// Resourse Assignment (RU Assignment), 3 bits
|
||||
uint8_t ResAssign = 0;//Isf
|
||||
// Modulation and Coding Scheme, 4 bits
|
||||
uint8_t mcs = 0;
|
||||
// Repetition Number, 4 bits
|
||||
uint8_t RepNum = 0;
|
||||
// DCI subframe repetition Number, 2 bits
|
||||
uint8_t DCIRep = 0;
|
||||
// New Data Indicator,1 bits
|
||||
uint8_t ndi = 0;
|
||||
// HARQ-ACK resource,4 bits
|
||||
uint8_t HARQackRes = 0;
|
||||
|
||||
//N2 parameters
|
||||
|
||||
//Direct indication information, 8 bits
|
||||
uint8_t directIndInf= 0;
|
||||
// Reserved information bits, 6 bits
|
||||
uint8_t resInfoBits =0;
|
||||
|
||||
// printf("Generate eNB DCI, format %d, rnti %x (pdu %p)\n",dci_format,rnti,dci_pdu);
|
||||
|
||||
switch (dci_format) {
|
||||
|
||||
// Impossible to have a DCI N0, we have condition before
|
||||
case DCIFormatN0:
|
||||
return(-1);
|
||||
break;
|
||||
|
||||
case DCIFormatN1_RAR: // This is DLSCH allocation for control traffic (no NDI and no ACK/NACK resource for RAR DCI)
|
||||
|
||||
|
||||
/*Packed DCI here-------------------------------------------*/
|
||||
type = DCI_Content->DCIN1_RAR.type;
|
||||
orderIndicator = DCI_Content->DCIN1_RAR.orderIndicator;
|
||||
Sched_delay = DCI_Content->DCIN1_RAR.Scheddly;
|
||||
ResAssign = DCI_Content->DCIN1_RAR.ResAssign;
|
||||
mcs = DCI_Content->DCIN1_RAR.mcs;
|
||||
RepNum = DCI_Content->DCIN1_RAR.RepNum;
|
||||
ndi = DCI_Content->DCIN1_RAR.ndi;
|
||||
HARQackRes = DCI_Content->DCIN1_RAR.HARQackRes;
|
||||
DCIRep = DCI_Content->DCIN1_RAR.DCIRep;
|
||||
|
||||
/*Now configure the npdcch structure*/
|
||||
|
||||
ndlcch->A[ncce_index] = sizeof_DCIN1_RAR_t; // number of bits in DCI
|
||||
|
||||
//ndlcch->subframe_tx[subframe] = 1; // check if it's OK
|
||||
ndlcch->rnti[ncce_index] = rnti; //we store the RNTI (e.g. for RNTI will be used later)
|
||||
ndlcch->active[ncce_index] = 1; //will be activated by the corresponding NDSLCH pdu
|
||||
|
||||
// use this value to configure PHY both harq_processes and resource mapping.
|
||||
ndlcch->scheduling_delay[ncce_index] = Idelay_to_K0(Sched_delay,4);//Rmax set to 4 at the moment, need to check the configuation for setting it
|
||||
ndlcch->resource_assignment[ncce_index] = resource_to_subframe[ResAssign]; //from Isf of DCI to the number of subframe
|
||||
ndlcch->repetition_number[ncce_index] = Irep_to_Nrep[RepNum]; // repetition number for NPDSCH
|
||||
ndlcch->dci_repetitions[ncce_index] = DCIrep_to_real_rep(DCIRep,4); //Rmax set to 4 at the moment, need to check the configuation for setting it
|
||||
|
||||
ndlcch->modulation[ncce_index] = 2; //QPSK
|
||||
//// ////////////////////////////////////////////////if(ndlcch->round == 0) //this should be set from initialization (init-lte)
|
||||
|
||||
//ndlcch->status[ncce_index] = ACTIVE_NB_IoT;
|
||||
ndlcch->mcs[ncce_index] = mcs;
|
||||
|
||||
|
||||
DCI_flip = (uint8_t*)malloc(3*sizeof(uint8_t));
|
||||
|
||||
for(i=0; i<3; ++i){
|
||||
DCI_flip[i] = 0x0;
|
||||
}
|
||||
|
||||
// Generate the DCIN1 for the RAR
|
||||
DCI_flip[0] = (type << 7) | (orderIndicator << 6) | (Sched_delay<<3) | ResAssign ;
|
||||
DCI_flip[1] = (mcs << 4) | RepNum;
|
||||
DCI_flip[2] = (ndi << 7) | (HARQackRes << 3) | (DCIRep <<1);
|
||||
|
||||
ndlcch->pdu[ncce_index] = DCI_flip;
|
||||
|
||||
printf("DCI N1 RAR PDU content:");
|
||||
for (i =0;i<3;i++)
|
||||
printf("%d ",DCI_flip[i]);
|
||||
printf("\n");
|
||||
/*
|
||||
* TS 36.213 ch 16.4.1.5
|
||||
* ITBS is always set equivalent to IMCS for data
|
||||
* ISF = ResAssign
|
||||
*/
|
||||
|
||||
ndlcch->TBS[ncce_index] = TBStable_NB_IoT[mcs][ResAssign];
|
||||
//ndlcch->subframe[ncce_index] = subframe;
|
||||
ndlcch->counter_repetition_number[ncce_index] = DCIrep_to_real_rep(DCIRep,4); //Rmax set to 4 at the moment, need to check the configuation for setting it
|
||||
|
||||
|
||||
LOG_I(PHY,"DCI packing for N1RAR done \n");
|
||||
|
||||
//set in new_eNB_dlsch (initialization)
|
||||
/*
|
||||
* Mlimit
|
||||
* nsoft
|
||||
* round
|
||||
*/
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case DCIFormatN1: // for user data
|
||||
|
||||
|
||||
type = DCI_Content->DCIN1.type;
|
||||
orderIndicator = DCI_Content->DCIN1.orderIndicator;
|
||||
Sched_delay = DCI_Content->DCIN1.Scheddly;
|
||||
ResAssign = DCI_Content->DCIN1.ResAssign;
|
||||
mcs = DCI_Content->DCIN1.mcs;
|
||||
RepNum = DCI_Content->DCIN1.RepNum;
|
||||
ndi = DCI_Content->DCIN1.ndi;
|
||||
HARQackRes = DCI_Content->DCIN1.HARQackRes;
|
||||
DCIRep = DCI_Content->DCIN1.DCIRep;
|
||||
|
||||
//add_dci_NB_IoT(eNB->DCI_pdu,DLSCH_DCI_NB_IoT,rnti,sizeof(DCIN1_t),aggregation,sizeof_DCIN1_t,DCIFormatN1,npdcch_start_symbol);
|
||||
|
||||
/*Now configure the npdcch structure*/
|
||||
ndlcch->A[ncce_index] = sizeof_DCIN1_t; // number of bits in DCI
|
||||
|
||||
|
||||
|
||||
//ndlcch->subframe_tx[subframe] = 1; // check if it's OK
|
||||
ndlcch->rnti[ncce_index] = rnti; //we store the RNTI (e.g. for RNTI will be used later)
|
||||
ndlcch->active[ncce_index] = 1;//will be activated by the corresponding NDSLCH pdu
|
||||
|
||||
// use this value to configure PHY both harq_processes and resource mapping.
|
||||
ndlcch->scheduling_delay[ncce_index] = Idelay_to_K0(Sched_delay,4); //Rmax set to 4 at the moment, need to check the configuation for setting it
|
||||
ndlcch->resource_assignment[ncce_index] = resource_to_subframe[ResAssign]; //from Isf of DCI to the number of subframe
|
||||
ndlcch->repetition_number[ncce_index] = Irep_to_Nrep[RepNum]; // repetition number for NPDSCH
|
||||
ndlcch->dci_repetitions[ncce_index] = DCIrep_to_real_rep(DCIRep,4);//Rmax set to 4 at the moment, need to check the configuation for setting it
|
||||
ndlcch->modulation[ncce_index] = 2; //QPSK
|
||||
//if(ndlcch->round == 0){ //this should be set from initialization (init-lte)
|
||||
|
||||
//ndlcch->status[ncce_index] = ACTIVE_NB_IoT;
|
||||
ndlcch->mcs[ncce_index] = mcs;
|
||||
ndlcch->TBS[ncce_index] = TBStable_NB_IoT[mcs][ResAssign]; // this table should be rewritten for nb-iot
|
||||
//ndlcch->pdu[ncce_index] = DLSCH_DCI_NB_IoT;
|
||||
|
||||
DCI_flip = (uint8_t*)malloc(3*sizeof(uint8_t));
|
||||
|
||||
for(i=0; i<3; ++i){
|
||||
DCI_flip[i] = 0x0;
|
||||
}
|
||||
|
||||
DCI_flip[0] = (type << 7) | (orderIndicator << 6) | (Sched_delay<<3) | ResAssign ;
|
||||
DCI_flip[1] = (mcs << 4) | RepNum;
|
||||
DCI_flip[2] = (ndi << 7) | (HARQackRes << 3) | (DCIRep <<1);
|
||||
|
||||
ndlcch->pdu[ncce_index] = DCI_flip;
|
||||
|
||||
printf("DCI N1 PDU content:");
|
||||
for (i =0;i<3;i++)
|
||||
printf("%d ",DCI_flip[i]);
|
||||
printf("\n");
|
||||
|
||||
ndlcch->counter_repetition_number[ncce_index] = DCIrep_to_real_rep(DCIRep,4); ////??????? should be repalce by the value in spec table 16.6-3, check also Rmax
|
||||
//}
|
||||
//ndlcch->frame[ncce_index] = frame;
|
||||
//ndlcch->subframe[ncce_index] = subframe;
|
||||
|
||||
LOG_I(PHY,"DCI packing for N1 done \n");
|
||||
|
||||
break;
|
||||
|
||||
case DCIFormatN2_Ind: //MP: for the moment is not implemented
|
||||
|
||||
type = DCI_Content->DCIN2_Ind.type;
|
||||
directIndInf = DCI_Content->DCIN2_Ind.directIndInf;
|
||||
resInfoBits = DCI_Content->DCIN2_Ind.resInfoBits;
|
||||
|
||||
directIndInf = directIndInf;
|
||||
resInfoBits = resInfoBits;
|
||||
|
||||
//add_dci_NB_IoT(eNB->DCI_pdu,DLSCH_DCI_NB_IoT,rnti,sizeof(DCIN2_Ind_t),aggregation,sizeof_DCIN2_Ind_t,DCIFormatN2_Ind,npdcch_start_symbol);
|
||||
|
||||
// use this value to configure PHY both harq_processes and resource mapping.
|
||||
break;
|
||||
|
||||
|
||||
case DCIFormatN2_Pag: //MP: for the moment is not implemented
|
||||
|
||||
type = DCI_Content->DCIN2_Pag.type;
|
||||
ResAssign = DCI_Content->DCIN2_Pag.ResAssign;
|
||||
mcs = DCI_Content->DCIN2_Pag.mcs;
|
||||
RepNum = DCI_Content->DCIN2_Pag.RepNum;
|
||||
DCIRep = DCI_Content->DCIN2_Pag.DCIRep;
|
||||
|
||||
//add_dci_NB_IoT(eNB->DCI_pdu,DLSCH_DCI_NB_IoT,rnti,sizeof(DCIN2_Pag_t),aggregation,sizeof_DCIN2_Pag_t,DCIFormatN2_Pag,npdcch_start_symbol);
|
||||
|
||||
// use this value to configure PHY both harq_processes and resource mapping.
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"Unknown DCI format\n");
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
// compute DL power control parameters
|
||||
|
||||
//free(DLSCH_DCI_NB_IoT);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
uint8_t subframe2harq_pid_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe)
|
||||
{
|
||||
|
||||
uint8_t ret = 255;
|
||||
|
||||
if (frame_parms->frame_type == FDD) {
|
||||
ret = (((frame<<1)+subframe)&7);
|
||||
} else {
|
||||
|
||||
switch (frame_parms->tdd_config) {
|
||||
|
||||
case 1:
|
||||
if ((subframe==2) ||
|
||||
(subframe==3) ||
|
||||
(subframe==7) ||
|
||||
(subframe==8))
|
||||
switch (subframe) {
|
||||
case 2:
|
||||
case 3:
|
||||
ret = (subframe-2);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
case 8:
|
||||
ret = (subframe-5);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"subframe2_harq_pid_NB_IoT, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config);
|
||||
ret = (255);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if ((subframe!=2) && (subframe!=7)) {
|
||||
LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config);
|
||||
//mac_xface_NB_IoT->macphy_exit("subframe2_harq_pid_NB_IoT, Illegal subframe");
|
||||
ret = (255);
|
||||
}
|
||||
|
||||
ret = (subframe/7);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if ((subframe<2) || (subframe>4)) {
|
||||
LOG_E(PHY,"subframe2_harq_pid_NB_IoT, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config);
|
||||
ret = (255);
|
||||
}
|
||||
|
||||
ret = (subframe-2);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if ((subframe<2) || (subframe>3)) {
|
||||
LOG_E(PHY,"subframe2_harq_pid_NB_IoT, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config);
|
||||
ret = (255);
|
||||
}
|
||||
|
||||
ret = (subframe-2);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (subframe!=2) {
|
||||
LOG_E(PHY,"subframe2_harq_pid_NB_IoT, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config);
|
||||
ret = (255);
|
||||
}
|
||||
|
||||
ret = (subframe-2);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"subframe2_harq_pid_NB_IoT, Unsupported TDD mode %d\n",frame_parms->tdd_config);
|
||||
ret = (255);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 255) {
|
||||
LOG_E(PHY, "invalid harq_pid(%d) at SFN/SF = %d/%d\n", ret, frame, subframe);
|
||||
//mac_xface_NB_IoT->macphy_exit("invalid harq_pid");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -168,6 +168,7 @@ typedef struct {
|
||||
uint8_t codeword;
|
||||
} LTE_DL_eNB_HARQ_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// Indicator of first transmission
|
||||
uint8_t first_tx;
|
||||
@@ -800,5 +801,9 @@ typedef struct {
|
||||
} DCI_ALLOC_t;
|
||||
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
/**@}*/
|
||||
#endif
|
||||
|
||||
697
openair1/PHY/LTE_TRANSPORT/defs_NB_IoT.h
Normal file
697
openair1/PHY/LTE_TRANSPORT/defs_NB_IoT.h
Normal file
@@ -0,0 +1,697 @@
|
||||
/*******************************************************************************
|
||||
|
||||
*******************************************************************************/
|
||||
/*! \file PHY/LTE_TRANSPORT/defs_NB_IoT.h
|
||||
* \brief data structures for NPDSCH/NDLSCH/NPUSCH/NULSCH physical and transport channel descriptors (TX/RX) of NB-IoT
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#ifndef __LTE_TRANSPORT_DEFS_NB_IOT__H__
|
||||
#define __LTE_TRANSPORT_DEFS_NB_IOT__H__
|
||||
////#include "PHY/defs.h"
|
||||
//#include "PHY/defs_nb_iot.h"
|
||||
#include "PHY/LTE_TRANSPORT/dci_NB_IoT.h"
|
||||
#include "PHY/impl_defs_lte_NB_IoT.h"
|
||||
#include "openair2/COMMON/platform_types.h"
|
||||
//#include "dci.h"
|
||||
#include "PHY/LTE_TRANSPORT/uci_NB_IoT.h"
|
||||
|
||||
#define LTE_NULL_NB_IoT 2
|
||||
|
||||
#define MAX_NUM_DLSCH_SEGMENTS_NB_IoT 16
|
||||
#define MAX_NUM_ULSCH_SEGMENTS_NB_IoT MAX_NUM_DLSCH_SEGMENTS_NB_IoT
|
||||
|
||||
#define MAX_NUM_BITS_IN_DL_PER_SF_NB_IoT 284 // case one NB-IoT antenna && one LTE antenna
|
||||
|
||||
//// for NB-IoT
|
||||
#define MAX_NUM_CHANNEL_BITS_NB_IoT 3360 //14 symbols * 12 sub-carriers * 10 SF * 2bits/RE // to check during real tests
|
||||
|
||||
#define MAX_NUM_DL_CHANNEL_BITS_NB_IoT 2840 //284* 10 SF // case In-band operation mode witn 1 NB-IoT antenna && 1 LTE antenna //
|
||||
#define MAX_TBS_DL_SIZE_BITS_NB_IoT 680 // in release 13 // in release 14 = 2048 // ??? **** not sure
|
||||
|
||||
typedef enum {
|
||||
|
||||
SCH_IDLE_NB_IoT,
|
||||
ACTIVE_NB_IoT,
|
||||
CBA_ACTIVE_NB_IoT,
|
||||
DISABLED_NB_IoT
|
||||
|
||||
} SCH_status_NB_IoT_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// NB-IoT
|
||||
SCH_status_NB_IoT_t status;
|
||||
/// The scheduling the NPDCCH and the NPDSCH transmission TS 36.213 Table 16.4.1-1
|
||||
uint8_t scheduling_delay;
|
||||
/// The number of the subframe to transmit the NPDSCH Table TS 36.213 Table 16.4.1.3-1 (Nsf) (NB. in this case is not the index Isf)
|
||||
uint8_t resource_assignment;
|
||||
/// is the index that determined the repeat number of NPDSCH through table TS 36.213 Table 16.4.1.3-2 / for SIB1-NB Table 16.4.1.3-3
|
||||
uint8_t repetition_number;
|
||||
/// Determined the ACK/NACK delay and the subcarrier allocation TS 36.213 Table 16.4.2
|
||||
uint8_t HARQ_ACK_resource;
|
||||
/// Determined the repetition number value 0-3 (2 biut carried by the FAPI NPDCCH)
|
||||
uint8_t dci_subframe_repetitions;
|
||||
/// modulation always QPSK Qm = 2
|
||||
uint8_t modulation;
|
||||
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
|
||||
uint8_t e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
|
||||
/// data after scrambling
|
||||
uint8_t s_e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
|
||||
//length of the table e
|
||||
uint16_t length_e; // new parameter
|
||||
/// Tail-biting convolutional coding outputs
|
||||
uint8_t d[96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))]; // new parameter
|
||||
/// Sub-block interleaver outputs
|
||||
uint8_t w[3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24)]; // new parameter
|
||||
/// Status Flag indicating for this DLSCH (idle,active,disabled)
|
||||
//SCH_status_t status;
|
||||
/// Transport block size
|
||||
uint32_t TBS;
|
||||
/// The payload + CRC size in bits, "B" from 36-212
|
||||
uint32_t B;
|
||||
/// Pointer to the payload
|
||||
uint8_t *b;
|
||||
///pdu of the ndlsch message
|
||||
uint8_t *pdu;
|
||||
/// Frame where current HARQ round was sent
|
||||
uint32_t frame;
|
||||
/// Subframe where current HARQ round was sent
|
||||
uint32_t subframe;
|
||||
/// Index of current HARQ round for this DLSCH
|
||||
uint8_t round;
|
||||
/// MCS format for this NDLSCH , TS 36.213 Table 16.4.1.5
|
||||
uint8_t mcs;
|
||||
// we don't have code block segmentation / crc attachment / concatenation in NB-IoT R13 36.212 6.4.2
|
||||
// we don't have beamforming in NB-IoT
|
||||
//this index will be used mainly for SI message buffer
|
||||
uint8_t pdu_buffer_index;
|
||||
|
||||
} NB_IoT_DL_eNB_HARQ_t;
|
||||
|
||||
typedef struct {
|
||||
/// HARQ process id
|
||||
uint8_t harq_id;
|
||||
/// ACK bits (after decoding) 0:NACK / 1:ACK / 2:DTX
|
||||
uint8_t ack;
|
||||
/// send status (for PUCCH)
|
||||
uint8_t send_harq_status;
|
||||
/// nCCE (for PUCCH)
|
||||
uint8_t nCCE;
|
||||
/// DAI value detected from DCI1/1a/1b/1d/2/2a/2b/2c. 0xff indicates not touched
|
||||
uint8_t vDAI_DL;
|
||||
/// DAI value detected from DCI0/4. 0xff indicates not touched
|
||||
uint8_t vDAI_UL;
|
||||
} harq_status_NB_IoT_t;
|
||||
|
||||
typedef struct {
|
||||
/// UL RSSI per receive antenna
|
||||
int32_t UL_rssi[NB_ANTENNAS_RX];
|
||||
/// PUCCH1a/b power (digital linear)
|
||||
uint32_t Po_PUCCH;
|
||||
/// PUCCH1a/b power (dBm)
|
||||
int32_t Po_PUCCH_dBm;
|
||||
/// PUCCH1 power (digital linear), conditioned on below threshold
|
||||
uint32_t Po_PUCCH1_below;
|
||||
/// PUCCH1 power (digital linear), conditioned on above threshold
|
||||
uint32_t Po_PUCCH1_above;
|
||||
/// Indicator that Po_PUCCH has been updated by PHY
|
||||
int32_t Po_PUCCH_update;
|
||||
/// DL Wideband CQI index (2 TBs)
|
||||
uint8_t DL_cqi[2];
|
||||
/// DL Subband CQI index (from HLC feedback)
|
||||
uint8_t DL_subband_cqi[2][13];
|
||||
/// DL PMI Single Stream
|
||||
uint16_t DL_pmi_single;
|
||||
/// DL PMI Dual Stream
|
||||
uint16_t DL_pmi_dual;
|
||||
/// Current RI
|
||||
uint8_t rank;
|
||||
/// CRNTI of UE
|
||||
uint16_t crnti; ///user id (rnti) of connected UEs
|
||||
/// Initial timing offset estimate from PRACH for RAR
|
||||
int32_t UE_timing_offset;
|
||||
/// Timing advance estimate from PUSCH for MAC timing advance signalling
|
||||
int32_t timing_advance_update;
|
||||
/// Current mode of UE (NOT SYCHED, RAR, PUSCH)
|
||||
UE_MODE_NB_IoT_t mode;
|
||||
/// Current sector where UE is attached
|
||||
uint8_t sector;
|
||||
|
||||
/// dlsch l2 errors
|
||||
uint32_t dlsch_l2_errors[8];
|
||||
/// dlsch trials per harq and round
|
||||
uint32_t dlsch_trials[8][8];
|
||||
/// dlsch ACK/NACK per hard_pid and round
|
||||
uint32_t dlsch_ACK[8][8];
|
||||
uint32_t dlsch_NAK[8][8];
|
||||
|
||||
/// ulsch l2 errors per harq_pid
|
||||
uint32_t ulsch_errors[8];
|
||||
/// ulsch l2 consecutive errors per harq_pid
|
||||
uint32_t ulsch_consecutive_errors; //[8];
|
||||
/// ulsch trials/errors/fer per harq and round
|
||||
uint32_t nulsch_decoding_attempts[8][8];
|
||||
uint32_t ulsch_round_errors[8][8];
|
||||
uint32_t ulsch_decoding_attempts_last[8][8];
|
||||
uint32_t ulsch_round_errors_last[8][8];
|
||||
uint32_t ulsch_round_fer[8][8];
|
||||
uint32_t sr_received;
|
||||
uint32_t sr_total;
|
||||
|
||||
/// dlsch sliding count and total errors in round 0 are used to compute the dlsch_mcs_offset
|
||||
uint32_t dlsch_sliding_cnt;
|
||||
uint32_t dlsch_NAK_round0;
|
||||
int8_t dlsch_mcs_offset;
|
||||
|
||||
/// Target mcs1 after rate-adaptation (used by MAC layer scheduler)
|
||||
uint8_t dlsch_mcs1;
|
||||
/// Target mcs2 after rate-adaptation (used by MAC layer scheduler)
|
||||
uint8_t dlsch_mcs2;
|
||||
/// Total bits received from MAC on PDSCH
|
||||
int total_TBS_MAC;
|
||||
/// Total bits acknowledged on PDSCH
|
||||
int total_TBS;
|
||||
/// Total bits acknowledged on PDSCH (last interval)
|
||||
int total_TBS_last;
|
||||
/// Bitrate on the PDSCH [bps]
|
||||
unsigned int dlsch_bitrate;
|
||||
// unsigned int total_transmitted_bits;
|
||||
|
||||
} NB_IoT_eNB_UE_stats;
|
||||
|
||||
typedef struct {
|
||||
/// Indicator of first transmission
|
||||
uint8_t first_tx;
|
||||
/// Last Ndi received for this process on DCI (used for C-RNTI only)
|
||||
uint8_t DCINdi;
|
||||
/// DLSCH status flag indicating
|
||||
//SCH_status_t status;
|
||||
/// Transport block size
|
||||
uint32_t TBS;
|
||||
/// The payload + CRC size in bits
|
||||
uint32_t B;
|
||||
/// Pointer to the payload
|
||||
uint8_t *b;
|
||||
/// Pointers to transport block segments
|
||||
uint8_t *c[MAX_NUM_DLSCH_SEGMENTS_NB_IoT];
|
||||
/// RTC values for each segment (for definition see 36-212 V8.6 2009-03, p.15)
|
||||
uint32_t RTC[MAX_NUM_DLSCH_SEGMENTS_NB_IoT];
|
||||
/// Index of current HARQ round for this DLSCH
|
||||
uint8_t round;
|
||||
/// MCS format for this DLSCH
|
||||
uint8_t mcs;
|
||||
/// Qm (modulation order) for this DLSCH
|
||||
uint8_t Qm;
|
||||
/// Redundancy-version of the current sub-frame
|
||||
uint8_t rvidx;
|
||||
/// MIMO mode for this DLSCH
|
||||
// MIMO_mode_t mimo_mode;
|
||||
/// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
|
||||
int16_t w[MAX_NUM_DLSCH_SEGMENTS_NB_IoT][3*(6144+64)];
|
||||
/// for abstraction soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
|
||||
double w_abs[MAX_NUM_DLSCH_SEGMENTS_NB_IoT][3*(6144+64)];
|
||||
/// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
|
||||
int16_t *d[MAX_NUM_DLSCH_SEGMENTS_NB_IoT];
|
||||
/// Number of code segments (for definition see 36-212 V8.6 2009-03, p.9)
|
||||
uint32_t C;
|
||||
/// Number of "small" code segments (for definition see 36-212 V8.6 2009-03, p.10)
|
||||
uint32_t Cminus;
|
||||
/// Number of "large" code segments (for definition see 36-212 V8.6 2009-03, p.10)
|
||||
uint32_t Cplus;
|
||||
/// Number of bits in "small" code segments (<6144) (for definition see 36-212 V8.6 2009-03, p.10)
|
||||
uint32_t Kminus;
|
||||
/// Number of bits in "large" code segments (<6144) (for definition see 36-212 V8.6 2009-03, p.10)
|
||||
uint32_t Kplus;
|
||||
/// Number of "Filler" bits (for definition see 36-212 V8.6 2009-03, p.10)
|
||||
uint32_t F;
|
||||
/// Number of MIMO layers (streams) (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
uint8_t Nl;
|
||||
/// current delta_pucch
|
||||
int8_t delta_PUCCH;
|
||||
/// Number of soft channel bits
|
||||
uint32_t G;
|
||||
/// Current Number of RBs
|
||||
uint16_t nb_rb;
|
||||
/// Current subband PMI allocation
|
||||
uint16_t pmi_alloc;
|
||||
/// Current RB allocation (even slots)
|
||||
uint32_t rb_alloc_even[4];
|
||||
/// Current RB allocation (odd slots)
|
||||
uint32_t rb_alloc_odd[4];
|
||||
/// distributed/localized flag
|
||||
//vrb_t vrb_type;
|
||||
/// downlink power offset field
|
||||
uint8_t dl_power_off;
|
||||
/// trials per round statistics
|
||||
uint32_t trials[8];
|
||||
/// error statistics per round
|
||||
uint32_t errors[8];
|
||||
/// codeword this transport block is mapped to
|
||||
uint8_t codeword;
|
||||
|
||||
} NB_IoT_DL_UE_HARQ_t;
|
||||
|
||||
typedef struct {
|
||||
/// RNTI
|
||||
uint16_t rnti;
|
||||
/// Active flag for DLSCH demodulation
|
||||
uint8_t active;
|
||||
/// Transmission mode
|
||||
uint8_t mode1_flag;
|
||||
/// amplitude of PDSCH (compared to RS) in symbols without pilots
|
||||
int16_t sqrt_rho_a;
|
||||
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
|
||||
int16_t sqrt_rho_b;
|
||||
/// Current HARQ process id threadRx Odd and threadRx Even
|
||||
uint8_t current_harq_pid;
|
||||
/// Current subband antenna selection
|
||||
uint32_t antenna_alloc;
|
||||
/// Current subband RI allocation
|
||||
uint32_t ri_alloc;
|
||||
/// Current subband CQI1 allocation
|
||||
uint32_t cqi_alloc1;
|
||||
/// Current subband CQI2 allocation
|
||||
uint32_t cqi_alloc2;
|
||||
/// saved subband PMI allocation from last PUSCH/PUCCH report
|
||||
uint16_t pmi_alloc;
|
||||
/// HARQ-ACKs
|
||||
harq_status_NB_IoT_t harq_ack;
|
||||
/// Pointers to up to 8 HARQ processes
|
||||
NB_IoT_DL_UE_HARQ_t *harq_process;
|
||||
/// Maximum number of HARQ processes(for definition see 36-212 V8.6 2009-03, p.17
|
||||
uint8_t Mdlharq;
|
||||
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
uint8_t Kmimo;
|
||||
/// Nsoft parameter related to UE Category
|
||||
uint32_t Nsoft;
|
||||
/// Maximum number of Turbo iterations
|
||||
uint8_t max_turbo_iterations;
|
||||
/// number of iterations used in last turbo decoding
|
||||
uint8_t last_iteration_cnt;
|
||||
/// accumulated tx power adjustment for PUCCH
|
||||
int8_t g_pucch;
|
||||
|
||||
} NB_IoT_UE_DLSCH_t;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
// NB-IoT
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
||||
//enum for distinguish the different type of ndlsch (may in the future will be not needed)
|
||||
typedef enum
|
||||
{
|
||||
|
||||
SIB1,
|
||||
SI_Message,
|
||||
RAR,
|
||||
UE_Data
|
||||
|
||||
}ndlsch_flag_t;
|
||||
|
||||
|
||||
|
||||
typedef struct{
|
||||
|
||||
//Number of repetitions (R) for common search space (RAR and PAGING)
|
||||
uint16_t number_repetition_RA;
|
||||
uint16_t number_repetition_PAg;
|
||||
//index of the current subframe among the repetition (set to 0 when we receive the new NPDCCH)
|
||||
uint16_t repetition_idx_RA;
|
||||
uint16_t repetition_idx_Pag;
|
||||
|
||||
}NB_IoT_eNB_COMMON_NPDCCH_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
||||
/// Length of DCI in bits
|
||||
uint8_t dci_length;
|
||||
/// Aggregation level only 1,2 in NB-IoT
|
||||
uint8_t L;
|
||||
/// Position of first CCE of the dci
|
||||
int firstCCE;
|
||||
/// flag to indicate that this is a RA response
|
||||
boolean_t ra_flag;
|
||||
/// rnti
|
||||
rnti_t rnti;
|
||||
/// Format
|
||||
DCI_format_NB_IoT_t format;
|
||||
/// DCI pdu
|
||||
uint8_t dci_pdu[8];
|
||||
|
||||
} DCI_ALLOC_NB_IoT_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
//delete the count for the DCI numbers,NUM_DCI_MAX should set to 2
|
||||
uint32_t num_npdcch_symbols;
|
||||
///indicates the starting OFDM symbol in the first slot of a subframe k for the NPDCCH transmission
|
||||
/// see FAPI/NFAPI specs Table 4-45
|
||||
uint8_t npdcch_start_symbol;
|
||||
uint8_t Num_dci;
|
||||
DCI_ALLOC_NB_IoT_t dci_alloc[2] ;
|
||||
|
||||
} DCI_PDU_NB_IoT;
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
||||
/// Allocated RNTI (0 means DLSCH_t is not currently used)
|
||||
uint32_t rnti;
|
||||
/// Active flag for baseband transmitter processing
|
||||
uint8_t active;
|
||||
/// Active flag when msg2 is transmitted
|
||||
uint8_t active_msg2;
|
||||
/// Indicator of TX activation per subframe. Used during PUCCH detection for ACK/NAK.
|
||||
uint8_t subframe_tx[10];
|
||||
/// First CCE of last PDSCH scheduling per subframe. Again used during PUCCH detection for ACK/NAK.
|
||||
uint8_t nCCE[10];
|
||||
///in NB-IoT there is only 1 HARQ process for each UE therefore no pid is required///
|
||||
/// The only HARQ process for the DLSCH
|
||||
NB_IoT_DL_eNB_HARQ_t *harq_process;
|
||||
|
||||
// NB_IoT_DL_eNB_SIB1_t harq_process_sib1;
|
||||
|
||||
SCH_status_NB_IoT_t status;
|
||||
|
||||
///////////////////////////////////
|
||||
uint32_t rnti_type;
|
||||
uint32_t resource_assignment; // for NDLSCH // this value point to --> number of subframes needed
|
||||
uint32_t repetition_number;
|
||||
uint32_t modulation;
|
||||
uint32_t number_of_subframes_for_resource_assignment; // for NDLSCH //table 16.4.1.3-1 // TS 36.213
|
||||
|
||||
uint32_t counter_repetition_number;
|
||||
uint32_t counter_current_sf_repetition;
|
||||
uint32_t pointer_to_subframe;
|
||||
///////////////////////////////////
|
||||
uint32_t repetition_number_SIB1; //4 8 16
|
||||
uint32_t resource_assignment_SIB1; // always 8
|
||||
/// Number of soft channel bits
|
||||
uint32_t G;
|
||||
|
||||
///NB-IoT
|
||||
/// may use in the npdsch_procedures
|
||||
uint16_t scrambling_sequence_intialization;
|
||||
/// number of cell specific TX antenna ports assumed by the UE
|
||||
uint8_t nrs_antenna_ports;
|
||||
|
||||
//This indicate the current subframe within the subframe interval between the NPDSCH transmission (Nsf*Nrep)
|
||||
uint16_t sf_index;
|
||||
///indicates the starting OFDM symbol in the first slot of a subframe k for the NPDSCH transmission
|
||||
/// see FAPI/NFAPI specs Table 4-47
|
||||
uint8_t npdsch_start_symbol;
|
||||
///SIB1-NB related parameters//
|
||||
///flag for indicate if the current frame is the start of a new SIB1-NB repetition within the SIB1-NB period (0 = FALSE, 1 = TRUE)
|
||||
uint8_t sib1_rep_start;
|
||||
///the number of the frame within the 16 continuous frame in which sib1-NB is transmitted (1-8 = 1st, 2nd ecc..) (0 = not foresees a transmission)
|
||||
uint8_t relative_sib1_frame;
|
||||
//Flag used to discern among different NDLSCH structures (SIB1,SI,RA,UE-spec)
|
||||
//(used inside the ndlsch procedure for distinguish the different type of data to manage also in term of repetitions and transmission over more subframes
|
||||
ndlsch_flag_t ndlsch_type;
|
||||
|
||||
} NB_IoT_eNB_NDLSCH_t;
|
||||
|
||||
typedef struct {
|
||||
/// Length of CQI data under RI=1 assumption(bits)
|
||||
uint8_t Or1;
|
||||
/// Rank information
|
||||
uint8_t o_RI[2];
|
||||
/// Format of CQI data
|
||||
UCI_format_NB_IoT_t uci_format;
|
||||
/// The value of DAI in DCI format 0
|
||||
uint8_t V_UL_DAI;
|
||||
/// Pointer to CQI data
|
||||
uint8_t o[MAX_CQI_BYTES_NB_IoT];
|
||||
/// CQI CRC status
|
||||
uint8_t cqi_crc_status;
|
||||
/// PHICH active flag
|
||||
uint8_t phich_active;
|
||||
/// PHICH ACK
|
||||
uint8_t phich_ACK;
|
||||
/// Length of rank information (bits)
|
||||
uint8_t O_RI;
|
||||
/// First Allocated RB
|
||||
uint16_t first_rb;
|
||||
/// Current Number of RBs
|
||||
uint16_t nb_rb;
|
||||
|
||||
uint8_t new_data_indication;
|
||||
/// Determined the subcarrier spacing for NPUSCH (15 kHz or 3.75 KHz)
|
||||
uint8_t subcarrier_spacing; /////////////////////////TODO: to be set using msg2 PDU content
|
||||
/// Determined the subcarrier allocation for the NPUSCH.(15, 3.75 KHz)
|
||||
uint8_t subcarrier_indication;
|
||||
/// Determined the number of resource unit for the NPUSCH
|
||||
uint8_t resource_assignment;
|
||||
/// Determined the scheduling delay for NPUSCH
|
||||
uint8_t scheduling_delay;
|
||||
/// The number of the repetition number for NPUSCH Transport block
|
||||
uint8_t repetition_number;
|
||||
////////// counter for repetitions ///////////////////////
|
||||
uint8_t rep_tmp;
|
||||
/// Determined the repetition number value 0-3
|
||||
uint8_t dci_subframe_repetitions;
|
||||
/// Flag indicating that this ULSCH has been allocated by a DCI (otherwise it is a retransmission based on PHICH NAK)
|
||||
uint8_t dci_alloc;
|
||||
/// Flag indicating that this ULSCH has been allocated by a RAR (otherwise it is a retransmission based on PHICH NAK or DCI)
|
||||
uint8_t rar_alloc;
|
||||
/// Status Flag indicating for this ULSCH (idle,active,disabled)
|
||||
SCH_status_NB_IoT_t status;
|
||||
/// Subframe scheduling indicator (i.e. Transmission opportunity indicator)
|
||||
uint8_t subframe_scheduling_flag;
|
||||
/// Transport block size
|
||||
uint32_t TBS;
|
||||
/// The payload + CRC size in bits
|
||||
uint32_t B;
|
||||
/// Number of soft channel bits
|
||||
uint32_t G;
|
||||
/// Pointer to ACK
|
||||
uint8_t o_ACK[4];
|
||||
/// Length of ACK information (bits)
|
||||
uint8_t O_ACK;
|
||||
/// coded ACK bits
|
||||
int16_t q_ACK[MAX_ACK_PAYLOAD_NB_IoT];
|
||||
/// Number of code segments (for definition see 36-212 V8.6 2009-03, p.9)
|
||||
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
|
||||
int16_t e[MAX_NUM_CHANNEL_BITS_NB_IoT] __attribute__((aligned(32)));
|
||||
/// coded RI bits
|
||||
int16_t q_RI[MAX_RI_PAYLOAD_NB_IoT];
|
||||
/// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27)
|
||||
int8_t q[MAX_CQI_PAYLOAD_NB_IoT];
|
||||
/// number of coded CQI bits after interleaving
|
||||
uint8_t o_RCC;
|
||||
/// coded and interleaved CQI bits
|
||||
int8_t o_w[(MAX_CQI_BITS_NB_IoT+8)*3];
|
||||
/// coded CQI bits
|
||||
int8_t o_d[96+((MAX_CQI_BITS_NB_IoT+8)*3)];
|
||||
/// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
|
||||
int16_t w[MAX_NUM_ULSCH_SEGMENTS_NB_IoT][3*(6144+64)];
|
||||
/// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
|
||||
int16_t *d[MAX_NUM_ULSCH_SEGMENTS_NB_IoT];
|
||||
///
|
||||
uint32_t C;
|
||||
/// Number of "small" code segments (for definition see 36-212 V8.6 2009-03, p.10)
|
||||
uint32_t Cminus;
|
||||
/// Number of "large" code segments (for definition see 36-212 V8.6 2009-03, p.10)
|
||||
uint32_t Cplus;
|
||||
/// Number of bits in "small" code segments (<6144) (for definition see 36-212 V8.6 2009-03, p.10)
|
||||
uint32_t Kminus;
|
||||
/// Number of bits in "large" code segments (<6144) (for definition see 36-212 V8.6 2009-03, p.10)
|
||||
uint32_t Kplus;
|
||||
/// Number of "Filler" bits (for definition see 36-212 V8.6 2009-03, p.10)
|
||||
uint32_t F;
|
||||
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
|
||||
//uint8_t h[MAX_NUM_CHANNEL_BITS];
|
||||
/// SRS active flag
|
||||
uint8_t srs_active;
|
||||
/// Pointer to the payload
|
||||
uint8_t *b;
|
||||
/// Pointers to transport block segments
|
||||
uint8_t *c[MAX_NUM_ULSCH_SEGMENTS_NB_IoT];
|
||||
/// RTC values for each segment (for definition see 36-212 V8.6 2009-03, p.15)
|
||||
uint32_t RTC[MAX_NUM_ULSCH_SEGMENTS_NB_IoT];
|
||||
/// Current Number of Symbols
|
||||
uint8_t Nsymb_pusch;
|
||||
/// Index of current HARQ round for this ULSCH
|
||||
uint8_t round;
|
||||
/// MCS format for this ULSCH
|
||||
uint8_t mcs;
|
||||
/// Redundancy-version of the current sub-frame (value 0->RV0,value 1 ->RV2)
|
||||
uint8_t rvidx;
|
||||
/// Msc_initial, Initial number of subcarriers for ULSCH (36-212, v8.6 2009-03, p.26-27)
|
||||
uint16_t Msc_initial;
|
||||
/// Nsymb_initial, Initial number of symbols for ULSCH (36-212, v8.6 2009-03, p.26-27)
|
||||
uint8_t Nsymb_initial;
|
||||
/// n_DMRS for cyclic shift of DMRS (36.213 Table 9.1.2-2)
|
||||
uint8_t n_DMRS;
|
||||
/// n_DMRS for cyclic shift of DMRS (36.213 Table 9.1.2-2) - previous scheduling
|
||||
/// This is needed for PHICH generation which
|
||||
/// is done after a new scheduling
|
||||
uint8_t previous_n_DMRS;
|
||||
/// n_DMRS 2 for cyclic shift of DMRS (36.211 Table 5.5.1.1.-1)
|
||||
uint8_t n_DMRS2;
|
||||
/// Flag to indicate that this ULSCH is for calibration information sent from UE (i.e. no MAC SDU to pass up)
|
||||
// int calibration_flag;
|
||||
/// delta_TF for power control
|
||||
int32_t delta_TF;
|
||||
///////////////////////////////////////////// 4 parameter added by vincent ///////////////////////////////////////////////
|
||||
// NB_IoT: Nsymb_UL and Nslot_UL are defined in 36.211, Section 10.1.2.3, Table 10.1.2.3-1
|
||||
// The number of symbol in a resource unit is given by Nsymb_UL*Nslot_UL
|
||||
uint8_t Nsymb_UL;
|
||||
// Number of NPUSCH slots
|
||||
uint8_t Nslot_UL;
|
||||
// Number of subcarrier for NPUSH, can be 1, 3, 6, 12
|
||||
uint8_t N_sc_RU;
|
||||
// Index of UL NB_IoT resource block
|
||||
uint32_t UL_RB_ID_NB_IoT;
|
||||
// Subcarrier indication fields, obtained through DCI, Section 16.5.1.1 in 36.213
|
||||
uint16_t I_sc;
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
} NB_IoT_UL_eNB_HARQ_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// Pointers to the HARQ processes for the NULSCH
|
||||
NB_IoT_UL_eNB_HARQ_t *harq_process;
|
||||
/// Maximum number of HARQ rounds
|
||||
uint8_t Mlimit;
|
||||
/// Value 0 = npush format 1 (data) value 1 = npusch format 2 (ACK/NAK)
|
||||
uint8_t npusch_format;
|
||||
/// Flag to indicate that eNB awaits UE Msg3
|
||||
uint8_t Msg3_active;
|
||||
/// Flag to indicate that eNB should decode UE Msg3
|
||||
uint8_t Msg3_flag;
|
||||
/// Subframe for Msg3
|
||||
uint32_t Msg3_subframe;
|
||||
/// Frame for Msg3
|
||||
uint32_t Msg3_frame;
|
||||
/// RNTI attributed to this ULSCH
|
||||
uint16_t rnti;
|
||||
/// cyclic shift for DM RS
|
||||
uint8_t cyclicShift;
|
||||
/// cooperation flag
|
||||
uint8_t cooperation_flag;
|
||||
/// (only in-band mode), indicate the resource block overlap the SRS configuration of LTE
|
||||
uint8_t N_srs;
|
||||
///
|
||||
uint8_t scrambling_re_intialization_batch_index;
|
||||
/// number of cell specific TX antenna ports assumed by the UE
|
||||
uint8_t nrs_antenna_ports;
|
||||
//////// nfapi param //////////////////////////////////////////
|
||||
uint16_t C_init;
|
||||
//////// nfapi param //////////////////////////////////////////////////
|
||||
uint16_t SF_idx;
|
||||
/// Determined the ACK/NACK delay and the subcarrier allocation TS 36.213 Table 16.4.2
|
||||
uint8_t HARQ_ACK_resource;
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
/// Flag to trigger the storage of values
|
||||
uint8_t flag_vars;
|
||||
uint16_t counter_sf;
|
||||
uint16_t counter_repetitions;
|
||||
// uint16_t sf_number;
|
||||
// uint16_t rep_number;
|
||||
///////////// kept from LTE ///////////////////////////////////////////////////
|
||||
|
||||
/// Maximum number of iterations used in eNB turbo decoder
|
||||
uint8_t max_turbo_iterations;
|
||||
/// ACK/NAK Bundling flag
|
||||
uint8_t bundling;
|
||||
/// beta_offset_cqi times 8
|
||||
uint16_t beta_offset_cqi_times8;
|
||||
/// beta_offset_ri times 8
|
||||
uint16_t beta_offset_ri_times8;
|
||||
/// beta_offset_harqack times 8
|
||||
uint16_t beta_offset_harqack_times8;
|
||||
/// num active cba group
|
||||
uint8_t num_active_cba_groups;
|
||||
/// allocated CBA RNTI for this ulsch
|
||||
uint16_t cba_rnti[4];//NUM_MAX_CBA_GROUP];
|
||||
#ifdef LOCALIZATION
|
||||
/// epoch timestamp in millisecond
|
||||
int32_t reference_timestamp_ms;
|
||||
/// aggregate physical states every n millisecond
|
||||
int32_t aggregation_period_ms;
|
||||
/// a set of lists used for localization
|
||||
struct list loc_rss_list[10], loc_rssi_list[10], loc_subcarrier_rss_list[10], loc_timing_advance_list[10], loc_timing_update_list[10];
|
||||
struct list tot_loc_rss_list, tot_loc_rssi_list, tot_loc_subcarrier_rss_list, tot_loc_timing_advance_list, tot_loc_timing_update_list;
|
||||
#endif
|
||||
|
||||
} NB_IoT_eNB_NULSCH_t;
|
||||
|
||||
#define NPBCH_A 34
|
||||
|
||||
typedef struct {
|
||||
//the 2 LSB of the hsfn (the MSB are indicated by the SIB1-NB)
|
||||
uint16_t h_sfn_lsb;
|
||||
|
||||
uint8_t npbch_d[96+(3*(16+NPBCH_A))];
|
||||
uint8_t npbch_w[3*3*(16+NPBCH_A)];
|
||||
uint8_t npbch_e[1600];
|
||||
///pdu of the npbch message
|
||||
uint8_t *pdu;
|
||||
|
||||
} NB_IoT_eNB_NPBCH_t;
|
||||
|
||||
#define NPDCCH_A 23
|
||||
#define MAX_BITS_IN_SF 284 // maximum number of bits over one subframe
|
||||
|
||||
typedef struct {
|
||||
//the 2 LSB of the hsfn (the MSB are indicated by the SIB1-NB)
|
||||
rnti_t rnti[2];
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
/// Active flag for baseband transmitter processing
|
||||
uint8_t A[2]; // DCI length in bits
|
||||
|
||||
uint8_t active[2];
|
||||
|
||||
uint8_t modulation[2];
|
||||
|
||||
uint32_t length[2];
|
||||
uint32_t ncce_index[2];
|
||||
uint32_t aggregation_level[2];
|
||||
uint32_t rnti_type[2];
|
||||
uint32_t dci_format[2];
|
||||
uint32_t scheduling_delay[2];
|
||||
uint32_t resource_assignment[2];
|
||||
// uint32_t repetition_number[2];
|
||||
uint32_t mcs[2];
|
||||
uint32_t TBS[2];
|
||||
uint32_t new_data_indicator[2];
|
||||
uint32_t harq_ack_resource[2];
|
||||
uint32_t npdcch_order_indication[2];
|
||||
uint32_t dci_subframe_repetition_number[2];
|
||||
////////////////////////////////////////////////////////
|
||||
//UE specific parameters
|
||||
uint16_t dci_repetitions[2];
|
||||
uint16_t npdcch_NumRepetitions[2];
|
||||
|
||||
uint16_t repetition_number[2];
|
||||
//indicate the corresponding subframe within the repetition (set to 0 when a new NPDCCH pdu is received)
|
||||
uint16_t repetition_idx[2];
|
||||
|
||||
//////////////////////////////////////
|
||||
uint32_t counter_repetition_number[2];
|
||||
// uint32_t counter_current_sf_repetition[2];
|
||||
// uint32_t pointer_to_subframe[2];
|
||||
//////////////////////////////////////
|
||||
uint16_t h_sfn_lsb;
|
||||
|
||||
uint8_t npdcch_d[2][96+(3*(16+NPDCCH_A))];
|
||||
uint8_t npdcch_w[2][3*3*(16+NPDCCH_A)];
|
||||
uint8_t npdcch_e[2][MAX_BITS_IN_SF];
|
||||
///pdu of the npbch message
|
||||
uint8_t *pdu[2];
|
||||
|
||||
} NB_IoT_eNB_NPDCCH_t;
|
||||
|
||||
|
||||
#endif
|
||||
@@ -234,6 +234,136 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
|
||||
|
||||
}
|
||||
/*
|
||||
NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(//unsigned char Kmimo,
|
||||
//unsigned char Mdlharq,
|
||||
uint32_t Nsoft,
|
||||
//unsigned char N_RB_DL,
|
||||
uint8_t abstraction_flag,
|
||||
NB_IoT_DL_FRAME_PARMS* frame_parms)
|
||||
{
|
||||
|
||||
NB_IoT_eNB_NDLSCH_t *dlsch;
|
||||
unsigned char exit_flag = 0,i,j,r,aa,layer;
|
||||
int re;
|
||||
unsigned char bw_scaling =1;
|
||||
|
||||
// switch (N_RB_DL) {
|
||||
// case 6:
|
||||
// bw_scaling =16;
|
||||
// break;
|
||||
//
|
||||
// case 25:
|
||||
// bw_scaling =4;
|
||||
// break;
|
||||
//
|
||||
// case 50:
|
||||
// bw_scaling =2;
|
||||
// break;
|
||||
//
|
||||
// default:
|
||||
// bw_scaling =1;
|
||||
// break;
|
||||
// }
|
||||
|
||||
dlsch = (NB_IoT_eNB_NDLSCH_t *)malloc16(sizeof(NB_IoT_eNB_NDLSCH_t));
|
||||
|
||||
if (dlsch) {
|
||||
bzero(dlsch,sizeof(NB_IoT_eNB_NDLSCH_t));
|
||||
|
||||
dlsch->Mlimit = 4;//max number of retransmission
|
||||
dlsch->Nsoft = Nsoft;
|
||||
|
||||
for (layer=0; layer<4; layer++) {
|
||||
dlsch->ue_spec_bf_weights[layer] = (int32_t**)malloc16(frame_parms->nb_antennas_tx*sizeof(int32_t*));
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
|
||||
for (re=0;re<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; re++) {
|
||||
dlsch->ue_spec_bf_weights[layer][aa][re] = 0x00007fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dlsch->calib_dl_ch_estimates = (int32_t**)malloc16(frame_parms->nb_antennas_tx*sizeof(int32_t*));
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//In NB-IoT we have only 1 HARQ process for each User-------------
|
||||
|
||||
dlsch->harq_process = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
|
||||
LOG_T(PHY, "[NB-IoT] Required mem size %d (bw scaling %d), dlsch->harq_process %p\n",
|
||||
MAX_DLSCH_PAYLOAD_BYTES/bw_scaling,bw_scaling,dlsch->harq_process);
|
||||
|
||||
if (dlsch->harq_process) {
|
||||
bzero(dlsch->harq_process,sizeof(LTE_DL_eNB_HARQ_t));
|
||||
// dlsch->harq_processes[i]->first_tx=1;
|
||||
dlsch->harq_process->b = (unsigned char*)malloc16(MAX_DLSCH_PAYLOAD_BYTES/bw_scaling);
|
||||
|
||||
if (dlsch->harq_process->b) {
|
||||
bzero(dlsch->harq_process->b,MAX_DLSCH_PAYLOAD_BYTES/bw_scaling);
|
||||
} else {
|
||||
printf("Can't get b\n");
|
||||
exit_flag=1;
|
||||
}
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
|
||||
//XXX MAX_NUM_DLSCH_SEGMENTS may should be changed for NB-IoT
|
||||
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS/bw_scaling; r++) {
|
||||
// account for filler in first segment and CRCs for multiple segment case
|
||||
dlsch->harq_process->c[r] = (uint8_t*)malloc16(((r==0)?8:0) + 3+ 768);
|
||||
dlsch->harq_process->d[r] = (uint8_t*)malloc16((96+12+3+(3*6144)));
|
||||
if (dlsch->harq_process->c[r]) {
|
||||
bzero(dlsch->harq_process->c[r],((r==0)?8:0) + 3+ 768);
|
||||
} else {
|
||||
printf("Can't get c\n");
|
||||
exit_flag=2;
|
||||
}
|
||||
if (dlsch->harq_process->d[r]) {
|
||||
bzero(dlsch->harq_process->d[r],(96+12+3+(3*6144)));
|
||||
} else {
|
||||
printf("Can't get d\n");
|
||||
exit_flag=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
printf("Can't get harq_p %d\n",i);
|
||||
exit_flag=3;
|
||||
}
|
||||
//---------------------------------------------
|
||||
|
||||
if (exit_flag==0) {
|
||||
|
||||
dlsch->harq_process->round=0;
|
||||
|
||||
for (j=0; j<96; j++)
|
||||
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS/bw_scaling; r++) {
|
||||
// printf("dlsch->harq_processes[%d]->d[%d] %p\n",i,r,dlsch->harq_processes[i]->d[r]);
|
||||
if (dlsch->harq_process->d[r])
|
||||
dlsch->harq_process->d[r][j] = LTE_NULL;
|
||||
}
|
||||
return(dlsch);
|
||||
}
|
||||
}
|
||||
|
||||
// memory allocation failed for ndlsch
|
||||
|
||||
LOG_D(PHY,"new_eNB_ndlsch exit flag %d, size of %ld\n",
|
||||
exit_flag, sizeof(LTE_eNB_DLSCH_t));
|
||||
free_eNB_dlsch(dlsch);
|
||||
return(NULL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
{
|
||||
@@ -265,7 +395,7 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
int dlsch_encoding_2threads0(te_params *tep) {
|
||||
|
||||
LTE_eNB_DLSCH_t *dlsch = tep->dlsch;
|
||||
@@ -556,9 +686,10 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
|
||||
return(0);
|
||||
}
|
||||
*/
|
||||
|
||||
int dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
unsigned char *a,
|
||||
unsigned char *a,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch,
|
||||
int frame,
|
||||
|
||||
315
openair1/PHY/LTE_TRANSPORT/dlsch_coding_NB_IoT.c
Normal file
315
openair1/PHY/LTE_TRANSPORT/dlsch_coding_NB_IoT.c
Normal file
@@ -0,0 +1,315 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/dlsch_coding_NB_IoT.c
|
||||
* \brief Top-level routines for implementing Tail-biting convolutional coding for transport channels (NPDSCH) for NB_IoT, TS 36-212, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include <string.h>
|
||||
//#include "PHY/impl_defs_lte.h"
|
||||
//#include "openair2/COMMON/openair_defs.h"
|
||||
#include "PHY/defs.h"
|
||||
//#include "PHY/extern_NB_IoT.h"
|
||||
#include "PHY/CODING/defs_NB_IoT.h"
|
||||
//#include "PHY/CODING/extern.h"
|
||||
//#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
|
||||
#include "PHY/LTE_TRANSPORT/proto.h"
|
||||
//#include "SCHED/defs_NB_IoT.h"
|
||||
//#include "defs_nb_iot.h"
|
||||
//#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/TOOLS/time_meas_NB_IoT.h"
|
||||
|
||||
unsigned char ccodelte_table2_NB_IoT[128];
|
||||
unsigned short glte2_NB_IoT[] = { 0133, 0171, 0165 };
|
||||
|
||||
|
||||
void free_eNB_dlsch_NB_IoT(NB_IoT_eNB_NDLSCH_t *dlsch)
|
||||
{
|
||||
|
||||
if (dlsch) {
|
||||
/*
|
||||
#ifdef DEBUG_DLSCH_FREE
|
||||
printf("Freeing dlsch %p\n",dlsch);
|
||||
#endif*/
|
||||
|
||||
|
||||
if (dlsch->harq_process) {
|
||||
|
||||
|
||||
if (dlsch->harq_process->b) {
|
||||
free16(dlsch->harq_process->b,300);
|
||||
dlsch->harq_process->b = NULL;
|
||||
|
||||
}
|
||||
|
||||
if (dlsch->harq_process->d) {
|
||||
free16(dlsch->harq_process->d,96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT)));
|
||||
// dlsch->harq_process->d = NULL;
|
||||
}
|
||||
|
||||
|
||||
free16(dlsch->harq_process,sizeof(NB_IoT_DL_eNB_HARQ_t));
|
||||
dlsch->harq_process = NULL;
|
||||
}
|
||||
|
||||
|
||||
free16(dlsch,sizeof(NB_IoT_eNB_NDLSCH_t));
|
||||
dlsch = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void free_eNB_dlcch_NB_IoT(NB_IoT_eNB_NPDCCH_t *dlcch)
|
||||
{
|
||||
|
||||
if (dlcch) {
|
||||
|
||||
|
||||
|
||||
free16(dlcch,sizeof(NB_IoT_eNB_NPDCCH_t));
|
||||
dlcch = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ccode_encode_npdsch_NB_IoT (int32_t numbits,
|
||||
uint8_t *inPtr,
|
||||
uint8_t *outPtr,
|
||||
uint32_t crc)
|
||||
{
|
||||
uint32_t state;
|
||||
uint8_t c, out, first_bit;
|
||||
int8_t shiftbit = 0;
|
||||
/* The input bit is shifted in position 8 of the state.
|
||||
Shiftbit will take values between 1 and 8 */
|
||||
state = 0;
|
||||
first_bit = 2;
|
||||
c = ((uint8_t*)&crc)[0];
|
||||
// Perform Tail-biting
|
||||
// get bits from last byte of input (or crc)
|
||||
for (shiftbit = 0 ; shiftbit <(8-first_bit) ; shiftbit++) {
|
||||
if ((c&(1<<(7-first_bit-shiftbit))) != 0)
|
||||
state |= (1<<shiftbit);
|
||||
}
|
||||
state = state & 0x3f; // true initial state of Tail-biting CCode
|
||||
state<<=1; // because of loop structure in CCode
|
||||
while (numbits > 0) { // Tail-biting is applied to input bits , input 34 bits , output 102 bits
|
||||
c = *inPtr++;
|
||||
for (shiftbit = 7; (shiftbit>=0) && (numbits>0); shiftbit--,numbits--) {
|
||||
state >>= 1;
|
||||
if ((c&(1<<shiftbit)) != 0) {
|
||||
state |= 64;
|
||||
}
|
||||
out = ccodelte_table2_NB_IoT[state];
|
||||
|
||||
*outPtr++ = out & 1;
|
||||
*outPtr++ = (out>>1)&1;
|
||||
*outPtr++ = (out>>2)&1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int dlsch_encoding_NB_IoT(unsigned char *a,
|
||||
NB_IoT_eNB_NDLSCH_t *dlsch, //NB_IoT_eNB_NDLSCH_t
|
||||
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
|
||||
unsigned int G) // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)
|
||||
{
|
||||
//printf("Get into dlsch_encoding_NB_IoT() ***********************************\n");
|
||||
uint32_t crc = 1;
|
||||
//unsigned char harq_pid = dlsch->current_harq_pid; // to check during implementation if harq_pid is required in the NB_IoT_eNB_DLSCH_t structure in defs_NB_IoT.h
|
||||
//uint8_t option1,option2,option3,option4;
|
||||
unsigned int A=0;
|
||||
A = dlsch->harq_process->TBS / 8;
|
||||
|
||||
uint8_t RCC;
|
||||
|
||||
uint8_t npbch_a[A];
|
||||
uint8_t npbch_a_crc[A+3];
|
||||
bzero(npbch_a,A);
|
||||
bzero(npbch_a_crc,A+3);
|
||||
|
||||
dlsch->harq_process->length_e = G*Nsf; // G*Nsf (number_of_subframes) = total number of bits to transmit G=236
|
||||
|
||||
|
||||
for (int i=0; i<A; i++)
|
||||
{
|
||||
npbch_a[i] = a[i];
|
||||
}
|
||||
|
||||
int32_t numbits = (A*8)+24;
|
||||
|
||||
crc = crc24a_NB_IoT(npbch_a,A*8)>>8;
|
||||
|
||||
|
||||
for (int j=0; j<A; j++)
|
||||
{
|
||||
npbch_a_crc[j] = npbch_a[j];
|
||||
}
|
||||
|
||||
npbch_a_crc[A] = ((uint8_t*)&crc)[2];
|
||||
npbch_a_crc[A+1] = ((uint8_t*)&crc)[1];
|
||||
npbch_a_crc[A+2] = ((uint8_t*)&crc)[0];
|
||||
|
||||
dlsch->harq_process->B = numbits; // The length of table b in bits
|
||||
//memcpy(dlsch->b,a,numbits/8); // comment if option 2
|
||||
memset(dlsch->harq_process->d,LTE_NULL_NB_IoT,96);
|
||||
ccode_encode_npdsch_NB_IoT(numbits,npbch_a_crc,dlsch->harq_process->d+96,crc);
|
||||
RCC = sub_block_interleaving_cc_NB_IoT(numbits,dlsch->harq_process->d+96,dlsch->harq_process->w); // step 2 interleaving
|
||||
lte_rate_matching_cc_NB_IoT(RCC,dlsch->harq_process->length_e,dlsch->harq_process->w,dlsch->harq_process->e); // step 3 Rate Matching
|
||||
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(uint8_t type, LTE_DL_FRAME_PARMS* frame_parms)
|
||||
{
|
||||
|
||||
NB_IoT_eNB_NDLSCH_t *dlsch;
|
||||
unsigned char exit_flag = 0;
|
||||
|
||||
dlsch = (NB_IoT_eNB_NDLSCH_t *)malloc16(sizeof(NB_IoT_eNB_NDLSCH_t));
|
||||
|
||||
if (dlsch) {
|
||||
|
||||
bzero(dlsch,sizeof(NB_IoT_eNB_NDLSCH_t));
|
||||
|
||||
dlsch->harq_process = (NB_IoT_DL_eNB_HARQ_t *)malloc16(sizeof(NB_IoT_DL_eNB_HARQ_t));
|
||||
|
||||
if (dlsch->harq_process) {
|
||||
bzero(dlsch->harq_process,sizeof(NB_IoT_DL_eNB_HARQ_t));
|
||||
// dlsch->harq_processes[i]->first_tx=1;
|
||||
dlsch->harq_process->b = (unsigned char*)malloc(300); // to set a new one that replace 300 , MAX_DLSCH_PAYLOAD_BYTES/bw_scaling
|
||||
|
||||
if (dlsch->harq_process->b) {
|
||||
bzero(dlsch->harq_process->b,300);
|
||||
} else {
|
||||
printf("Can't get b\n");
|
||||
exit_flag=1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (dlsch->harq_process->d) {
|
||||
bzero((void *)dlsch->harq_process->d,96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT)));
|
||||
|
||||
} else {
|
||||
printf("Can't get d\n");
|
||||
exit_flag=2;
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
} else {
|
||||
|
||||
exit_flag=3;
|
||||
}
|
||||
|
||||
|
||||
if (exit_flag==0) {
|
||||
|
||||
dlsch->harq_process->round=0;
|
||||
|
||||
// for (r=0; r<(96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))); r++) {
|
||||
//
|
||||
// if (dlsch->harq_process->d)
|
||||
// dlsch->harq_process->d[0]= LTE_NULL_NB_IoT;
|
||||
// }
|
||||
|
||||
return(dlsch);
|
||||
}
|
||||
}
|
||||
|
||||
/// LOG_D(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n",
|
||||
// exit_flag, sizeof(NB_IoT_eNB_NDLSCH_t));
|
||||
free_eNB_dlsch_NB_IoT(dlsch);
|
||||
return(NULL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
NB_IoT_eNB_NPDCCH_t *new_eNB_dlcch_NB_IoT(LTE_DL_FRAME_PARMS* frame_parms)
|
||||
{
|
||||
|
||||
NB_IoT_eNB_NPDCCH_t *dlcch;
|
||||
|
||||
dlcch = (NB_IoT_eNB_NPDCCH_t *)malloc16(sizeof(NB_IoT_eNB_NPDCCH_t));
|
||||
|
||||
if (dlcch) {
|
||||
|
||||
bzero(dlcch,sizeof(NB_IoT_eNB_NPDCCH_t));
|
||||
|
||||
|
||||
|
||||
return(dlcch);
|
||||
|
||||
}
|
||||
|
||||
/// LOG_D(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n",
|
||||
// exit_flag, sizeof(NB_IoT_eNB_NDLSCH_t));
|
||||
free_eNB_dlcch_NB_IoT(dlcch);
|
||||
return(NULL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
||||
Functions to initialize the code tables
|
||||
|
||||
*************************************************************************/
|
||||
/* Basic code table initialization for constraint length 7 */
|
||||
|
||||
/* Input in MSB, followed by state in 6 LSBs */
|
||||
void ccodelte_init2_NB_IoT(void)
|
||||
{
|
||||
unsigned int i, j, k, sum;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
|
||||
ccodelte_table2_NB_IoT[i] = 0;
|
||||
|
||||
/* Compute 3 output bits */
|
||||
for (j = 0; j < 3; j++) {
|
||||
sum = 0;
|
||||
|
||||
for (k = 0; k < 7; k++)
|
||||
if ((i & glte2_NB_IoT[j]) & (1 << k))
|
||||
sum++;
|
||||
|
||||
/* Write the sum modulo 2 in bit j */
|
||||
ccodelte_table2_NB_IoT[i] |= (sum & 1) << j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6190
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation_NB_IoT.c
Normal file
6190
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation_NB_IoT.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -643,7 +643,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t *rxF = (uint32_t*)&rxdataF_comp[0][((int32_t)symbol*frame_parms->N_RB_DL*12)];
|
||||
uint32_t *llr32;
|
||||
int i,len;
|
||||
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
|
||||
uint8_t symbol_mod = (symbol >= 7)? (symbol-7) : symbol;
|
||||
|
||||
if (first_symbol_flag==1) {
|
||||
llr32 = (uint32_t*)dlsch_llr;
|
||||
@@ -657,17 +657,26 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
|
||||
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
|
||||
if (frame_parms->mode1_flag==0)
|
||||
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
||||
else
|
||||
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
|
||||
} else if((beamforming_mode==7) && (frame_parms->Ncp==0) && (symbol==3 || symbol==6 || symbol==9 || symbol==12)){
|
||||
len = (nb_rb*9) - (3*pbch_pss_sss_adjust/4);
|
||||
} else if((beamforming_mode==7) && (frame_parms->Ncp==1) && (symbol==4 || symbol==7 || symbol==10)){
|
||||
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
||||
// if (symbol_mod==0 || symbol_mod==4) {
|
||||
// if (frame_parms->mode1_flag==0)
|
||||
// len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
||||
// else
|
||||
// len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
|
||||
// } else if((beamforming_mode==7) && (frame_parms->Ncp==0) && (symbol==3 || symbol==6 || symbol==9 || symbol==12)){
|
||||
// len = (nb_rb*9) - (3*pbch_pss_sss_adjust/4);
|
||||
// } else if((beamforming_mode==7) && (frame_parms->Ncp==1) && (symbol==4 || symbol==7 || symbol==10)){
|
||||
// len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
||||
// } else {
|
||||
// len = (nb_rb*12) - pbch_pss_sss_adjust;
|
||||
// }
|
||||
|
||||
if (symbol_mod==0 || symbol_mod==4 || symbol_mod==5 || symbol_mod==6) {
|
||||
if (frame_parms->mode1_flag==0) // MIMO
|
||||
len = 8 ;
|
||||
else // SISO
|
||||
len = 10;
|
||||
} else {
|
||||
len = (nb_rb*12) - pbch_pss_sss_adjust;
|
||||
len = nb_rb*12;
|
||||
}
|
||||
|
||||
|
||||
|
||||
198
openair1/PHY/LTE_TRANSPORT/dlsch_modulation_NB_IoT.c
Normal file
198
openair1/PHY/LTE_TRANSPORT/dlsch_modulation_NB_IoT.c
Normal file
@@ -0,0 +1,198 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/dlsch_modulation_NB_IoT.c
|
||||
* \brief Top-level routines for generating the NPDSCH physical channel for NB_IoT,
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include <math.h>
|
||||
//#include "PHY/defs.h"
|
||||
//#include "PHY/defs_NB_IoT.h"
|
||||
//#include "PHY/extern_NB_IoT.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
//#include "PHY/CODING/defs_nb_iot.h"
|
||||
//#include "PHY/CODING/extern.h"
|
||||
//#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
|
||||
#include "PHY/LTE_TRANSPORT/proto_NB_IoT.h"
|
||||
#include "PHY/impl_defs_lte_NB_IoT.h"
|
||||
#include "PHY/impl_defs_top_NB_IoT.h"
|
||||
//#include "defs.h"
|
||||
//#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
int allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
uint32_t symbol_offset,
|
||||
uint8_t *x0,
|
||||
uint8_t pilots,
|
||||
int16_t amp,
|
||||
unsigned short id_offset,
|
||||
uint8_t pilot_shift,
|
||||
uint32_t *re_allocated) // not used variable ??!!
|
||||
{
|
||||
MIMO_mode_t mimo_mode = (frame_parms->mode1_flag==1)? SISO:ALAMOUTI;
|
||||
|
||||
uint32_t tti_offset,aa;
|
||||
uint8_t re;
|
||||
int16_t gain_lin_QPSK;
|
||||
uint8_t first_re,last_re;
|
||||
int32_t tmp_sample1,tmp_sample2;
|
||||
|
||||
gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
first_re = 0;
|
||||
last_re = 12;
|
||||
|
||||
for (re=first_re; re<last_re; re++) { // re varies between 0 and 12 sub-carriers
|
||||
|
||||
tti_offset = symbol_offset + re; // symbol_offset = 512 * L , re_offset = 512 - 3*12 , re
|
||||
|
||||
if (pilots != 1 || (re%6 != ((id_offset + 3*pilot_shift) % 6) ) ) // if re is not a pilot
|
||||
{
|
||||
|
||||
if (mimo_mode == SISO) { //SISO mapping
|
||||
*re_allocated = *re_allocated + 1; // variable incremented but never used
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
((int16_t*)&txdataF[aa][tti_offset])[0] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
|
||||
}
|
||||
*jj = *jj + 1;
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
((int16_t*)&txdataF[aa][tti_offset])[1] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //Q //b_{i+1}
|
||||
}
|
||||
*jj = *jj + 1;
|
||||
|
||||
} else if (mimo_mode == ALAMOUTI) {
|
||||
|
||||
*re_allocated = *re_allocated + 1;
|
||||
|
||||
((int16_t*)&tmp_sample1)[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
((int16_t*)&tmp_sample1)[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
|
||||
// second antenna position n -> -x1*
|
||||
|
||||
((int16_t*)&tmp_sample2)[0] = (x0[*jj]==1) ? (gain_lin_QPSK) : -gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
((int16_t*)&tmp_sample2)[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
|
||||
// normalization for 2 tx antennas
|
||||
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
|
||||
// fill in the rest of the ALAMOUTI precoding
|
||||
if ( pilots != 1 || (re+1)%3 != id_offset) {
|
||||
((int16_t *)&txdataF[0][tti_offset+1])[0] += -((int16_t *)&txdataF[1][tti_offset])[0]; //x1
|
||||
((int16_t *)&txdataF[0][tti_offset+1])[1] += ((int16_t *)&txdataF[1][tti_offset])[1];
|
||||
((int16_t *)&txdataF[1][tti_offset+1])[0] += ((int16_t *)&txdataF[0][tti_offset])[0]; //x0*
|
||||
((int16_t *)&txdataF[1][tti_offset+1])[1] += -((int16_t *)&txdataF[0][tti_offset])[1];
|
||||
} else {
|
||||
((int16_t *)&txdataF[0][tti_offset+2])[0] += -((int16_t *)&txdataF[1][tti_offset])[0]; //x1
|
||||
((int16_t *)&txdataF[0][tti_offset+2])[1] += ((int16_t *)&txdataF[1][tti_offset])[1];
|
||||
((int16_t *)&txdataF[1][tti_offset+2])[0] += ((int16_t *)&txdataF[0][tti_offset])[0]; //x0*
|
||||
((int16_t *)&txdataF[1][tti_offset+2])[1] += -((int16_t *)&txdataF[0][tti_offset])[1];
|
||||
|
||||
re++; // skip pilots
|
||||
*re_allocated = *re_allocated + 1;
|
||||
}
|
||||
re++; // adjacent carriers are taken care of by precoding
|
||||
*re_allocated = *re_allocated + 1; // incremented variable but never used
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int dlsch_modulation_NB_IoT(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t control_region_size, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
|
||||
NB_IoT_eNB_NDLSCH_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
|
||||
int G, // number of bits per subframe
|
||||
unsigned int npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
|
||||
unsigned int subframe,
|
||||
unsigned short NB_IoT_RB_ID)
|
||||
{
|
||||
//uint8_t harq_pid = dlsch0->current_harq_pid;
|
||||
//NB_IoT_DL_eNB_HARQ_t *dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
uint32_t jj = 0;
|
||||
uint32_t re_allocated,symbol_offset;
|
||||
uint16_t l;
|
||||
uint8_t id_offset,pilot_shift,pilots = 0;
|
||||
unsigned short bandwidth_even_odd;
|
||||
unsigned short NB_IoT_start, RB_IoT_ID;
|
||||
|
||||
re_allocated = 0;
|
||||
id_offset = 0;
|
||||
pilot_shift = 0;
|
||||
// testing if the total number of RBs is even or odd
|
||||
bandwidth_even_odd = frame_parms->N_RB_DL % 2; // 0 even, 1 odd
|
||||
RB_IoT_ID = NB_IoT_RB_ID;
|
||||
// step 5, 6, 7 // modulation and mapping (slot 1, symbols 0..3)
|
||||
for (l=control_region_size; l<14; l++) { // loop on OFDM symbols
|
||||
if((l>=4 && l<=7) || (l>=11 && l<=13))
|
||||
{
|
||||
pilots = 1;
|
||||
if(l==4 || l==6 || l==11 || l==13)
|
||||
{
|
||||
pilot_shift = 1;
|
||||
}
|
||||
} else {
|
||||
pilots = 0;
|
||||
}
|
||||
id_offset = frame_parms->Nid_cell % 6; // Cell_ID_NB_IoT % 6
|
||||
if(RB_IoT_ID < (frame_parms->N_RB_DL/2))
|
||||
{
|
||||
NB_IoT_start = frame_parms->ofdm_symbol_size - 12*(frame_parms->N_RB_DL/2) - (bandwidth_even_odd*6) + 12*(RB_IoT_ID % (int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
} else {
|
||||
NB_IoT_start = 1 + (bandwidth_even_odd*6) + 12*(RB_IoT_ID % (int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
}
|
||||
symbol_offset = (14*subframe*frame_parms->ofdm_symbol_size) + frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start
|
||||
|
||||
|
||||
allocate_REs_in_RB_NB_IoT(frame_parms,
|
||||
txdataF,
|
||||
&jj,
|
||||
symbol_offset,
|
||||
&dlsch0->harq_process->s_e[G*npdsch_data_subframe],
|
||||
pilots,
|
||||
amp,
|
||||
id_offset,
|
||||
pilot_shift,
|
||||
&re_allocated);
|
||||
}
|
||||
|
||||
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, VCD_FUNCTION_OUT);
|
||||
return (re_allocated);
|
||||
}
|
||||
|
||||
@@ -206,6 +206,7 @@ void init_unscrambling_lut() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void init_scrambling_lut() {
|
||||
|
||||
uint32_t s;
|
||||
|
||||
97
openair1/PHY/LTE_TRANSPORT/dlsch_scrambling_NB_IoT.c
Normal file
97
openair1/PHY/LTE_TRANSPORT/dlsch_scrambling_NB_IoT.c
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/dlsch_scrambling_NB_IoT.c
|
||||
* \brief Routines for the scrambling procedure of the NPDSCH physical channel for NB_IoT, TS 36-211, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
//#define DEBUG_SCRAMBLING 1
|
||||
|
||||
//#include "PHY/defs.h"
|
||||
//#include "PHY/defs_NB_IoT.h"
|
||||
//#include "PHY/CODING/extern.h"
|
||||
//#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
//#include "defs.h"
|
||||
//#include "extern_NB_IoT.h"
|
||||
//#include "PHY/extern_NB_IoT.h"
|
||||
//#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
|
||||
#include "PHY/impl_defs_lte_NB_IoT.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
|
||||
#include "openair1/PHY/extern_NB_IoT.h"
|
||||
|
||||
|
||||
void dlsch_scrambling_Gen_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
NB_IoT_eNB_NDLSCH_t *dlsch,
|
||||
int tot_bits, // total number of bits to transmit
|
||||
uint16_t Nf, // Nf is the frame number (0..9)
|
||||
uint8_t Ns,
|
||||
uint32_t rnti,
|
||||
uint8_t release_v13_5_0,
|
||||
uint8_t SIB)
|
||||
{
|
||||
int i,j,k=0;
|
||||
uint32_t x1,x2, s=0;
|
||||
uint8_t *e = dlsch->harq_process->e; //uint8_t *e=dlsch->harq_processes[dlsch->current_harq_pid]->e;
|
||||
|
||||
if(release_v13_5_0 == 1 && SIB == 1) /// for SIBs from release 13.5.0 and above
|
||||
{
|
||||
x2 = (rnti<<15) + (frame_parms->Nid_cell + 1) * ( (Nf % 61) + 1 ) ;
|
||||
} else {
|
||||
x2 = (rnti<<14) + ((Nf%2)<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell;
|
||||
}
|
||||
|
||||
s = lte_gold_generic_NB_IoT(&x1, &x2, 1);
|
||||
|
||||
for (i=0; i<(1+(tot_bits>>5)); i++) {
|
||||
|
||||
for (j=0; j<32; j++,k++) {
|
||||
|
||||
dlsch->harq_process->s_e[k] = (e[k]&1) ^ ((s>>j)&1);
|
||||
|
||||
}
|
||||
s = lte_gold_generic_NB_IoT(&x1, &x2, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void init_unscrambling_lut_NB_IoT() {
|
||||
|
||||
uint32_t s;
|
||||
int i=0,j;
|
||||
|
||||
for (s=0;s<=65535;s++) {
|
||||
for (j=0;j<16;j++) {
|
||||
unscrambling_lut_NB_IoT[i++] = (int16_t)((((s>>j)&1)<<1)-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,10 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __DLSCH_TBS_FULL_H__
|
||||
#define __DLSCH_TBS_FULL_H__
|
||||
|
||||
#define TBStable_rowCnt 27
|
||||
|
||||
/** \brief "Transport block size table"
|
||||
@@ -54,3 +58,10 @@ unsigned int TBStable[TBStable_rowCnt][110] = {{16,32,56,88,120,152,176,208,224,
|
||||
};
|
||||
|
||||
unsigned int TBStable1C[32] = {40, 56, 72, 120, 136, 144, 176, 208, 224, 256, 280, 296, 328, 336, 392, 488, 552, 600, 632, 696, 776, 840, 904, 1000, 1064, 1128, 1224, 1288, 1384, 1480, 1608, 1736};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
56
openair1/PHY/LTE_TRANSPORT/dlsch_tbs_full_NB_IoT.h
Normal file
56
openair1/PHY/LTE_TRANSPORT/dlsch_tbs_full_NB_IoT.h
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __DLSCH_TBS_FULL_NB_IOT_H__
|
||||
#define __DLSCH_TBS_FULL_NB_IOT_H__
|
||||
|
||||
/** \brief "Transport block size table"
|
||||
* (Table 7.1.7.2.1-1 in 3GPP TS 36.213 V8.6.0)
|
||||
*/
|
||||
|
||||
|
||||
// NB-IoT------------------
|
||||
|
||||
// TBS table for the case not containing SIB1-NB, Table 16.4.1.5.1-1 in TS 36.213 v14.2
|
||||
unsigned int TBStable_NB_IoT[14][8] ={ //[ITBS][ISF]
|
||||
{16,32,56,88,120.152,208,256},
|
||||
{24,56,88,144,176,208,256,344},
|
||||
{32,72,144,176,208,256,328,424},
|
||||
{40,104,176,208,256,328,440,568},
|
||||
{56,120,208,256,328,408,552,680},
|
||||
{72,144,244,328,424,504,680,872},
|
||||
{88,176,256,392,504,600,808,1032},
|
||||
{104,224,328,472,584,680,968,1224},
|
||||
{120,256,392,536,680,808,1096,1352},
|
||||
{136,296,456,616,776,936,1256,1544},
|
||||
{144,328,504,680,872,1032,1384,1736},
|
||||
{176,376,584,776,1000,1192,1608,2024},
|
||||
{208,440,680,904,1128,1352,1800,2280},
|
||||
{224,488,744,1128,1256,1544,2024,2536}
|
||||
};
|
||||
|
||||
//TBS table for the case containing S1B1-NB, Table 16.4.1.5.2-1 in TS 36.213 v14.2 (Itbs = 12 ~ 15 is reserved field
|
||||
//mapping ITBS to SIB1-NB
|
||||
unsigned int TBStable_NB_IoT_SIB1[16] = {208,208,208,328,328,328,440,440,440,680,680,680,0,0,0,0};
|
||||
|
||||
#endif
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
extern unsigned int dlsch_tbs25[27][25],TBStable[27][110],TBStable1C[32];
|
||||
|
||||
extern unsigned short lte_cqi_eff1024[16];
|
||||
extern char lte_cqi_snr_dB[15];
|
||||
extern short conjugate[8],conjugate2[8];
|
||||
|
||||
69
openair1/PHY/LTE_TRANSPORT/extern_NB_IoT.h
Normal file
69
openair1/PHY/LTE_TRANSPORT/extern_NB_IoT.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __PHY_LTE_TRANSPORT_EXTERN_NB_IOT__H__
|
||||
#define __PHY_LTE_TRANSPORT_EXTERN_NB_IOT__H__
|
||||
|
||||
|
||||
extern unsigned int TBStable_NB_IoT[14][8];
|
||||
extern unsigned int TBStable_NB_IoT_SIB1[16];
|
||||
|
||||
extern unsigned char cs_ri_normal_NB_IoT[4];
|
||||
extern unsigned char cs_ri_extended_NB_IoT[4];
|
||||
extern unsigned char cs_ack_normal_NB_IoT[4];
|
||||
extern unsigned char cs_ack_extended_NB_IoT[4];
|
||||
extern int8_t wACK_RX_NB_IoT[5][4];
|
||||
extern int G_tab[18];
|
||||
|
||||
|
||||
extern short conjugate[8],conjugate2[8];
|
||||
extern short *ul_ref_sigs_rx_NB_IoT[30][4]; // NB-IoT: format 1 pilots
|
||||
extern short *ul_ref_sigs_f2_rx_NB_IoT[16]; // NB-IoT: format 2 pilots
|
||||
extern unsigned short dftsizes[33];
|
||||
|
||||
|
||||
extern int16_t e_phi_re_m6[120];
|
||||
extern int16_t e_phi_im_m6[120];
|
||||
extern int16_t e_phi_re_m5[120];
|
||||
extern int16_t e_phi_im_m5[120];
|
||||
extern int16_t e_phi_re_m4[120];
|
||||
extern int16_t e_phi_im_m4[120];
|
||||
extern int16_t e_phi_re_m3[120];
|
||||
extern int16_t e_phi_im_m3[120];
|
||||
extern int16_t e_phi_re_m2[120];
|
||||
extern int16_t e_phi_im_m2[120];
|
||||
extern int16_t e_phi_re_m1[120];
|
||||
extern int16_t e_phi_im_m1[120];
|
||||
extern int16_t e_phi_re_0[120];
|
||||
extern int16_t e_phi_im_0[120];
|
||||
extern int16_t e_phi_re_p1[120];
|
||||
extern int16_t e_phi_im_p1[120];
|
||||
extern int16_t e_phi_re_p2[120];
|
||||
extern int16_t e_phi_im_p2[120];
|
||||
extern int16_t e_phi_re_p3[120];
|
||||
extern int16_t e_phi_im_p3[120];
|
||||
extern int16_t e_phi_re_p4[120];
|
||||
extern int16_t e_phi_im_p4[120];
|
||||
extern int16_t e_phi_re_p5[120];
|
||||
extern int16_t e_phi_im_p5[120];
|
||||
|
||||
#endif
|
||||
120
openair1/PHY/LTE_TRANSPORT/first_sc_NB_IoT.h
Normal file
120
openair1/PHY/LTE_TRANSPORT/first_sc_NB_IoT.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
int16_t s_n11_re[336] = {23169, 29621, -3212, -31786, -18205, 19519, 31356, 1607, -30273, -22005, 15446, 32412, 6392, -28106, -25330, 11038, 32767, 11038, -25330, -28106, 6392, 32412, 15446, -22005, -30273, 1607, 31356, 19519, -18205, -31786, -3212, 29621, 23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, -1, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039, -32767, -11039, 25329, 28105, -6393, -32413, -15447, 22004, 30272, -1608, -31357, -19520, 18204, 31785, 3211, -29622, -23170, 14009, 32609, 7961, -27245, -26319, 9511, 32727, 12539, -24279, -28898, 4807, 32137, 16845, -20788, -30852, -1, 30851, 20787, -16846, -32138, -4808, 28897, 24278, -12540, -32728, -9512, 26318, 27244, -7962, -32610, -14010, 23169, 29621, -3212, -31786, -18205, 19519, 31356, 1607, -30273, -22005, 15446, 32412, 6392, -28106, -25330, 11038, 32767, 11038, -25330, -28106, 6392, 32412, 15446, -22005, -30273, 1607, 31356, 19519, -18205, -31786, -3212, 29621, 23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, -1, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039, -32767, -11039, 25329, 28105, -6393, -32413, -15447, 22004, 30272, -1608, -31357, -19520, 18204, 31785, 3211, -29622, -23170, 14009, 32609, 7961, -27245, -26319, 9511, 32727, 12539, -24279, -28898, 4807, 32137, 16845, -20788, -30852, 0, 30851, 20787, -16846, -32138, -4808, 28897, 24278, -12540, -32728, -9512, 26318, 27244, -7962, -32610, -14010, 23169, 29621, -3212, -31786, -18205, 19519, 31356, 1607, -30273, -22005, 15446, 32412, 6392, -28106, -25330, 11038, 32767, 11038, -25330, -28106, 6392, 32412, 15446, -22005, -30273, 1607, 31356, 19519, -18205, -31786, -3212, 29621, 23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, -1, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039};
|
||||
|
||||
int16_t s_n11_im[336] = {23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, 0, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039, -32767, -11039, 25329, 28105, -6393, -32413, -15447, 22004, 30272, -1608, -31357, -19520, 18204, 31785, 3211, -29622, -23170, 14009, 32609, 7961, -27245, -26319, 9511, 32727, 12539, -24279, -28898, 4807, 32137, 16845, -20788, -30852, 0, 30851, 20787, -16846, -32138, -4808, 28897, 24278, -12540, -32728, -9512, 26318, 27244, -7962, -32610, -14010, 23169, 29621, -3212, -31786, -18205, 19519, 31356, 1607, -30273, -22005, 15446, 32412, 6392, -28106, -25330, 11038, 32767, 11038, -25330, -28106, 6392, 32412, 15446, -22005, -30273, 1607, 31356, 19519, -18205, -31786, -3212, 29621, 23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, -1, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039, -32767, -11039, 25329, 28105, -6393, -32413, -15447, 22004, 30272, -1608, -31357, -19520, 18204, 31785, 3211, -29622, -23170, 14009, 32609, 7961, -27245, -26319, 9511, 32727, 12539, -24279, -28898, 4807, 32137, 16845, -20788, -30852, 0, 30851, 20787, -16846, -32138, -4808, 28897, 24278, -12540, -32728, -9512, 26318, 27244, -7962, -32610, -14010, 23169, 29621, -3212, -31786, -18205, 19519, 31356, 1607, -30273, -22005, 15446, 32412, 6392, -28106, -25330, 11038, 32767, 11038, -25330, -28106, 6392, 32412, 15446, -22005, -30273, 1607, 31356, 19519, -18205, -31786, -3212, 29621, 23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, -1, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039, -32767, -11039, 25329, 28105, -6393, -32413, -15447, 22004, 30272, -1608, -31357, -19520, 18204, 31785, 3211, -29622, -23170, 14009, 32609, 7961, -27245, -26319, 9511, 32727, 12539, -24279, -28898, 4807, 32137, 16845, -20788, -30852};
|
||||
|
||||
|
||||
|
||||
int16_t s_n10_re[336] = {-23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786, -1, 31785, 15446, -24279, -27245, 11038, 32609, 4807, -30273, -19520, 20787, 29621, -6393, -32728, -9512, 28105, 23169, -16846, -31357, 1607, 32137, 14009, -25330, -26319, 12539, 32412, 3211, -30852, -18205, 22004, 28897, -7962, -32767, -7962, 28897, 22004, -18205, -30852, 3211, 32412, 12539, -26319, -25330, 14009, 32137, 1607, -31357, -16846, 23169, 28105, -9512, -32728, -6393, 29621, 20787, -19520, -30273, 4807, 32609, 11038, -27245, -24279, 15446, 31785, 0, -31786, -15447, 24278, 27244, -11039, -32610, -4808, 30272, 19519, -20788, -29622, 6392, 32727, 9511, -28106, -23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786, 0, 31785, 15446, -24279, -27245, 11038, 32609, 4807, -30273, -19520, 20787, 29621, -6393, -32728, -9512, 28105, 23169, -16846, -31357, 1607, 32137, 14009, -25330, -26319, 12539, 32412, 3211, -30852, -18205, 22004, 28897, -7962, -32767, -7962, 28897, 22004, -18205, -30852, 3211, 32412, 12539, -26319, -25330, 14009, 32137, 1607, -31357, -16846, 23169, 28105, -9512, -32728, -6393, 29621, 20787, -19520, -30273, 4807, 32609, 11038, -27245, -24279, 15446, 31785, -1, -31786, -15447, 24278, 27244, -11039, -32610, -4808, 30272, 19519, -20788, -29622, 6392, 32727, 9511, -28106, -23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786, -1, 31785, 15446, -24279, -27245, 11038, 32609, 4807, -30273, -19520, 20787, 29621, -6393, -32728, -9512, 28105, 23169, -16846, -31357, 1607, 32137, 14009, -25330, -26319, 12539, 32412, 3211, -30852, -18205, 22004, 28897, -7962};
|
||||
|
||||
int16_t s_n10_im[336] = {23169, 28105, -9512, -32728, -6393, 29621, 20787, -19520, -30273, 4807, 32609, 11038, -27245, -24279, 15446, 31785, 0, -31786, -15447, 24278, 27244, -11039, -32610, -4808, 30272, 19519, -20788, -29622, 6392, 32727, 9511, -28106, -23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786, -1, 31785, 15446, -24279, -27245, 11038, 32609, 4807, -30273, -19520, 20787, 29621, -6393, -32728, -9512, 28105, 23169, -16846, -31357, 1607, 32137, 14009, -25330, -26319, 12539, 32412, 3211, -30852, -18205, 22004, 28897, -7962, -32767, -7962, 28897, 22004, -18205, -30852, 3211, 32412, 12539, -26319, -25330, 14009, 32137, 1607, -31357, -16846, 23169, 28105, -9512, -32728, -6393, 29621, 20787, -19520, -30273, 4807, 32609, 11038, -27245, -24279, 15446, 31785, 0, -31786, -15447, 24278, 27244, -11039, -32610, -4808, 30272, 19519, -20788, -29622, 6392, 32727, 9511, -28106, -23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786, 0, 31785, 15446, -24279, -27245, 11038, 32609, 4807, -30273, -19520, 20787, 29621, -6393, -32728, -9512, 28105, 23169, -16846, -31357, 1607, 32137, 14009, -25330, -26319, 12539, 32412, 3211, -30852, -18205, 22004, 28897, -7962, -32767, -7962, 28897, 22004, -18205, -30852, 3211, 32412, 12539, -26319, -25330, 14009, 32137, 1607, -31357, -16846, 23169, 28105, -9512, -32728, -6393, 29621, 20787, -19520, -30273, 4807, 32609, 11038, -27245, -24279, 15446, 31785, 0, -31786, -15447, 24278, 27244, -11039, -32610, -4808, 30272, 19519, -20788, -29622, 6392, 32727, 9511, -28106, -23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786};
|
||||
|
||||
|
||||
|
||||
int16_t s_n9_re[336] = {-23170, -26319, 15446, 30851, -6393, -32728, -3212, 31785, 12539, -28106, -20788, 22004, 27244, -14010, -31357, 4807, 32767, 4807, -31357, -14010, 27244, 22004, -20788, -28106, 12539, 31785, -3212, -32728, -6393, 30851, 15446, -26319, -23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, -1, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808, -32767, -4808, 31356, 14009, -27245, -22005, 20787, 28105, -12540, -31786, 3211, 32727, 6392, -30852, -15447, 26318, 23169, -19520, -28898, 11038, 32137, -1608, -32610, -7962, 30272, 16845, -25330, -24279, 18204, 29621, -9512, -32413, -1, 32412, 9511, -29622, -18205, 24278, 25329, -16846, -30273, 7961, 32609, 1607, -32138, -11039, 28897, 19519, -23170, -26319, 15446, 30851, -6393, -32728, -3212, 31785, 12539, -28106, -20788, 22004, 27244, -14010, -31357, 4807, 32767, 4807, -31357, -14010, 27244, 22004, -20788, -28106, 12539, 31785, -3212, -32728, -6393, 30851, 15446, -26319, -23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, -1, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808, -32767, -4808, 31356, 14009, -27245, -22005, 20787, 28105, -12540, -31786, 3211, 32727, 6392, -30852, -15447, 26318, 23169, -19520, -28898, 11038, 32137, -1608, -32610, -7962, 30272, 16845, -25330, -24279, 18204, 29621, -9512, -32413, 0, 32412, 9511, -29622, -18205, 24278, 25329, -16846, -30273, 7961, 32609, 1607, -32138, -11039, 28897, 19519, -23170, -26319, 15446, 30851, -6393, -32728, -3212, 31785, 12539, -28106, -20788, 22004, 27244, -14010, -31357, 4807, 32767, 4807, -31357, -14010, 27244, 22004, -20788, -28106, 12539, 31785, -3212, -32728, -6393, 30851, 15446, -26319, -23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, -1, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808};
|
||||
|
||||
int16_t s_n9_im[336] = {-23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, 0, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808, -32767, -4808, 31356, 14009, -27245, -22005, 20787, 28105, -12540, -31786, 3211, 32727, 6392, -30852, -15447, 26318, 23169, -19520, -28898, 11038, 32137, -1608, -32610, -7962, 30272, 16845, -25330, -24279, 18204, 29621, -9512, -32413, 0, 32412, 9511, -29622, -18205, 24278, 25329, -16846, -30273, 7961, 32609, 1607, -32138, -11039, 28897, 19519, -23170, -26319, 15446, 30851, -6393, -32728, -3212, 31785, 12539, -28106, -20788, 22004, 27244, -14010, -31357, 4807, 32767, 4807, -31357, -14010, 27244, 22004, -20788, -28106, 12539, 31785, -3212, -32728, -6393, 30851, 15446, -26319, -23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, -1, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808, -32767, -4808, 31356, 14009, -27245, -22005, 20787, 28105, -12540, -31786, 3211, 32727, 6392, -30852, -15447, 26318, 23169, -19520, -28898, 11038, 32137, -1608, -32610, -7962, 30272, 16845, -25330, -24279, 18204, 29621, -9512, -32413, 0, 32412, 9511, -29622, -18205, 24278, 25329, -16846, -30273, 7961, 32609, 1607, -32138, -11039, 28897, 19519, -23170, -26319, 15446, 30851, -6393, -32728, -3212, 31785, 12539, -28106, -20788, 22004, 27244, -14010, -31357, 4807, 32767, 4807, -31357, -14010, 27244, 22004, -20788, -28106, 12539, 31785, -3212, -32728, -6393, 30851, 15446, -26319, -23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, -1, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808, -32767, -4808, 31356, 14009, -27245, -22005, 20787, 28105, -12540, -31786, 3211, 32727, 6392, -30852, -15447, 26318, 23169, -19520, -28898, 11038, 32137, -1608, -32610, -7962, 30272, 16845, -25330, -24279, 18204, 29621, -9512, -32413};
|
||||
|
||||
|
||||
|
||||
int16_t s_n8_re[336] = {23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728, -1, 32727, 3211, -32413, -6393, 31785, 9511, -30852, -12540, 29621, 15446, -28106, -18205, 26318, 20787, -24279, -23170, 22004, 25329, -19520, -27245, 16845, 28897, -14010, -30273, 11038, 31356, -7962, -32138, 4807, 32609, -1608, -32767, -1608, 32609, 4807, -32138, -7962, 31356, 11038, -30273, -14010, 28897, 16845, -27245, -19520, 25329, 22004, -23170, -24279, 20787, 26318, -18205, -28106, 15446, 29621, -12540, -30852, 9511, 31785, -6393, -32413, 3211, 32727, 0, -32728, -3212, 32412, 6392, -31786, -9512, 30851, 12539, -29622, -15447, 28105, 18204, -26319, -20788, 24278, 23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728, 0, 32727, 3211, -32413, -6393, 31785, 9511, -30852, -12540, 29621, 15446, -28106, -18205, 26318, 20787, -24279, -23170, 22004, 25329, -19520, -27245, 16845, 28897, -14010, -30273, 11038, 31356, -7962, -32138, 4807, 32609, -1608, -32767, -1608, 32609, 4807, -32138, -7962, 31356, 11038, -30273, -14010, 28897, 16845, -27245, -19520, 25329, 22004, -23170, -24279, 20787, 26318, -18205, -28106, 15446, 29621, -12540, -30852, 9511, 31785, -6393, -32413, 3211, 32727, -1, -32728, -3212, 32412, 6392, -31786, -9512, 30851, 12539, -29622, -15447, 28105, 18204, -26319, -20788, 24278, 23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728, -1, 32727, 3211, -32413, -6393, 31785, 9511, -30852, -12540, 29621, 15446, -28106, -18205, 26318, 20787, -24279, -23170, 22004, 25329, -19520, -27245, 16845, 28897, -14010, -30273, 11038, 31356, -7962, -32138, 4807, 32609, -1608};
|
||||
|
||||
int16_t s_n8_im[336] = {-23170, -24279, 20787, 26318, -18205, -28106, 15446, 29621, -12540, -30852, 9511, 31785, -6393, -32413, 3211, 32727, 0, -32728, -3212, 32412, 6392, -31786, -9512, 30851, 12539, -29622, -15447, 28105, 18204, -26319, -20788, 24278, 23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728, -1, 32727, 3211, -32413, -6393, 31785, 9511, -30852, -12540, 29621, 15446, -28106, -18205, 26318, 20787, -24279, -23170, 22004, 25329, -19520, -27245, 16845, 28897, -14010, -30273, 11038, 31356, -7962, -32138, 4807, 32609, -1608, -32767, -1608, 32609, 4807, -32138, -7962, 31356, 11038, -30273, -14010, 28897, 16845, -27245, -19520, 25329, 22004, -23170, -24279, 20787, 26318, -18205, -28106, 15446, 29621, -12540, -30852, 9511, 31785, -6393, -32413, 3211, 32727, 0, -32728, -3212, 32412, 6392, -31786, -9512, 30851, 12539, -29622, -15447, 28105, 18204, -26319, -20788, 24278, 23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728, 0, 32727, 3211, -32413, -6393, 31785, 9511, -30852, -12540, 29621, 15446, -28106, -18205, 26318, 20787, -24279, -23170, 22004, 25329, -19520, -27245, 16845, 28897, -14010, -30273, 11038, 31356, -7962, -32138, 4807, 32609, -1608, -32767, -1608, 32609, 4807, -32138, -7962, 31356, 11038, -30273, -14010, 28897, 16845, -27245, -19520, 25329, 22004, -23170, -24279, 20787, 26318, -18205, -28106, 15446, 29621, -12540, -30852, 9511, 31785, -6393, -32413, 3211, 32727, 0, -32728, -3212, 32412, 6392, -31786, -9512, 30851, 12539, -29622, -15447, 28105, 18204, -26319, -20788, 24278, 23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728};
|
||||
|
||||
|
||||
|
||||
int16_t s_n7_re[336] = {23169, 22004, -25330, -19520, 27244, 16845, -28898, -14010, 30272, 11038, -31357, -7962, 32137, 4807, -32610, -1608, 32767, -1608, -32610, 4807, 32137, -7962, -31357, 11038, 30272, -14010, -28898, 16845, 27244, -19520, -25330, 22004, 23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, 0, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607, -32767, 1607, 32609, -4808, -32138, 7961, 31356, -11039, -30273, 14009, 28897, -16846, -27245, 19519, 25329, -22005, -23170, 24278, 20787, -26319, -18205, 28105, 15446, -29622, -12540, 30851, 9511, -31786, -6393, 32412, 3211, -32728, -1, 32727, -3212, -32413, 6392, 31785, -9512, -30852, 12539, 29621, -15447, -28106, 18204, 26318, -20788, -24279, 23169, 22004, -25330, -19520, 27244, 16845, -28898, -14010, 30272, 11038, -31357, -7962, 32137, 4807, -32610, -1608, 32767, -1608, -32610, 4807, 32137, -7962, -31357, 11038, 30272, -14010, -28898, 16845, 27244, -19520, -25330, 22004, 23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, -1, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607, -32767, 1607, 32609, -4808, -32138, 7961, 31356, -11039, -30273, 14009, 28897, -16846, -27245, 19519, 25329, -22005, -23170, 24278, 20787, -26319, -18205, 28105, 15446, -29622, -12540, 30851, 9511, -31786, -6393, 32412, 3211, -32728, 0, 32727, -3212, -32413, 6392, 31785, -9512, -30852, 12539, 29621, -15447, -28106, 18204, 26318, -20788, -24279, 23169, 22004, -25330, -19520, 27244, 16845, -28898, -14010, 30272, 11038, -31357, -7962, 32137, 4807, -32610, -1608, 32767, -1608, -32610, 4807, 32137, -7962, -31357, 11038, 30272, -14010, -28898, 16845, 27244, -19520, -25330, 22004, 23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, 0, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607};
|
||||
|
||||
int16_t s_n7_im[336] = {23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, 0, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607, -32767, 1607, 32609, -4808, -32138, 7961, 31356, -11039, -30273, 14009, 28897, -16846, -27245, 19519, 25329, -22005, -23170, 24278, 20787, -26319, -18205, 28105, 15446, -29622, -12540, 30851, 9511, -31786, -6393, 32412, 3211, -32728, -1, 32727, -3212, -32413, 6392, 31785, -9512, -30852, 12539, 29621, -15447, -28106, 18204, 26318, -20788, -24279, 23169, 22004, -25330, -19520, 27244, 16845, -28898, -14010, 30272, 11038, -31357, -7962, 32137, 4807, -32610, -1608, 32767, -1608, -32610, 4807, 32137, -7962, -31357, 11038, 30272, -14010, -28898, 16845, 27244, -19520, -25330, 22004, 23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, 0, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607, -32767, 1607, 32609, -4808, -32138, 7961, 31356, -11039, -30273, 14009, 28897, -16846, -27245, 19519, 25329, -22005, -23170, 24278, 20787, -26319, -18205, 28105, 15446, -29622, -12540, 30851, 9511, -31786, -6393, 32412, 3211, -32728, 0, 32727, -3212, -32413, 6392, 31785, -9512, -30852, 12539, 29621, -15447, -28106, 18204, 26318, -20788, -24279, 23169, 22004, -25330, -19520, 27244, 16845, -28898, -14010, 30272, 11038, -31357, -7962, 32137, 4807, -32610, -1608, 32767, -1608, -32610, 4807, 32137, -7962, -31357, 11038, 30272, -14010, -28898, 16845, 27244, -19520, -25330, 22004, 23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, 0, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607, -32767, 1607, 32609, -4808, -32138, 7961, 31356, -11039, -30273, 14009, 28897, -16846, -27245, 19519, 25329, -22005, -23170, 24278, 20787, -26319, -18205, 28105, 15446, -29622, -12540, 30851, 9511, -31786, -6393, 32412, 3211, -32728};
|
||||
|
||||
|
||||
|
||||
int16_t s_n6_re[336] = {-23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413, -1, 32412, -9512, -29622, 18204, 24278, -25330, -16846, 30272, 7961, -32610, 1607, 32137, -11039, -28898, 19519, 23169, -26319, -15447, 30851, 6392, -32728, 3211, 31785, -12540, -28106, 20787, 22004, -27245, -14010, 31356, 4807, -32767, 4807, 31356, -14010, -27245, 22004, 20787, -28106, -12540, 31785, 3211, -32728, 6392, 30851, -15447, -26319, 23169, 19519, -28898, -11039, 32137, 1607, -32610, 7961, 30272, -16846, -25330, 24278, 18204, -29622, -9512, 32412, 0, -32413, 9511, 29621, -18205, -24279, 25329, 16845, -30273, -7962, 32609, -1608, -32138, 11038, 28897, -19520, -23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413, 0, 32412, -9512, -29622, 18204, 24278, -25330, -16846, 30272, 7961, -32610, 1607, 32137, -11039, -28898, 19519, 23169, -26319, -15447, 30851, 6392, -32728, 3211, 31785, -12540, -28106, 20787, 22004, -27245, -14010, 31356, 4807, -32767, 4807, 31356, -14010, -27245, 22004, 20787, -28106, -12540, 31785, 3211, -32728, 6392, 30851, -15447, -26319, 23169, 19519, -28898, -11039, 32137, 1607, -32610, 7961, 30272, -16846, -25330, 24278, 18204, -29622, -9512, 32412, -1, -32413, 9511, 29621, -18205, -24279, 25329, 16845, -30273, -7962, 32609, -1608, -32138, 11038, 28897, -19520, -23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413, 0, 32412, -9512, -29622, 18204, 24278, -25330, -16846, 30272, 7961, -32610, 1607, 32137, -11039, -28898, 19519, 23169, -26319, -15447, 30851, 6392, -32728, 3211, 31785, -12540, -28106, 20787, 22004, -27245, -14010, 31356, 4807};
|
||||
|
||||
int16_t s_n6_im[336] = {23169, 19519, -28898, -11039, 32137, 1607, -32610, 7961, 30272, -16846, -25330, 24278, 18204, -29622, -9512, 32412, 0, -32413, 9511, 29621, -18205, -24279, 25329, 16845, -30273, -7962, 32609, -1608, -32138, 11038, 28897, -19520, -23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413, -1, 32412, -9512, -29622, 18204, 24278, -25330, -16846, 30272, 7961, -32610, 1607, 32137, -11039, -28898, 19519, 23169, -26319, -15447, 30851, 6392, -32728, 3211, 31785, -12540, -28106, 20787, 22004, -27245, -14010, 31356, 4807, -32767, 4807, 31356, -14010, -27245, 22004, 20787, -28106, -12540, 31785, 3211, -32728, 6392, 30851, -15447, -26319, 23169, 19519, -28898, -11039, 32137, 1607, -32610, 7961, 30272, -16846, -25330, 24278, 18204, -29622, -9512, 32412, 0, -32413, 9511, 29621, -18205, -24279, 25329, 16845, -30273, -7962, 32609, -1608, -32138, 11038, 28897, -19520, -23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413, 0, 32412, -9512, -29622, 18204, 24278, -25330, -16846, 30272, 7961, -32610, 1607, 32137, -11039, -28898, 19519, 23169, -26319, -15447, 30851, 6392, -32728, 3211, 31785, -12540, -28106, 20787, 22004, -27245, -14010, 31356, 4807, -32767, 4807, 31356, -14010, -27245, 22004, 20787, -28106, -12540, 31785, 3211, -32728, 6392, 30851, -15447, -26319, 23169, 19519, -28898, -11039, 32137, 1607, -32610, 7961, 30272, -16846, -25330, 24278, 18204, -29622, -9512, 32412, 0, -32413, 9511, 29621, -18205, -24279, 25329, 16845, -30273, -7962, 32609, -1608, -32138, 11038, 28897, -19520, -23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413};
|
||||
|
||||
|
||||
|
||||
int16_t s_n5_re[336] = {-23170, -16846, 31356, 1607, -32138, 14009, 25329, -26319, -12540, 32412, -3212, -30852, 18204, 22004, -28898, -7962, 32767, -7962, -28898, 22004, 18204, -30852, -3212, 32412, -12540, -26319, 25329, 14009, -32138, 1607, 31356, -16846, -23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, 0, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961, -32767, 7961, 28897, -22005, -18205, 30851, 3211, -32413, 12539, 26318, -25330, -14010, 32137, -1608, -31357, 16845, 23169, -28106, -9512, 32727, -6393, -29622, 20787, 19519, -30273, -4808, 32609, -11039, -27245, 24278, 15446, -31786, -1, 31785, -15447, -24279, 27244, 11038, -32610, 4807, 30272, -19520, -20788, 29621, 6392, -32728, 9511, 28105, -23170, -16846, 31356, 1607, -32138, 14009, 25329, -26319, -12540, 32412, -3212, -30852, 18204, 22004, -28898, -7962, 32767, -7962, -28898, 22004, 18204, -30852, -3212, 32412, -12540, -26319, 25329, 14009, -32138, 1607, 31356, -16846, -23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, -1, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961, -32767, 7961, 28897, -22005, -18205, 30851, 3211, -32413, 12539, 26318, -25330, -14010, 32137, -1608, -31357, 16845, 23169, -28106, -9512, 32727, -6393, -29622, 20787, 19519, -30273, -4808, 32609, -11039, -27245, 24278, 15446, -31786, 0, 31785, -15447, -24279, 27244, 11038, -32610, 4807, 30272, -19520, -20788, 29621, 6392, -32728, 9511, 28105, -23170, -16846, 31356, 1607, -32138, 14009, 25329, -26319, -12540, 32412, -3212, -30852, 18204, 22004, -28898, -7962, 32767, -7962, -28898, 22004, 18204, -30852, -3212, 32412, -12540, -26319, 25329, 14009, -32138, 1607, 31356, -16846, -23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, 0, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961};
|
||||
|
||||
int16_t s_n5_im[336] = {-23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, 0, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961, -32767, 7961, 28897, -22005, -18205, 30851, 3211, -32413, 12539, 26318, -25330, -14010, 32137, -1608, -31357, 16845, 23169, -28106, -9512, 32727, -6393, -29622, 20787, 19519, -30273, -4808, 32609, -11039, -27245, 24278, 15446, -31786, -1, 31785, -15447, -24279, 27244, 11038, -32610, 4807, 30272, -19520, -20788, 29621, 6392, -32728, 9511, 28105, -23170, -16846, 31356, 1607, -32138, 14009, 25329, -26319, -12540, 32412, -3212, -30852, 18204, 22004, -28898, -7962, 32767, -7962, -28898, 22004, 18204, -30852, -3212, 32412, -12540, -26319, 25329, 14009, -32138, 1607, 31356, -16846, -23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, 0, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961, -32767, 7961, 28897, -22005, -18205, 30851, 3211, -32413, 12539, 26318, -25330, -14010, 32137, -1608, -31357, 16845, 23169, -28106, -9512, 32727, -6393, -29622, 20787, 19519, -30273, -4808, 32609, -11039, -27245, 24278, 15446, -31786, 0, 31785, -15447, -24279, 27244, 11038, -32610, 4807, 30272, -19520, -20788, 29621, 6392, -32728, 9511, 28105, -23170, -16846, 31356, 1607, -32138, 14009, 25329, -26319, -12540, 32412, -3212, -30852, 18204, 22004, -28898, -7962, 32767, -7962, -28898, 22004, 18204, -30852, -3212, 32412, -12540, -26319, 25329, 14009, -32138, 1607, 31356, -16846, -23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, 0, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961, -32767, 7961, 28897, -22005, -18205, 30851, 3211, -32413, 12539, 26318, -25330, -14010, 32137, -1608, -31357, 16845, 23169, -28106, -9512, 32727, -6393, -29622, 20787, 19519, -30273, -4808, 32609, -11039, -27245, 24278, 15446, -31786};
|
||||
|
||||
|
||||
|
||||
int16_t s_n4_re[336] = {23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852, 0, 30851, -20788, -16846, 32137, -4808, -28898, 24278, 12539, -32728, 9511, 26318, -27245, -7962, 32609, -14010, -23170, 29621, 3211, -31786, 18204, 19519, -31357, 1607, 30272, -22005, -15447, 32412, -6393, -28106, 25329, 11038, -32767, 11038, 25329, -28106, -6393, 32412, -15447, -22005, 30272, 1607, -31357, 19519, 18204, -31786, 3211, 29621, -23170, -14010, 32609, -7962, -27245, 26318, 9511, -32728, 12539, 24278, -28898, -4808, 32137, -16846, -20788, 30851, 0, -30852, 20787, 16845, -32138, 4807, 28897, -24279, -12540, 32727, -9512, -26319, 27244, 7961, -32610, 14009, 23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852, 0, 30851, -20788, -16846, 32137, -4808, -28898, 24278, 12539, -32728, 9511, 26318, -27245, -7962, 32609, -14010, -23170, 29621, 3211, -31786, 18204, 19519, -31357, 1607, 30272, -22005, -15447, 32412, -6393, -28106, 25329, 11038, -32767, 11038, 25329, -28106, -6393, 32412, -15447, -22005, 30272, 1607, -31357, 19519, 18204, -31786, 3211, 29621, -23170, -14010, 32609, -7962, -27245, 26318, 9511, -32728, 12539, 24278, -28898, -4808, 32137, -16846, -20788, 30851, -1, -30852, 20787, 16845, -32138, 4807, 28897, -24279, -12540, 32727, -9512, -26319, 27244, 7961, -32610, 14009, 23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852, 0, 30851, -20788, -16846, 32137, -4808, -28898, 24278, 12539, -32728, 9511, 26318, -27245, -7962, 32609, -14010, -23170, 29621, 3211, -31786, 18204, 19519, -31357, 1607, 30272, -22005, -15447, 32412, -6393, -28106, 25329, 11038};
|
||||
|
||||
int16_t s_n4_im[336] = {-23170, -14010, 32609, -7962, -27245, 26318, 9511, -32728, 12539, 24278, -28898, -4808, 32137, -16846, -20788, 30851, 0, -30852, 20787, 16845, -32138, 4807, 28897, -24279, -12540, 32727, -9512, -26319, 27244, 7961, -32610, 14009, 23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852, 0, 30851, -20788, -16846, 32137, -4808, -28898, 24278, 12539, -32728, 9511, 26318, -27245, -7962, 32609, -14010, -23170, 29621, 3211, -31786, 18204, 19519, -31357, 1607, 30272, -22005, -15447, 32412, -6393, -28106, 25329, 11038, -32767, 11038, 25329, -28106, -6393, 32412, -15447, -22005, 30272, 1607, -31357, 19519, 18204, -31786, 3211, 29621, -23170, -14010, 32609, -7962, -27245, 26318, 9511, -32728, 12539, 24278, -28898, -4808, 32137, -16846, -20788, 30851, -1, -30852, 20787, 16845, -32138, 4807, 28897, -24279, -12540, 32727, -9512, -26319, 27244, 7961, -32610, 14009, 23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852, 0, 30851, -20788, -16846, 32137, -4808, -28898, 24278, 12539, -32728, 9511, 26318, -27245, -7962, 32609, -14010, -23170, 29621, 3211, -31786, 18204, 19519, -31357, 1607, 30272, -22005, -15447, 32412, -6393, -28106, 25329, 11038, -32767, 11038, 25329, -28106, -6393, 32412, -15447, -22005, 30272, 1607, -31357, 19519, 18204, -31786, 3211, 29621, -23170, -14010, 32609, -7962, -27245, 26318, 9511, -32728, 12539, 24278, -28898, -4808, 32137, -16846, -20788, 30851, -1, -30852, 20787, 16845, -32138, 4807, 28897, -24279, -12540, 32727, -9512, -26319, 27244, 7961, -32610, 14009, 23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852};
|
||||
|
||||
|
||||
|
||||
int16_t s_n3_re[336] = {23169, 11038, -32610, 16845, 18204, -32413, 9511, 24278, -30273, 1607, 28897, -26319, -6393, 31785, -20788, -14010, 32767, -14010, -20788, 31785, -6393, -26319, 28897, 1607, -30273, 24278, 9511, -32413, 18204, 16845, -32610, 11038, 23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, 0, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009, -32767, 14009, 20787, -31786, 6392, 26318, -28898, -1608, 30272, -24279, -9512, 32412, -18205, -16846, 32609, -11039, -23170, 30851, -3212, -28106, 27244, 4807, -31357, 22004, 12539, -32728, 15446, 19519, -32138, 7961, 25329, -29622, -1, 29621, -25330, -7962, 32137, -19520, -15447, 32727, -12540, -22005, 31356, -4808, -27245, 28105, 3211, -30852, 23169, 11038, -32610, 16845, 18204, -32413, 9511, 24278, -30273, 1607, 28897, -26319, -6393, 31785, -20788, -14010, 32767, -14010, -20788, 31785, -6393, -26319, 28897, 1607, -30273, 24278, 9511, -32413, 18204, 16845, -32610, 11038, 23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, -1, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009, -32767, 14009, 20787, -31786, 6392, 26318, -28898, -1608, 30272, -24279, -9512, 32412, -18205, -16846, 32609, -11039, -23170, 30851, -3212, -28106, 27244, 4807, -31357, 22004, 12539, -32728, 15446, 19519, -32138, 7961, 25329, -29622, 0, 29621, -25330, -7962, 32137, -19520, -15447, 32727, -12540, -22005, 31356, -4808, -27245, 28105, 3211, -30852, 23169, 11038, -32610, 16845, 18204, -32413, 9511, 24278, -30273, 1607, 28897, -26319, -6393, 31785, -20788, -14010, 32767, -14010, -20788, 31785, -6393, -26319, 28897, 1607, -30273, 24278, 9511, -32413, 18204, 16845, -32610, 11038, 23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, -1, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009};
|
||||
|
||||
int16_t s_n3_im[336] = {23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, 0, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009, -32767, 14009, 20787, -31786, 6392, 26318, -28898, -1608, 30272, -24279, -9512, 32412, -18205, -16846, 32609, -11039, -23170, 30851, -3212, -28106, 27244, 4807, -31357, 22004, 12539, -32728, 15446, 19519, -32138, 7961, 25329, -29622, -1, 29621, -25330, -7962, 32137, -19520, -15447, 32727, -12540, -22005, 31356, -4808, -27245, 28105, 3211, -30852, 23169, 11038, -32610, 16845, 18204, -32413, 9511, 24278, -30273, 1607, 28897, -26319, -6393, 31785, -20788, -14010, 32767, -14010, -20788, 31785, -6393, -26319, 28897, 1607, -30273, 24278, 9511, -32413, 18204, 16845, -32610, 11038, 23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, 0, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009, -32767, 14009, 20787, -31786, 6392, 26318, -28898, -1608, 30272, -24279, -9512, 32412, -18205, -16846, 32609, -11039, -23170, 30851, -3212, -28106, 27244, 4807, -31357, 22004, 12539, -32728, 15446, 19519, -32138, 7961, 25329, -29622, 0, 29621, -25330, -7962, 32137, -19520, -15447, 32727, -12540, -22005, 31356, -4808, -27245, 28105, 3211, -30852, 23169, 11038, -32610, 16845, 18204, -32413, 9511, 24278, -30273, 1607, 28897, -26319, -6393, 31785, -20788, -14010, 32767, -14010, -20788, 31785, -6393, -26319, 28897, 1607, -30273, 24278, 9511, -32413, 18204, 16845, -32610, 11038, 23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, 0, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009, -32767, 14009, 20787, -31786, 6392, 26318, -28898, -1608, 30272, -24279, -9512, 32412, -18205, -16846, 32609, -11039, -23170, 30851, -3212, -28106, 27244, 4807, -31357, 22004, 12539, -32728, 15446, 19519, -32138, 7961, 25329, -29622};
|
||||
|
||||
|
||||
|
||||
int16_t s_n2_re[336] = {-23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106, -1, 28105, -28898, 1607, 27244, -29622, 3211, 26318, -30273, 4807, 25329, -30852, 6392, 24278, -31357, 7961, 23169, -31786, 9511, 22004, -32138, 11038, 20787, -32413, 12539, 19519, -32610, 14009, 18204, -32728, 15446, 16845, -32767, 16845, 15446, -32728, 18204, 14009, -32610, 19519, 12539, -32413, 20787, 11038, -32138, 22004, 9511, -31786, 23169, 7961, -31357, 24278, 6392, -30852, 25329, 4807, -30273, 26318, 3211, -29622, 27244, 1607, -28898, 28105, 0, -28106, 28897, -1608, -27245, 29621, -3212, -26319, 30272, -4808, -25330, 30851, -6393, -24279, 31356, -7962, -23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106, 0, 28105, -28898, 1607, 27244, -29622, 3211, 26318, -30273, 4807, 25329, -30852, 6392, 24278, -31357, 7961, 23169, -31786, 9511, 22004, -32138, 11038, 20787, -32413, 12539, 19519, -32610, 14009, 18204, -32728, 15446, 16845, -32767, 16845, 15446, -32728, 18204, 14009, -32610, 19519, 12539, -32413, 20787, 11038, -32138, 22004, 9511, -31786, 23169, 7961, -31357, 24278, 6392, -30852, 25329, 4807, -30273, 26318, 3211, -29622, 27244, 1607, -28898, 28105, -1, -28106, 28897, -1608, -27245, 29621, -3212, -26319, 30272, -4808, -25330, 30851, -6393, -24279, 31356, -7962, -23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106, 0, 28105, -28898, 1607, 27244, -29622, 3211, 26318, -30273, 4807, 25329, -30852, 6392, 24278, -31357, 7961, 23169, -31786, 9511, 22004, -32138, 11038, 20787, -32413, 12539, 19519, -32610, 14009, 18204, -32728, 15446, 16845};
|
||||
|
||||
int16_t s_n2_im[336] = {23169, 7961, -31357, 24278, 6392, -30852, 25329, 4807, -30273, 26318, 3211, -29622, 27244, 1607, -28898, 28105, 0, -28106, 28897, -1608, -27245, 29621, -3212, -26319, 30272, -4808, -25330, 30851, -6393, -24279, 31356, -7962, -23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106, -1, 28105, -28898, 1607, 27244, -29622, 3211, 26318, -30273, 4807, 25329, -30852, 6392, 24278, -31357, 7961, 23169, -31786, 9511, 22004, -32138, 11038, 20787, -32413, 12539, 19519, -32610, 14009, 18204, -32728, 15446, 16845, -32767, 16845, 15446, -32728, 18204, 14009, -32610, 19519, 12539, -32413, 20787, 11038, -32138, 22004, 9511, -31786, 23169, 7961, -31357, 24278, 6392, -30852, 25329, 4807, -30273, 26318, 3211, -29622, 27244, 1607, -28898, 28105, 0, -28106, 28897, -1608, -27245, 29621, -3212, -26319, 30272, -4808, -25330, 30851, -6393, -24279, 31356, -7962, -23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106, 0, 28105, -28898, 1607, 27244, -29622, 3211, 26318, -30273, 4807, 25329, -30852, 6392, 24278, -31357, 7961, 23169, -31786, 9511, 22004, -32138, 11038, 20787, -32413, 12539, 19519, -32610, 14009, 18204, -32728, 15446, 16845, -32767, 16845, 15446, -32728, 18204, 14009, -32610, 19519, 12539, -32413, 20787, 11038, -32138, 22004, 9511, -31786, 23169, 7961, -31357, 24278, 6392, -30852, 25329, 4807, -30273, 26318, 3211, -29622, 27244, 1607, -28898, 28105, 0, -28106, 28897, -1608, -27245, 29621, -3212, -26319, 30272, -4808, -25330, 30851, -6393, -24279, 31356, -7962, -23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106};
|
||||
|
||||
|
||||
|
||||
int16_t s_n1_re[336] = {-23170, -4808, 28897, -29622, 6392, 22004, -32610, 16845, 12539, -31786, 25329, 1607, -27245, 30851, -9512, -19520, 32767, -19520, -9512, 30851, -27245, 1607, 25329, -31786, 12539, 16845, -32610, 22004, 6392, -29622, 28897, -4808, -23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, 0, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519, -32767, 19519, 9511, -30852, 27244, -1608, -25330, 31785, -12540, -16846, 32609, -22005, -6393, 29621, -28898, 4807, 23169, -32413, 15446, 14009, -32138, 24278, 3211, -28106, 30272, -7962, -20788, 32727, -18205, -11039, 31356, -26319, -1, 26318, -31357, 11038, 18204, -32728, 20787, 7961, -30273, 28105, -3212, -24279, 32137, -14010, -15447, 32412, -23170, -4808, 28897, -29622, 6392, 22004, -32610, 16845, 12539, -31786, 25329, 1607, -27245, 30851, -9512, -19520, 32767, -19520, -9512, 30851, -27245, 1607, 25329, -31786, 12539, 16845, -32610, 22004, 6392, -29622, 28897, -4808, -23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, -1, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519, -32767, 19519, 9511, -30852, 27244, -1608, -25330, 31785, -12540, -16846, 32609, -22005, -6393, 29621, -28898, 4807, 23169, -32413, 15446, 14009, -32138, 24278, 3211, -28106, 30272, -7962, -20788, 32727, -18205, -11039, 31356, -26319, 0, 26318, -31357, 11038, 18204, -32728, 20787, 7961, -30273, 28105, -3212, -24279, 32137, -14010, -15447, 32412, -23170, -4808, 28897, -29622, 6392, 22004, -32610, 16845, 12539, -31786, 25329, 1607, -27245, 30851, -9512, -19520, 32767, -19520, -9512, 30851, -27245, 1607, 25329, -31786, 12539, 16845, -32610, 22004, 6392, -29622, 28897, -4808, -23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, -1, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519};
|
||||
|
||||
int16_t s_n1_im[336] = {-23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, 0, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519, -32767, 19519, 9511, -30852, 27244, -1608, -25330, 31785, -12540, -16846, 32609, -22005, -6393, 29621, -28898, 4807, 23169, -32413, 15446, 14009, -32138, 24278, 3211, -28106, 30272, -7962, -20788, 32727, -18205, -11039, 31356, -26319, -1, 26318, -31357, 11038, 18204, -32728, 20787, 7961, -30273, 28105, -3212, -24279, 32137, -14010, -15447, 32412, -23170, -4808, 28897, -29622, 6392, 22004, -32610, 16845, 12539, -31786, 25329, 1607, -27245, 30851, -9512, -19520, 32767, -19520, -9512, 30851, -27245, 1607, 25329, -31786, 12539, 16845, -32610, 22004, 6392, -29622, 28897, -4808, -23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, 0, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519, -32767, 19519, 9511, -30852, 27244, -1608, -25330, 31785, -12540, -16846, 32609, -22005, -6393, 29621, -28898, 4807, 23169, -32413, 15446, 14009, -32138, 24278, 3211, -28106, 30272, -7962, -20788, 32727, -18205, -11039, 31356, -26319, 0, 26318, -31357, 11038, 18204, -32728, 20787, 7961, -30273, 28105, -3212, -24279, 32137, -14010, -15447, 32412, -23170, -4808, 28897, -29622, 6392, 22004, -32610, 16845, 12539, -31786, 25329, 1607, -27245, 30851, -9512, -19520, 32767, -19520, -9512, 30851, -27245, 1607, 25329, -31786, 12539, 16845, -32610, 22004, 6392, -29622, 28897, -4808, -23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, 0, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519, -32767, 19519, 9511, -30852, 27244, -1608, -25330, 31785, -12540, -16846, 32609, -22005, -6393, 29621, -28898, 4807, 23169, -32413, 15446, 14009, -32138, 24278, 3211, -28106, 30272, -7962, -20788, 32727, -18205, -11039, 31356, -26319};
|
||||
|
||||
|
||||
|
||||
int16_t s_n0_re[336] = {23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279, 0, 24278, -32610, 19519, 6392, -28106, 31356, -14010, -12540, 30851, -28898, 7961, 18204, -32413, 25329, -1608, -23170, 32727, -20788, -4808, 27244, -31786, 15446, 11038, -30273, 29621, -9512, -16846, 32137, -26319, 3211, 22004, -32767, 22004, 3211, -26319, 32137, -16846, -9512, 29621, -30273, 11038, 15446, -31786, 27244, -4808, -20788, 32727, -23170, -1608, 25329, -32413, 18204, 7961, -28898, 30851, -12540, -14010, 31356, -28106, 6392, 19519, -32610, 24278, -1, -24279, 32609, -19520, -6393, 28105, -31357, 14009, 12539, -30852, 28897, -7962, -18205, 32412, -25330, 1607, 23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279, 0, 24278, -32610, 19519, 6392, -28106, 31356, -14010, -12540, 30851, -28898, 7961, 18204, -32413, 25329, -1608, -23170, 32727, -20788, -4808, 27244, -31786, 15446, 11038, -30273, 29621, -9512, -16846, 32137, -26319, 3211, 22004, -32767, 22004, 3211, -26319, 32137, -16846, -9512, 29621, -30273, 11038, 15446, -31786, 27244, -4808, -20788, 32727, -23170, -1608, 25329, -32413, 18204, 7961, -28898, 30851, -12540, -14010, 31356, -28106, 6392, 19519, -32610, 24278, -1, -24279, 32609, -19520, -6393, 28105, -31357, 14009, 12539, -30852, 28897, -7962, -18205, 32412, -25330, 1607, 23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279, 0, 24278, -32610, 19519, 6392, -28106, 31356, -14010, -12540, 30851, -28898, 7961, 18204, -32413, 25329, -1608, -23170, 32727, -20788, -4808, 27244, -31786, 15446, 11038, -30273, 29621, -9512, -16846, 32137, -26319, 3211, 22004};
|
||||
|
||||
int16_t s_n0_im[336] = {-23170, -1608, 25329, -32413, 18204, 7961, -28898, 30851, -12540, -14010, 31356, -28106, 6392, 19519, -32610, 24278, 0, -24279, 32609, -19520, -6393, 28105, -31357, 14009, 12539, -30852, 28897, -7962, -18205, 32412, -25330, 1607, 23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279, 0, 24278, -32610, 19519, 6392, -28106, 31356, -14010, -12540, 30851, -28898, 7961, 18204, -32413, 25329, -1608, -23170, 32727, -20788, -4808, 27244, -31786, 15446, 11038, -30273, 29621, -9512, -16846, 32137, -26319, 3211, 22004, -32767, 22004, 3211, -26319, 32137, -16846, -9512, 29621, -30273, 11038, 15446, -31786, 27244, -4808, -20788, 32727, -23170, -1608, 25329, -32413, 18204, 7961, -28898, 30851, -12540, -14010, 31356, -28106, 6392, 19519, -32610, 24278, -1, -24279, 32609, -19520, -6393, 28105, -31357, 14009, 12539, -30852, 28897, -7962, -18205, 32412, -25330, 1607, 23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279, 0, 24278, -32610, 19519, 6392, -28106, 31356, -14010, -12540, 30851, -28898, 7961, 18204, -32413, 25329, -1608, -23170, 32727, -20788, -4808, 27244, -31786, 15446, 11038, -30273, 29621, -9512, -16846, 32137, -26319, 3211, 22004, -32767, 22004, 3211, -26319, 32137, -16846, -9512, 29621, -30273, 11038, 15446, -31786, 27244, -4808, -20788, 32727, -23170, -1608, 25329, -32413, 18204, 7961, -28898, 30851, -12540, -14010, 31356, -28106, 6392, 19519, -32610, 24278, -1, -24279, 32609, -19520, -6393, 28105, -31357, 14009, 12539, -30852, 28897, -7962, -18205, 32412, -25330, 1607, 23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279};
|
||||
|
||||
|
||||
int16_t s_n_12_re[4032] = {23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279, 0, 24278, -32610, 19519, 6392, -28106, 31356, -14010, -12540, 30851, -28898, 7961, 18204, -32413, 25329, -1608, -23170, 32727, -20788, -4808, 27244, -31786, 15446, 11038, -30273, 29621, -9512, -16846, 32137, -26319, 3211, 22004, -32767, 22004, 3211, -26319, 32137, -16846, -9512, 29621, -30273, 11038, 15446, -31786, 27244, -4808, -20788, 32727, -23170, -1608, 25329, -32413, 18204, 7961, -28898, 30851, -12540, -14010, 31356, -28106, 6392, 19519, -32610, 24278, -1, -24279, 32609, -19520, -6393, 28105, -31357, 14009, 12539, -30852, 28897, -7962, -18205, 32412, -25330, 1607, 23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279, 0, 24278, -32610, 19519, 6392, -28106, 31356, -14010, -12540, 30851, -28898, 7961, 18204, -32413, 25329, -1608, -23170, 32727, -20788, -4808, 27244, -31786, 15446, 11038, -30273, 29621, -9512, -16846, 32137, -26319, 3211, 22004, -32767, 22004, 3211, -26319, 32137, -16846, -9512, 29621, -30273, 11038, 15446, -31786, 27244, -4808, -20788, 32727, -23170, -1608, 25329, -32413, 18204, 7961, -28898, 30851, -12540, -14010, 31356, -28106, 6392, 19519, -32610, 24278, -1, -24279, 32609, -19520, -6393, 28105, -31357, 14009, 12539, -30852, 28897, -7962, -18205, 32412, -25330, 1607, 23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279, 0, 24278, -32610, 19519, 6392, -28106, 31356, -14010, -12540, 30851, -28898, 7961, 18204, -32413, 25329, -1608, -23170, 32727, -20788, -4808, 27244, -31786, 15446, 11038, -30273, 29621, -9512, -16846, 32137, -26319, 3211, 22004,
|
||||
-23170, -4808, 28897, -29622, 6392, 22004, -32610, 16845, 12539, -31786, 25329, 1607, -27245, 30851, -9512, -19520, 32767, -19520, -9512, 30851, -27245, 1607, 25329, -31786, 12539, 16845, -32610, 22004, 6392, -29622, 28897, -4808, -23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, 0, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519, -32767, 19519, 9511, -30852, 27244, -1608, -25330, 31785, -12540, -16846, 32609, -22005, -6393, 29621, -28898, 4807, 23169, -32413, 15446, 14009, -32138, 24278, 3211, -28106, 30272, -7962, -20788, 32727, -18205, -11039, 31356, -26319, -1, 26318, -31357, 11038, 18204, -32728, 20787, 7961, -30273, 28105, -3212, -24279, 32137, -14010, -15447, 32412, -23170, -4808, 28897, -29622, 6392, 22004, -32610, 16845, 12539, -31786, 25329, 1607, -27245, 30851, -9512, -19520, 32767, -19520, -9512, 30851, -27245, 1607, 25329, -31786, 12539, 16845, -32610, 22004, 6392, -29622, 28897, -4808, -23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, -1, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519, -32767, 19519, 9511, -30852, 27244, -1608, -25330, 31785, -12540, -16846, 32609, -22005, -6393, 29621, -28898, 4807, 23169, -32413, 15446, 14009, -32138, 24278, 3211, -28106, 30272, -7962, -20788, 32727, -18205, -11039, 31356, -26319, 0, 26318, -31357, 11038, 18204, -32728, 20787, 7961, -30273, 28105, -3212, -24279, 32137, -14010, -15447, 32412, -23170, -4808, 28897, -29622, 6392, 22004, -32610, 16845, 12539, -31786, 25329, 1607, -27245, 30851, -9512, -19520, 32767, -19520, -9512, 30851, -27245, 1607, 25329, -31786, 12539, 16845, -32610, 22004, 6392, -29622, 28897, -4808, -23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, -1, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519,
|
||||
-23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106, -1, 28105, -28898, 1607, 27244, -29622, 3211, 26318, -30273, 4807, 25329, -30852, 6392, 24278, -31357, 7961, 23169, -31786, 9511, 22004, -32138, 11038, 20787, -32413, 12539, 19519, -32610, 14009, 18204, -32728, 15446, 16845, -32767, 16845, 15446, -32728, 18204, 14009, -32610, 19519, 12539, -32413, 20787, 11038, -32138, 22004, 9511, -31786, 23169, 7961, -31357, 24278, 6392, -30852, 25329, 4807, -30273, 26318, 3211, -29622, 27244, 1607, -28898, 28105, 0, -28106, 28897, -1608, -27245, 29621, -3212, -26319, 30272, -4808, -25330, 30851, -6393, -24279, 31356, -7962, -23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106, 0, 28105, -28898, 1607, 27244, -29622, 3211, 26318, -30273, 4807, 25329, -30852, 6392, 24278, -31357, 7961, 23169, -31786, 9511, 22004, -32138, 11038, 20787, -32413, 12539, 19519, -32610, 14009, 18204, -32728, 15446, 16845, -32767, 16845, 15446, -32728, 18204, 14009, -32610, 19519, 12539, -32413, 20787, 11038, -32138, 22004, 9511, -31786, 23169, 7961, -31357, 24278, 6392, -30852, 25329, 4807, -30273, 26318, 3211, -29622, 27244, 1607, -28898, 28105, -1, -28106, 28897, -1608, -27245, 29621, -3212, -26319, 30272, -4808, -25330, 30851, -6393, -24279, 31356, -7962, -23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106, 0, 28105, -28898, 1607, 27244, -29622, 3211, 26318, -30273, 4807, 25329, -30852, 6392, 24278, -31357, 7961, 23169, -31786, 9511, 22004, -32138, 11038, 20787, -32413, 12539, 19519, -32610, 14009, 18204, -32728, 15446, 16845,
|
||||
23169, 11038, -32610, 16845, 18204, -32413, 9511, 24278, -30273, 1607, 28897, -26319, -6393, 31785, -20788, -14010, 32767, -14010, -20788, 31785, -6393, -26319, 28897, 1607, -30273, 24278, 9511, -32413, 18204, 16845, -32610, 11038, 23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, 0, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009, -32767, 14009, 20787, -31786, 6392, 26318, -28898, -1608, 30272, -24279, -9512, 32412, -18205, -16846, 32609, -11039, -23170, 30851, -3212, -28106, 27244, 4807, -31357, 22004, 12539, -32728, 15446, 19519, -32138, 7961, 25329, -29622, -1, 29621, -25330, -7962, 32137, -19520, -15447, 32727, -12540, -22005, 31356, -4808, -27245, 28105, 3211, -30852, 23169, 11038, -32610, 16845, 18204, -32413, 9511, 24278, -30273, 1607, 28897, -26319, -6393, 31785, -20788, -14010, 32767, -14010, -20788, 31785, -6393, -26319, 28897, 1607, -30273, 24278, 9511, -32413, 18204, 16845, -32610, 11038, 23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, -1, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009, -32767, 14009, 20787, -31786, 6392, 26318, -28898, -1608, 30272, -24279, -9512, 32412, -18205, -16846, 32609, -11039, -23170, 30851, -3212, -28106, 27244, 4807, -31357, 22004, 12539, -32728, 15446, 19519, -32138, 7961, 25329, -29622, 0, 29621, -25330, -7962, 32137, -19520, -15447, 32727, -12540, -22005, 31356, -4808, -27245, 28105, 3211, -30852, 23169, 11038, -32610, 16845, 18204, -32413, 9511, 24278, -30273, 1607, 28897, -26319, -6393, 31785, -20788, -14010, 32767, -14010, -20788, 31785, -6393, -26319, 28897, 1607, -30273, 24278, 9511, -32413, 18204, 16845, -32610, 11038, 23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, -1, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009,
|
||||
23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852, 0, 30851, -20788, -16846, 32137, -4808, -28898, 24278, 12539, -32728, 9511, 26318, -27245, -7962, 32609, -14010, -23170, 29621, 3211, -31786, 18204, 19519, -31357, 1607, 30272, -22005, -15447, 32412, -6393, -28106, 25329, 11038, -32767, 11038, 25329, -28106, -6393, 32412, -15447, -22005, 30272, 1607, -31357, 19519, 18204, -31786, 3211, 29621, -23170, -14010, 32609, -7962, -27245, 26318, 9511, -32728, 12539, 24278, -28898, -4808, 32137, -16846, -20788, 30851, 0, -30852, 20787, 16845, -32138, 4807, 28897, -24279, -12540, 32727, -9512, -26319, 27244, 7961, -32610, 14009, 23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852, 0, 30851, -20788, -16846, 32137, -4808, -28898, 24278, 12539, -32728, 9511, 26318, -27245, -7962, 32609, -14010, -23170, 29621, 3211, -31786, 18204, 19519, -31357, 1607, 30272, -22005, -15447, 32412, -6393, -28106, 25329, 11038, -32767, 11038, 25329, -28106, -6393, 32412, -15447, -22005, 30272, 1607, -31357, 19519, 18204, -31786, 3211, 29621, -23170, -14010, 32609, -7962, -27245, 26318, 9511, -32728, 12539, 24278, -28898, -4808, 32137, -16846, -20788, 30851, -1, -30852, 20787, 16845, -32138, 4807, 28897, -24279, -12540, 32727, -9512, -26319, 27244, 7961, -32610, 14009, 23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852, 0, 30851, -20788, -16846, 32137, -4808, -28898, 24278, 12539, -32728, 9511, 26318, -27245, -7962, 32609, -14010, -23170, 29621, 3211, -31786, 18204, 19519, -31357, 1607, 30272, -22005, -15447, 32412, -6393, -28106, 25329, 11038,
|
||||
-23170, -16846, 31356, 1607, -32138, 14009, 25329, -26319, -12540, 32412, -3212, -30852, 18204, 22004, -28898, -7962, 32767, -7962, -28898, 22004, 18204, -30852, -3212, 32412, -12540, -26319, 25329, 14009, -32138, 1607, 31356, -16846, -23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, 0, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961, -32767, 7961, 28897, -22005, -18205, 30851, 3211, -32413, 12539, 26318, -25330, -14010, 32137, -1608, -31357, 16845, 23169, -28106, -9512, 32727, -6393, -29622, 20787, 19519, -30273, -4808, 32609, -11039, -27245, 24278, 15446, -31786, -1, 31785, -15447, -24279, 27244, 11038, -32610, 4807, 30272, -19520, -20788, 29621, 6392, -32728, 9511, 28105, -23170, -16846, 31356, 1607, -32138, 14009, 25329, -26319, -12540, 32412, -3212, -30852, 18204, 22004, -28898, -7962, 32767, -7962, -28898, 22004, 18204, -30852, -3212, 32412, -12540, -26319, 25329, 14009, -32138, 1607, 31356, -16846, -23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, -1, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961, -32767, 7961, 28897, -22005, -18205, 30851, 3211, -32413, 12539, 26318, -25330, -14010, 32137, -1608, -31357, 16845, 23169, -28106, -9512, 32727, -6393, -29622, 20787, 19519, -30273, -4808, 32609, -11039, -27245, 24278, 15446, -31786, 0, 31785, -15447, -24279, 27244, 11038, -32610, 4807, 30272, -19520, -20788, 29621, 6392, -32728, 9511, 28105, -23170, -16846, 31356, 1607, -32138, 14009, 25329, -26319, -12540, 32412, -3212, -30852, 18204, 22004, -28898, -7962, 32767, -7962, -28898, 22004, 18204, -30852, -3212, 32412, -12540, -26319, 25329, 14009, -32138, 1607, 31356, -16846, -23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, 0, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961,
|
||||
-23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413, -1, 32412, -9512, -29622, 18204, 24278, -25330, -16846, 30272, 7961, -32610, 1607, 32137, -11039, -28898, 19519, 23169, -26319, -15447, 30851, 6392, -32728, 3211, 31785, -12540, -28106, 20787, 22004, -27245, -14010, 31356, 4807, -32767, 4807, 31356, -14010, -27245, 22004, 20787, -28106, -12540, 31785, 3211, -32728, 6392, 30851, -15447, -26319, 23169, 19519, -28898, -11039, 32137, 1607, -32610, 7961, 30272, -16846, -25330, 24278, 18204, -29622, -9512, 32412, 0, -32413, 9511, 29621, -18205, -24279, 25329, 16845, -30273, -7962, 32609, -1608, -32138, 11038, 28897, -19520, -23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413, 0, 32412, -9512, -29622, 18204, 24278, -25330, -16846, 30272, 7961, -32610, 1607, 32137, -11039, -28898, 19519, 23169, -26319, -15447, 30851, 6392, -32728, 3211, 31785, -12540, -28106, 20787, 22004, -27245, -14010, 31356, 4807, -32767, 4807, 31356, -14010, -27245, 22004, 20787, -28106, -12540, 31785, 3211, -32728, 6392, 30851, -15447, -26319, 23169, 19519, -28898, -11039, 32137, 1607, -32610, 7961, 30272, -16846, -25330, 24278, 18204, -29622, -9512, 32412, -1, -32413, 9511, 29621, -18205, -24279, 25329, 16845, -30273, -7962, 32609, -1608, -32138, 11038, 28897, -19520, -23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413, 0, 32412, -9512, -29622, 18204, 24278, -25330, -16846, 30272, 7961, -32610, 1607, 32137, -11039, -28898, 19519, 23169, -26319, -15447, 30851, 6392, -32728, 3211, 31785, -12540, -28106, 20787, 22004, -27245, -14010, 31356, 4807,
|
||||
23169, 22004, -25330, -19520, 27244, 16845, -28898, -14010, 30272, 11038, -31357, -7962, 32137, 4807, -32610, -1608, 32767, -1608, -32610, 4807, 32137, -7962, -31357, 11038, 30272, -14010, -28898, 16845, 27244, -19520, -25330, 22004, 23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, 0, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607, -32767, 1607, 32609, -4808, -32138, 7961, 31356, -11039, -30273, 14009, 28897, -16846, -27245, 19519, 25329, -22005, -23170, 24278, 20787, -26319, -18205, 28105, 15446, -29622, -12540, 30851, 9511, -31786, -6393, 32412, 3211, -32728, -1, 32727, -3212, -32413, 6392, 31785, -9512, -30852, 12539, 29621, -15447, -28106, 18204, 26318, -20788, -24279, 23169, 22004, -25330, -19520, 27244, 16845, -28898, -14010, 30272, 11038, -31357, -7962, 32137, 4807, -32610, -1608, 32767, -1608, -32610, 4807, 32137, -7962, -31357, 11038, 30272, -14010, -28898, 16845, 27244, -19520, -25330, 22004, 23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, -1, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607, -32767, 1607, 32609, -4808, -32138, 7961, 31356, -11039, -30273, 14009, 28897, -16846, -27245, 19519, 25329, -22005, -23170, 24278, 20787, -26319, -18205, 28105, 15446, -29622, -12540, 30851, 9511, -31786, -6393, 32412, 3211, -32728, 0, 32727, -3212, -32413, 6392, 31785, -9512, -30852, 12539, 29621, -15447, -28106, 18204, 26318, -20788, -24279, 23169, 22004, -25330, -19520, 27244, 16845, -28898, -14010, 30272, 11038, -31357, -7962, 32137, 4807, -32610, -1608, 32767, -1608, -32610, 4807, 32137, -7962, -31357, 11038, 30272, -14010, -28898, 16845, 27244, -19520, -25330, 22004, 23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, 0, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607,
|
||||
23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728, -1, 32727, 3211, -32413, -6393, 31785, 9511, -30852, -12540, 29621, 15446, -28106, -18205, 26318, 20787, -24279, -23170, 22004, 25329, -19520, -27245, 16845, 28897, -14010, -30273, 11038, 31356, -7962, -32138, 4807, 32609, -1608, -32767, -1608, 32609, 4807, -32138, -7962, 31356, 11038, -30273, -14010, 28897, 16845, -27245, -19520, 25329, 22004, -23170, -24279, 20787, 26318, -18205, -28106, 15446, 29621, -12540, -30852, 9511, 31785, -6393, -32413, 3211, 32727, 0, -32728, -3212, 32412, 6392, -31786, -9512, 30851, 12539, -29622, -15447, 28105, 18204, -26319, -20788, 24278, 23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728, 0, 32727, 3211, -32413, -6393, 31785, 9511, -30852, -12540, 29621, 15446, -28106, -18205, 26318, 20787, -24279, -23170, 22004, 25329, -19520, -27245, 16845, 28897, -14010, -30273, 11038, 31356, -7962, -32138, 4807, 32609, -1608, -32767, -1608, 32609, 4807, -32138, -7962, 31356, 11038, -30273, -14010, 28897, 16845, -27245, -19520, 25329, 22004, -23170, -24279, 20787, 26318, -18205, -28106, 15446, 29621, -12540, -30852, 9511, 31785, -6393, -32413, 3211, 32727, -1, -32728, -3212, 32412, 6392, -31786, -9512, 30851, 12539, -29622, -15447, 28105, 18204, -26319, -20788, 24278, 23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728, -1, 32727, 3211, -32413, -6393, 31785, 9511, -30852, -12540, 29621, 15446, -28106, -18205, 26318, 20787, -24279, -23170, 22004, 25329, -19520, -27245, 16845, 28897, -14010, -30273, 11038, 31356, -7962, -32138, 4807, 32609, -1608,
|
||||
-23170, -26319, 15446, 30851, -6393, -32728, -3212, 31785, 12539, -28106, -20788, 22004, 27244, -14010, -31357, 4807, 32767, 4807, -31357, -14010, 27244, 22004, -20788, -28106, 12539, 31785, -3212, -32728, -6393, 30851, 15446, -26319, -23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, -1, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808, -32767, -4808, 31356, 14009, -27245, -22005, 20787, 28105, -12540, -31786, 3211, 32727, 6392, -30852, -15447, 26318, 23169, -19520, -28898, 11038, 32137, -1608, -32610, -7962, 30272, 16845, -25330, -24279, 18204, 29621, -9512, -32413, -1, 32412, 9511, -29622, -18205, 24278, 25329, -16846, -30273, 7961, 32609, 1607, -32138, -11039, 28897, 19519, -23170, -26319, 15446, 30851, -6393, -32728, -3212, 31785, 12539, -28106, -20788, 22004, 27244, -14010, -31357, 4807, 32767, 4807, -31357, -14010, 27244, 22004, -20788, -28106, 12539, 31785, -3212, -32728, -6393, 30851, 15446, -26319, -23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, -1, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808, -32767, -4808, 31356, 14009, -27245, -22005, 20787, 28105, -12540, -31786, 3211, 32727, 6392, -30852, -15447, 26318, 23169, -19520, -28898, 11038, 32137, -1608, -32610, -7962, 30272, 16845, -25330, -24279, 18204, 29621, -9512, -32413, 0, 32412, 9511, -29622, -18205, 24278, 25329, -16846, -30273, 7961, 32609, 1607, -32138, -11039, 28897, 19519, -23170, -26319, 15446, 30851, -6393, -32728, -3212, 31785, 12539, -28106, -20788, 22004, 27244, -14010, -31357, 4807, 32767, 4807, -31357, -14010, 27244, 22004, -20788, -28106, 12539, 31785, -3212, -32728, -6393, 30851, 15446, -26319, -23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, -1, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808,
|
||||
-23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786, -1, 31785, 15446, -24279, -27245, 11038, 32609, 4807, -30273, -19520, 20787, 29621, -6393, -32728, -9512, 28105, 23169, -16846, -31357, 1607, 32137, 14009, -25330, -26319, 12539, 32412, 3211, -30852, -18205, 22004, 28897, -7962, -32767, -7962, 28897, 22004, -18205, -30852, 3211, 32412, 12539, -26319, -25330, 14009, 32137, 1607, -31357, -16846, 23169, 28105, -9512, -32728, -6393, 29621, 20787, -19520, -30273, 4807, 32609, 11038, -27245, -24279, 15446, 31785, 0, -31786, -15447, 24278, 27244, -11039, -32610, -4808, 30272, 19519, -20788, -29622, 6392, 32727, 9511, -28106, -23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786, 0, 31785, 15446, -24279, -27245, 11038, 32609, 4807, -30273, -19520, 20787, 29621, -6393, -32728, -9512, 28105, 23169, -16846, -31357, 1607, 32137, 14009, -25330, -26319, 12539, 32412, 3211, -30852, -18205, 22004, 28897, -7962, -32767, -7962, 28897, 22004, -18205, -30852, 3211, 32412, 12539, -26319, -25330, 14009, 32137, 1607, -31357, -16846, 23169, 28105, -9512, -32728, -6393, 29621, 20787, -19520, -30273, 4807, 32609, 11038, -27245, -24279, 15446, 31785, -1, -31786, -15447, 24278, 27244, -11039, -32610, -4808, 30272, 19519, -20788, -29622, 6392, 32727, 9511, -28106, -23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786, -1, 31785, 15446, -24279, -27245, 11038, 32609, 4807, -30273, -19520, 20787, 29621, -6393, -32728, -9512, 28105, 23169, -16846, -31357, 1607, 32137, 14009, -25330, -26319, 12539, 32412, 3211, -30852, -18205, 22004, 28897, -7962,
|
||||
23169, 29621, -3212, -31786, -18205, 19519, 31356, 1607, -30273, -22005, 15446, 32412, 6392, -28106, -25330, 11038, 32767, 11038, -25330, -28106, 6392, 32412, 15446, -22005, -30273, 1607, 31356, 19519, -18205, -31786, -3212, 29621, 23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, -1, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039, -32767, -11039, 25329, 28105, -6393, -32413, -15447, 22004, 30272, -1608, -31357, -19520, 18204, 31785, 3211, -29622, -23170, 14009, 32609, 7961, -27245, -26319, 9511, 32727, 12539, -24279, -28898, 4807, 32137, 16845, -20788, -30852, -1, 30851, 20787, -16846, -32138, -4808, 28897, 24278, -12540, -32728, -9512, 26318, 27244, -7962, -32610, -14010, 23169, 29621, -3212, -31786, -18205, 19519, 31356, 1607, -30273, -22005, 15446, 32412, 6392, -28106, -25330, 11038, 32767, 11038, -25330, -28106, 6392, 32412, 15446, -22005, -30273, 1607, 31356, 19519, -18205, -31786, -3212, 29621, 23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, -1, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039, -32767, -11039, 25329, 28105, -6393, -32413, -15447, 22004, 30272, -1608, -31357, -19520, 18204, 31785, 3211, -29622, -23170, 14009, 32609, 7961, -27245, -26319, 9511, 32727, 12539, -24279, -28898, 4807, 32137, 16845, -20788, -30852, 0, 30851, 20787, -16846, -32138, -4808, 28897, 24278, -12540, -32728, -9512, 26318, 27244, -7962, -32610, -14010, 23169, 29621, -3212, -31786, -18205, 19519, 31356, 1607, -30273, -22005, 15446, 32412, 6392, -28106, -25330, 11038, 32767, 11038, -25330, -28106, 6392, 32412, 15446, -22005, -30273, 1607, 31356, 19519, -18205, -31786, -3212, 29621, 23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, -1, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039};
|
||||
|
||||
int16_t s_n_12_im[4032] = {-23170, -1608, 25329, -32413, 18204, 7961, -28898, 30851, -12540, -14010, 31356, -28106, 6392, 19519, -32610, 24278, 0, -24279, 32609, -19520, -6393, 28105, -31357, 14009, 12539, -30852, 28897, -7962, -18205, 32412, -25330, 1607, 23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279, 0, 24278, -32610, 19519, 6392, -28106, 31356, -14010, -12540, 30851, -28898, 7961, 18204, -32413, 25329, -1608, -23170, 32727, -20788, -4808, 27244, -31786, 15446, 11038, -30273, 29621, -9512, -16846, 32137, -26319, 3211, 22004, -32767, 22004, 3211, -26319, 32137, -16846, -9512, 29621, -30273, 11038, 15446, -31786, 27244, -4808, -20788, 32727, -23170, -1608, 25329, -32413, 18204, 7961, -28898, 30851, -12540, -14010, 31356, -28106, 6392, 19519, -32610, 24278, -1, -24279, 32609, -19520, -6393, 28105, -31357, 14009, 12539, -30852, 28897, -7962, -18205, 32412, -25330, 1607, 23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279, 0, 24278, -32610, 19519, 6392, -28106, 31356, -14010, -12540, 30851, -28898, 7961, 18204, -32413, 25329, -1608, -23170, 32727, -20788, -4808, 27244, -31786, 15446, 11038, -30273, 29621, -9512, -16846, 32137, -26319, 3211, 22004, -32767, 22004, 3211, -26319, 32137, -16846, -9512, 29621, -30273, 11038, 15446, -31786, 27244, -4808, -20788, 32727, -23170, -1608, 25329, -32413, 18204, 7961, -28898, 30851, -12540, -14010, 31356, -28106, 6392, 19519, -32610, 24278, -1, -24279, 32609, -19520, -6393, 28105, -31357, 14009, 12539, -30852, 28897, -7962, -18205, 32412, -25330, 1607, 23169, -32728, 20787, 4807, -27245, 31785, -15447, -11039, 30272, -29622, 9511, 16845, -32138, 26318, -3212, -22005, 32767, -22005, -3212, 26318, -32138, 16845, 9511, -29622, 30272, -11039, -15447, 31785, -27245, 4807, 20787, -32728, 23169, 1607, -25330, 32412, -18205, -7962, 28897, -30852, 12539, 14009, -31357, 28105, -6393, -19520, 32609, -24279,
|
||||
-23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, 0, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519, -32767, 19519, 9511, -30852, 27244, -1608, -25330, 31785, -12540, -16846, 32609, -22005, -6393, 29621, -28898, 4807, 23169, -32413, 15446, 14009, -32138, 24278, 3211, -28106, 30272, -7962, -20788, 32727, -18205, -11039, 31356, -26319, -1, 26318, -31357, 11038, 18204, -32728, 20787, 7961, -30273, 28105, -3212, -24279, 32137, -14010, -15447, 32412, -23170, -4808, 28897, -29622, 6392, 22004, -32610, 16845, 12539, -31786, 25329, 1607, -27245, 30851, -9512, -19520, 32767, -19520, -9512, 30851, -27245, 1607, 25329, -31786, 12539, 16845, -32610, 22004, 6392, -29622, 28897, -4808, -23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, 0, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519, -32767, 19519, 9511, -30852, 27244, -1608, -25330, 31785, -12540, -16846, 32609, -22005, -6393, 29621, -28898, 4807, 23169, -32413, 15446, 14009, -32138, 24278, 3211, -28106, 30272, -7962, -20788, 32727, -18205, -11039, 31356, -26319, 0, 26318, -31357, 11038, 18204, -32728, 20787, 7961, -30273, 28105, -3212, -24279, 32137, -14010, -15447, 32412, -23170, -4808, 28897, -29622, 6392, 22004, -32610, 16845, 12539, -31786, 25329, 1607, -27245, 30851, -9512, -19520, 32767, -19520, -9512, 30851, -27245, 1607, 25329, -31786, 12539, 16845, -32610, 22004, 6392, -29622, 28897, -4808, -23170, 32412, -15447, -14010, 32137, -24279, -3212, 28105, -30273, 7961, 20787, -32728, 18204, 11038, -31357, 26318, 0, -26319, 31356, -11039, -18205, 32727, -20788, -7962, 30272, -28106, 3211, 24278, -32138, 14009, 15446, -32413, 23169, 4807, -28898, 29621, -6393, -22005, 32609, -16846, -12540, 31785, -25330, -1608, 27244, -30852, 9511, 19519, -32767, 19519, 9511, -30852, 27244, -1608, -25330, 31785, -12540, -16846, 32609, -22005, -6393, 29621, -28898, 4807, 23169, -32413, 15446, 14009, -32138, 24278, 3211, -28106, 30272, -7962, -20788, 32727, -18205, -11039, 31356, -26319,
|
||||
23169, 7961, -31357, 24278, 6392, -30852, 25329, 4807, -30273, 26318, 3211, -29622, 27244, 1607, -28898, 28105, 0, -28106, 28897, -1608, -27245, 29621, -3212, -26319, 30272, -4808, -25330, 30851, -6393, -24279, 31356, -7962, -23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106, -1, 28105, -28898, 1607, 27244, -29622, 3211, 26318, -30273, 4807, 25329, -30852, 6392, 24278, -31357, 7961, 23169, -31786, 9511, 22004, -32138, 11038, 20787, -32413, 12539, 19519, -32610, 14009, 18204, -32728, 15446, 16845, -32767, 16845, 15446, -32728, 18204, 14009, -32610, 19519, 12539, -32413, 20787, 11038, -32138, 22004, 9511, -31786, 23169, 7961, -31357, 24278, 6392, -30852, 25329, 4807, -30273, 26318, 3211, -29622, 27244, 1607, -28898, 28105, 0, -28106, 28897, -1608, -27245, 29621, -3212, -26319, 30272, -4808, -25330, 30851, -6393, -24279, 31356, -7962, -23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106, 0, 28105, -28898, 1607, 27244, -29622, 3211, 26318, -30273, 4807, 25329, -30852, 6392, 24278, -31357, 7961, 23169, -31786, 9511, 22004, -32138, 11038, 20787, -32413, 12539, 19519, -32610, 14009, 18204, -32728, 15446, 16845, -32767, 16845, 15446, -32728, 18204, 14009, -32610, 19519, 12539, -32413, 20787, 11038, -32138, 22004, 9511, -31786, 23169, 7961, -31357, 24278, 6392, -30852, 25329, 4807, -30273, 26318, 3211, -29622, 27244, 1607, -28898, 28105, 0, -28106, 28897, -1608, -27245, 29621, -3212, -26319, 30272, -4808, -25330, 30851, -6393, -24279, 31356, -7962, -23170, 31785, -9512, -22005, 32137, -11039, -20788, 32412, -12540, -19520, 32609, -14010, -18205, 32727, -15447, -16846, 32767, -16846, -15447, 32727, -18205, -14010, 32609, -19520, -12540, 32412, -20788, -11039, 32137, -22005, -9512, 31785, -23170, -7962, 31356, -24279, -6393, 30851, -25330, -4808, 30272, -26319, -3212, 29621, -27245, -1608, 28897, -28106,
|
||||
23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, 0, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009, -32767, 14009, 20787, -31786, 6392, 26318, -28898, -1608, 30272, -24279, -9512, 32412, -18205, -16846, 32609, -11039, -23170, 30851, -3212, -28106, 27244, 4807, -31357, 22004, 12539, -32728, 15446, 19519, -32138, 7961, 25329, -29622, -1, 29621, -25330, -7962, 32137, -19520, -15447, 32727, -12540, -22005, 31356, -4808, -27245, 28105, 3211, -30852, 23169, 11038, -32610, 16845, 18204, -32413, 9511, 24278, -30273, 1607, 28897, -26319, -6393, 31785, -20788, -14010, 32767, -14010, -20788, 31785, -6393, -26319, 28897, 1607, -30273, 24278, 9511, -32413, 18204, 16845, -32610, 11038, 23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, 0, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009, -32767, 14009, 20787, -31786, 6392, 26318, -28898, -1608, 30272, -24279, -9512, 32412, -18205, -16846, 32609, -11039, -23170, 30851, -3212, -28106, 27244, 4807, -31357, 22004, 12539, -32728, 15446, 19519, -32138, 7961, 25329, -29622, 0, 29621, -25330, -7962, 32137, -19520, -15447, 32727, -12540, -22005, 31356, -4808, -27245, 28105, 3211, -30852, 23169, 11038, -32610, 16845, 18204, -32413, 9511, 24278, -30273, 1607, 28897, -26319, -6393, 31785, -20788, -14010, 32767, -14010, -20788, 31785, -6393, -26319, 28897, 1607, -30273, 24278, 9511, -32413, 18204, 16845, -32610, 11038, 23169, -30852, 3211, 28105, -27245, -4808, 31356, -22005, -12540, 32727, -15447, -19520, 32137, -7962, -25330, 29621, 0, -29622, 25329, 7961, -32138, 19519, 15446, -32728, 12539, 22004, -31357, 4807, 27244, -28106, -3212, 30851, -23170, -11039, 32609, -16846, -18205, 32412, -9512, -24279, 30272, -1608, -28898, 26318, 6392, -31786, 20787, 14009, -32767, 14009, 20787, -31786, 6392, 26318, -28898, -1608, 30272, -24279, -9512, 32412, -18205, -16846, 32609, -11039, -23170, 30851, -3212, -28106, 27244, 4807, -31357, 22004, 12539, -32728, 15446, 19519, -32138, 7961, 25329, -29622,
|
||||
-23170, -14010, 32609, -7962, -27245, 26318, 9511, -32728, 12539, 24278, -28898, -4808, 32137, -16846, -20788, 30851, 0, -30852, 20787, 16845, -32138, 4807, 28897, -24279, -12540, 32727, -9512, -26319, 27244, 7961, -32610, 14009, 23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852, 0, 30851, -20788, -16846, 32137, -4808, -28898, 24278, 12539, -32728, 9511, 26318, -27245, -7962, 32609, -14010, -23170, 29621, 3211, -31786, 18204, 19519, -31357, 1607, 30272, -22005, -15447, 32412, -6393, -28106, 25329, 11038, -32767, 11038, 25329, -28106, -6393, 32412, -15447, -22005, 30272, 1607, -31357, 19519, 18204, -31786, 3211, 29621, -23170, -14010, 32609, -7962, -27245, 26318, 9511, -32728, 12539, 24278, -28898, -4808, 32137, -16846, -20788, 30851, -1, -30852, 20787, 16845, -32138, 4807, 28897, -24279, -12540, 32727, -9512, -26319, 27244, 7961, -32610, 14009, 23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852, 0, 30851, -20788, -16846, 32137, -4808, -28898, 24278, 12539, -32728, 9511, 26318, -27245, -7962, 32609, -14010, -23170, 29621, 3211, -31786, 18204, 19519, -31357, 1607, 30272, -22005, -15447, 32412, -6393, -28106, 25329, 11038, -32767, 11038, 25329, -28106, -6393, 32412, -15447, -22005, 30272, 1607, -31357, 19519, 18204, -31786, 3211, 29621, -23170, -14010, 32609, -7962, -27245, 26318, 9511, -32728, 12539, 24278, -28898, -4808, 32137, -16846, -20788, 30851, -1, -30852, 20787, 16845, -32138, 4807, 28897, -24279, -12540, 32727, -9512, -26319, 27244, 7961, -32610, 14009, 23169, -29622, -3212, 31785, -18205, -19520, 31356, -1608, -30273, 22004, 15446, -32413, 6392, 28105, -25330, -11039, 32767, -11039, -25330, 28105, 6392, -32413, 15446, 22004, -30273, -1608, 31356, -19520, -18205, 31785, -3212, -29622, 23169, 14009, -32610, 7961, 27244, -26319, -9512, 32727, -12540, -24279, 28897, 4807, -32138, 16845, 20787, -30852,
|
||||
-23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, 0, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961, -32767, 7961, 28897, -22005, -18205, 30851, 3211, -32413, 12539, 26318, -25330, -14010, 32137, -1608, -31357, 16845, 23169, -28106, -9512, 32727, -6393, -29622, 20787, 19519, -30273, -4808, 32609, -11039, -27245, 24278, 15446, -31786, -1, 31785, -15447, -24279, 27244, 11038, -32610, 4807, 30272, -19520, -20788, 29621, 6392, -32728, 9511, 28105, -23170, -16846, 31356, 1607, -32138, 14009, 25329, -26319, -12540, 32412, -3212, -30852, 18204, 22004, -28898, -7962, 32767, -7962, -28898, 22004, 18204, -30852, -3212, 32412, -12540, -26319, 25329, 14009, -32138, 1607, 31356, -16846, -23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, 0, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961, -32767, 7961, 28897, -22005, -18205, 30851, 3211, -32413, 12539, 26318, -25330, -14010, 32137, -1608, -31357, 16845, 23169, -28106, -9512, 32727, -6393, -29622, 20787, 19519, -30273, -4808, 32609, -11039, -27245, 24278, 15446, -31786, 0, 31785, -15447, -24279, 27244, 11038, -32610, 4807, 30272, -19520, -20788, 29621, 6392, -32728, 9511, 28105, -23170, -16846, 31356, 1607, -32138, 14009, 25329, -26319, -12540, 32412, -3212, -30852, 18204, 22004, -28898, -7962, 32767, -7962, -28898, 22004, 18204, -30852, -3212, 32412, -12540, -26319, 25329, 14009, -32138, 1607, 31356, -16846, -23170, 28105, 9511, -32728, 6392, 29621, -20788, -19520, 30272, 4807, -32610, 11038, 27244, -24279, -15447, 31785, 0, -31786, 15446, 24278, -27245, -11039, 32609, -4808, -30273, 19519, 20787, -29622, -6393, 32727, -9512, -28106, 23169, 16845, -31357, -1608, 32137, -14010, -25330, 26318, 12539, -32413, 3211, 30851, -18205, -22005, 28897, 7961, -32767, 7961, 28897, -22005, -18205, 30851, 3211, -32413, 12539, 26318, -25330, -14010, 32137, -1608, -31357, 16845, 23169, -28106, -9512, 32727, -6393, -29622, 20787, 19519, -30273, -4808, 32609, -11039, -27245, 24278, 15446, -31786,
|
||||
23169, 19519, -28898, -11039, 32137, 1607, -32610, 7961, 30272, -16846, -25330, 24278, 18204, -29622, -9512, 32412, 0, -32413, 9511, 29621, -18205, -24279, 25329, 16845, -30273, -7962, 32609, -1608, -32138, 11038, 28897, -19520, -23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413, -1, 32412, -9512, -29622, 18204, 24278, -25330, -16846, 30272, 7961, -32610, 1607, 32137, -11039, -28898, 19519, 23169, -26319, -15447, 30851, 6392, -32728, 3211, 31785, -12540, -28106, 20787, 22004, -27245, -14010, 31356, 4807, -32767, 4807, 31356, -14010, -27245, 22004, 20787, -28106, -12540, 31785, 3211, -32728, 6392, 30851, -15447, -26319, 23169, 19519, -28898, -11039, 32137, 1607, -32610, 7961, 30272, -16846, -25330, 24278, 18204, -29622, -9512, 32412, 0, -32413, 9511, 29621, -18205, -24279, 25329, 16845, -30273, -7962, 32609, -1608, -32138, 11038, 28897, -19520, -23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413, 0, 32412, -9512, -29622, 18204, 24278, -25330, -16846, 30272, 7961, -32610, 1607, 32137, -11039, -28898, 19519, 23169, -26319, -15447, 30851, 6392, -32728, 3211, 31785, -12540, -28106, 20787, 22004, -27245, -14010, 31356, 4807, -32767, 4807, 31356, -14010, -27245, 22004, 20787, -28106, -12540, 31785, 3211, -32728, 6392, 30851, -15447, -26319, 23169, 19519, -28898, -11039, 32137, 1607, -32610, 7961, 30272, -16846, -25330, 24278, 18204, -29622, -9512, 32412, 0, -32413, 9511, 29621, -18205, -24279, 25329, 16845, -30273, -7962, 32609, -1608, -32138, 11038, 28897, -19520, -23170, 26318, 15446, -30852, -6393, 32727, -3212, -31786, 12539, 28105, -20788, -22005, 27244, 14009, -31357, -4808, 32767, -4808, -31357, 14009, 27244, -22005, -20788, 28105, 12539, -31786, -3212, 32727, -6393, -30852, 15446, 26318, -23170, -19520, 28897, 11038, -32138, -1608, 32609, -7962, -30273, 16845, 25329, -24279, -18205, 29621, 9511, -32413,
|
||||
23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, 0, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607, -32767, 1607, 32609, -4808, -32138, 7961, 31356, -11039, -30273, 14009, 28897, -16846, -27245, 19519, 25329, -22005, -23170, 24278, 20787, -26319, -18205, 28105, 15446, -29622, -12540, 30851, 9511, -31786, -6393, 32412, 3211, -32728, -1, 32727, -3212, -32413, 6392, 31785, -9512, -30852, 12539, 29621, -15447, -28106, 18204, 26318, -20788, -24279, 23169, 22004, -25330, -19520, 27244, 16845, -28898, -14010, 30272, 11038, -31357, -7962, 32137, 4807, -32610, -1608, 32767, -1608, -32610, 4807, 32137, -7962, -31357, 11038, 30272, -14010, -28898, 16845, 27244, -19520, -25330, 22004, 23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, 0, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607, -32767, 1607, 32609, -4808, -32138, 7961, 31356, -11039, -30273, 14009, 28897, -16846, -27245, 19519, 25329, -22005, -23170, 24278, 20787, -26319, -18205, 28105, 15446, -29622, -12540, 30851, 9511, -31786, -6393, 32412, 3211, -32728, 0, 32727, -3212, -32413, 6392, 31785, -9512, -30852, 12539, 29621, -15447, -28106, 18204, 26318, -20788, -24279, 23169, 22004, -25330, -19520, 27244, 16845, -28898, -14010, 30272, 11038, -31357, -7962, 32137, 4807, -32610, -1608, 32767, -1608, -32610, 4807, 32137, -7962, -31357, 11038, 30272, -14010, -28898, 16845, 27244, -19520, -25330, 22004, 23169, -24279, -20788, 26318, 18204, -28106, -15447, 29621, 12539, -30852, -9512, 31785, 6392, -32413, -3212, 32727, 0, -32728, 3211, 32412, -6393, -31786, 9511, 30851, -12540, -29622, 15446, 28105, -18205, -26319, 20787, 24278, -23170, -22005, 25329, 19519, -27245, -16846, 28897, 14009, -30273, -11039, 31356, 7961, -32138, -4808, 32609, 1607, -32767, 1607, 32609, -4808, -32138, 7961, 31356, -11039, -30273, 14009, 28897, -16846, -27245, 19519, 25329, -22005, -23170, 24278, 20787, -26319, -18205, 28105, 15446, -29622, -12540, 30851, 9511, -31786, -6393, 32412, 3211, -32728,
|
||||
-23170, -24279, 20787, 26318, -18205, -28106, 15446, 29621, -12540, -30852, 9511, 31785, -6393, -32413, 3211, 32727, 0, -32728, -3212, 32412, 6392, -31786, -9512, 30851, 12539, -29622, -15447, 28105, 18204, -26319, -20788, 24278, 23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728, -1, 32727, 3211, -32413, -6393, 31785, 9511, -30852, -12540, 29621, 15446, -28106, -18205, 26318, 20787, -24279, -23170, 22004, 25329, -19520, -27245, 16845, 28897, -14010, -30273, 11038, 31356, -7962, -32138, 4807, 32609, -1608, -32767, -1608, 32609, 4807, -32138, -7962, 31356, 11038, -30273, -14010, 28897, 16845, -27245, -19520, 25329, 22004, -23170, -24279, 20787, 26318, -18205, -28106, 15446, 29621, -12540, -30852, 9511, 31785, -6393, -32413, 3211, 32727, 0, -32728, -3212, 32412, 6392, -31786, -9512, 30851, 12539, -29622, -15447, 28105, 18204, -26319, -20788, 24278, 23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728, 0, 32727, 3211, -32413, -6393, 31785, 9511, -30852, -12540, 29621, 15446, -28106, -18205, 26318, 20787, -24279, -23170, 22004, 25329, -19520, -27245, 16845, 28897, -14010, -30273, 11038, 31356, -7962, -32138, 4807, 32609, -1608, -32767, -1608, 32609, 4807, -32138, -7962, 31356, 11038, -30273, -14010, 28897, 16845, -27245, -19520, 25329, 22004, -23170, -24279, 20787, 26318, -18205, -28106, 15446, 29621, -12540, -30852, 9511, 31785, -6393, -32413, 3211, 32727, 0, -32728, -3212, 32412, 6392, -31786, -9512, 30851, 12539, -29622, -15447, 28105, 18204, -26319, -20788, 24278, 23169, -22005, -25330, 19519, 27244, -16846, -28898, 14009, 30272, -11039, -31357, 7961, 32137, -4808, -32610, 1607, 32767, 1607, -32610, -4808, 32137, 7961, -31357, -11039, 30272, 14009, -28898, -16846, 27244, 19519, -25330, -22005, 23169, 24278, -20788, -26319, 18204, 28105, -15447, -29622, 12539, 30851, -9512, -31786, 6392, 32412, -3212, -32728,
|
||||
-23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, 0, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808, -32767, -4808, 31356, 14009, -27245, -22005, 20787, 28105, -12540, -31786, 3211, 32727, 6392, -30852, -15447, 26318, 23169, -19520, -28898, 11038, 32137, -1608, -32610, -7962, 30272, 16845, -25330, -24279, 18204, 29621, -9512, -32413, 0, 32412, 9511, -29622, -18205, 24278, 25329, -16846, -30273, 7961, 32609, 1607, -32138, -11039, 28897, 19519, -23170, -26319, 15446, 30851, -6393, -32728, -3212, 31785, 12539, -28106, -20788, 22004, 27244, -14010, -31357, 4807, 32767, 4807, -31357, -14010, 27244, 22004, -20788, -28106, 12539, 31785, -3212, -32728, -6393, 30851, 15446, -26319, -23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, -1, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808, -32767, -4808, 31356, 14009, -27245, -22005, 20787, 28105, -12540, -31786, 3211, 32727, 6392, -30852, -15447, 26318, 23169, -19520, -28898, 11038, 32137, -1608, -32610, -7962, 30272, 16845, -25330, -24279, 18204, 29621, -9512, -32413, 0, 32412, 9511, -29622, -18205, 24278, 25329, -16846, -30273, 7961, 32609, 1607, -32138, -11039, 28897, 19519, -23170, -26319, 15446, 30851, -6393, -32728, -3212, 31785, 12539, -28106, -20788, 22004, 27244, -14010, -31357, 4807, 32767, 4807, -31357, -14010, 27244, 22004, -20788, -28106, 12539, 31785, -3212, -32728, -6393, 30851, 15446, -26319, -23170, 19519, 28897, -11039, -32138, 1607, 32609, 7961, -30273, -16846, 25329, 24278, -18205, -29622, 9511, 32412, -1, -32413, -9512, 29621, 18204, -24279, -25330, 16845, 30272, -7962, -32610, -1608, 32137, 11038, -28898, -19520, 23169, 26318, -15447, -30852, 6392, 32727, 3211, -31786, -12540, 28105, 20787, -22005, -27245, 14009, 31356, -4808, -32767, -4808, 31356, 14009, -27245, -22005, 20787, 28105, -12540, -31786, 3211, 32727, 6392, -30852, -15447, 26318, 23169, -19520, -28898, 11038, 32137, -1608, -32610, -7962, 30272, 16845, -25330, -24279, 18204, 29621, -9512, -32413,
|
||||
23169, 28105, -9512, -32728, -6393, 29621, 20787, -19520, -30273, 4807, 32609, 11038, -27245, -24279, 15446, 31785, 0, -31786, -15447, 24278, 27244, -11039, -32610, -4808, 30272, 19519, -20788, -29622, 6392, 32727, 9511, -28106, -23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786, -1, 31785, 15446, -24279, -27245, 11038, 32609, 4807, -30273, -19520, 20787, 29621, -6393, -32728, -9512, 28105, 23169, -16846, -31357, 1607, 32137, 14009, -25330, -26319, 12539, 32412, 3211, -30852, -18205, 22004, 28897, -7962, -32767, -7962, 28897, 22004, -18205, -30852, 3211, 32412, 12539, -26319, -25330, 14009, 32137, 1607, -31357, -16846, 23169, 28105, -9512, -32728, -6393, 29621, 20787, -19520, -30273, 4807, 32609, 11038, -27245, -24279, 15446, 31785, 0, -31786, -15447, 24278, 27244, -11039, -32610, -4808, 30272, 19519, -20788, -29622, 6392, 32727, 9511, -28106, -23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786, 0, 31785, 15446, -24279, -27245, 11038, 32609, 4807, -30273, -19520, 20787, 29621, -6393, -32728, -9512, 28105, 23169, -16846, -31357, 1607, 32137, 14009, -25330, -26319, 12539, 32412, 3211, -30852, -18205, 22004, 28897, -7962, -32767, -7962, 28897, 22004, -18205, -30852, 3211, 32412, 12539, -26319, -25330, 14009, 32137, 1607, -31357, -16846, 23169, 28105, -9512, -32728, -6393, 29621, 20787, -19520, -30273, 4807, 32609, 11038, -27245, -24279, 15446, 31785, 0, -31786, -15447, 24278, 27244, -11039, -32610, -4808, 30272, 19519, -20788, -29622, 6392, 32727, 9511, -28106, -23170, 16845, 31356, -1608, -32138, -14010, 25329, 26318, -12540, -32413, -3212, 30851, 18204, -22005, -28898, 7961, 32767, 7961, -28898, -22005, 18204, 30851, -3212, -32413, -12540, 26318, 25329, -14010, -32138, -1608, 31356, 16845, -23170, -28106, 9511, 32727, 6392, -29622, -20788, 19519, 30272, -4808, -32610, -11039, 27244, 24278, -15447, -31786,
|
||||
23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, 0, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039, -32767, -11039, 25329, 28105, -6393, -32413, -15447, 22004, 30272, -1608, -31357, -19520, 18204, 31785, 3211, -29622, -23170, 14009, 32609, 7961, -27245, -26319, 9511, 32727, 12539, -24279, -28898, 4807, 32137, 16845, -20788, -30852, 0, 30851, 20787, -16846, -32138, -4808, 28897, 24278, -12540, -32728, -9512, 26318, 27244, -7962, -32610, -14010, 23169, 29621, -3212, -31786, -18205, 19519, 31356, 1607, -30273, -22005, 15446, 32412, 6392, -28106, -25330, 11038, 32767, 11038, -25330, -28106, 6392, 32412, 15446, -22005, -30273, 1607, 31356, 19519, -18205, -31786, -3212, 29621, 23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, -1, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039, -32767, -11039, 25329, 28105, -6393, -32413, -15447, 22004, 30272, -1608, -31357, -19520, 18204, 31785, 3211, -29622, -23170, 14009, 32609, 7961, -27245, -26319, 9511, 32727, 12539, -24279, -28898, 4807, 32137, 16845, -20788, -30852, 0, 30851, 20787, -16846, -32138, -4808, 28897, 24278, -12540, -32728, -9512, 26318, 27244, -7962, -32610, -14010, 23169, 29621, -3212, -31786, -18205, 19519, 31356, 1607, -30273, -22005, 15446, 32412, 6392, -28106, -25330, 11038, 32767, 11038, -25330, -28106, 6392, 32412, 15446, -22005, -30273, 1607, 31356, 19519, -18205, -31786, -3212, 29621, 23169, -14010, -32610, -7962, 27244, 26318, -9512, -32728, -12540, 24278, 28897, -4808, -32138, -16846, 20787, 30851, -1, -30852, -20788, 16845, 32137, 4807, -28898, -24279, 12539, 32727, 9511, -26319, -27245, 7961, 32609, 14009, -23170, -29622, 3211, 31785, 18204, -19520, -31357, -1608, 30272, 22004, -15447, -32413, -6393, 28105, 25329, -11039, -32767, -11039, 25329, 28105, -6393, -32413, -15447, 22004, 30272, -1608, -31357, -19520, 18204, 31785, 3211, -29622, -23170, 14009, 32609, 7961, -27245, -26319, 9511, 32727, 12539, -24279, -28898, 4807, 32137, 16845, -20788, -30852};
|
||||
173
openair1/PHY/LTE_TRANSPORT/group_hopping_NB_IoT.c
Normal file
173
openair1/PHY/LTE_TRANSPORT/group_hopping_NB_IoT.c
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/group_hopping.c
|
||||
* \brief Top-level routines for group hopping for DMRS from 36.211 R14, Section 10.1.4.1.3
|
||||
* \author Vincent Savaux
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company b<>com
|
||||
* \email: vincent.savaux@b<>com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include <math.h>
|
||||
|
||||
//#define DEBUG_GROUPHOP 1
|
||||
|
||||
void generate_grouphop_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
|
||||
uint8_t ns;
|
||||
uint8_t reset=1;
|
||||
uint32_t x1, x2, s=0;
|
||||
uint16_t Nseq_RU[4] = {16,12,14,30}; // Table 10.1.4.1.3-1
|
||||
// This is from Section 10.1.4.1.3
|
||||
uint32_t fss_npusch_nn = frame_parms->Nid_cell + frame_parms->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupAssignmentNPUSCH;
|
||||
uint32_t fss_npusch;
|
||||
int k;
|
||||
|
||||
if (frame_parms->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled){
|
||||
|
||||
for (k=0;k<4;k++){ // all four possible sucarrier configurations
|
||||
fss_npusch = fss_npusch_nn % Nseq_RU[k];
|
||||
x2 = (uint32_t) floor(frame_parms->Nid_cell/Nseq_RU[k]);
|
||||
|
||||
// x2 = frame_parms->Nid_cell/30;
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
printf("[PHY] GroupHop:");
|
||||
#endif
|
||||
|
||||
for (ns=0; ns<20; ns++) { // slot number
|
||||
// if (k==0){ // 1 subcarrier --> initialize at the beginning of the sequence
|
||||
if ((ns&3) == 0) {
|
||||
s = lte_gold_generic_NB_IoT(&x1,&x2,reset);
|
||||
reset = 0;
|
||||
}
|
||||
// }else{ // 3, 6, 12 subcarriers --> initialize at every even slot number
|
||||
// if ((ns%2) == 0) {
|
||||
// s = lte_gold_generic_NB_IoT(&x1,&x2,reset);
|
||||
// reset = 1;
|
||||
// }
|
||||
// }
|
||||
|
||||
frame_parms->npusch_config_common.ul_ReferenceSignalsNPUSCH.grouphop[ns][k] = (((uint8_t*)&s)[ns&3]%Nseq_RU[k]+fss_npusch)%Nseq_RU[k];
|
||||
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
printf("%d.",frame_parms->npusch_config_common.ul_ReferenceSignalsNPUSCH.grouphop[ns]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for (ns=0; ns<20; ns++) {
|
||||
for (k=0;k<4;k++){
|
||||
frame_parms->npusch_config_common.ul_ReferenceSignalsNPUSCH.grouphop[ns][k] = frame_parms->Nid_cell % Nseq_RU[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
printf("\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// void generate_seqhop(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
// {
|
||||
|
||||
// uint8_t ns,reset=1;
|
||||
// uint32_t x1, x2, s=0;
|
||||
// // This is from Section 5.5.1.3
|
||||
// uint32_t fss_pusch = frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
|
||||
|
||||
// x2 = (32*(frame_parms->Nid_cell/30) + fss_pusch)%30;
|
||||
|
||||
// s = lte_gold_generic(&x1,&x2,reset);
|
||||
// #ifdef DEBUG_GROUPHOP
|
||||
// printf("[PHY] SeqHop:");
|
||||
// #endif
|
||||
|
||||
// for (ns=0; ns<20; ns++) {
|
||||
// if ((frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled == 0) &&
|
||||
// (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled == 1))
|
||||
// frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns] = (s>>(ns&0x1f))&1;
|
||||
// else
|
||||
// frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns] = 0;
|
||||
|
||||
// #ifdef DEBUG_GROUPHOP
|
||||
// printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns]);
|
||||
// #endif
|
||||
// }
|
||||
|
||||
// #ifdef DEBUG_GROUPHOP
|
||||
// printf("\n");
|
||||
// #endif
|
||||
// }
|
||||
|
||||
// void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
// {
|
||||
|
||||
// uint16_t n=0;
|
||||
// uint8_t reset=1;
|
||||
// uint32_t x1, x2, s=0;
|
||||
// // This is from Section 5.5.1.3
|
||||
// uint8_t Nsymb_UL = (frame_parms->Ncp_UL == NORMAL) ? 7 : 6;
|
||||
// uint16_t next = 0;
|
||||
// uint8_t ns=0;
|
||||
|
||||
// uint32_t fss_pucch = (frame_parms->Nid_cell) % 30;
|
||||
// uint32_t fss_pusch = (fss_pucch + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH) % 30;
|
||||
|
||||
// x2 = (32*(uint32_t)(frame_parms->Nid_cell/30)) + fss_pusch;
|
||||
// #ifdef DEBUG_GROUPHOP
|
||||
// printf("[PHY] nPRS:");
|
||||
// #endif
|
||||
|
||||
// for (n=0; n<(20*Nsymb_UL); n++) { //loop over total number of bytes to generate
|
||||
// if ((n&3) == 0) {
|
||||
// s = lte_gold_generic(&x1,&x2,reset);
|
||||
// reset = 0;
|
||||
// // printf("n %d : s (%d,%d,%d,%d)\n",n,((uint8_t*)&s)[0],((uint8_t*)&s)[1],((uint8_t*)&s)[2],((uint8_t*)&s)[3]);
|
||||
// }
|
||||
|
||||
// if (n == next) {
|
||||
// frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns] = ((uint8_t*)&s)[next&3];
|
||||
// #ifdef DEBUG_GROUPHOP
|
||||
// printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns]);
|
||||
// #endif
|
||||
// ns++;
|
||||
// next+=Nsymb_UL;
|
||||
// }
|
||||
// }
|
||||
|
||||
// #ifdef DEBUG_GROUPHOP
|
||||
// printf("\n");
|
||||
// #endif
|
||||
// }
|
||||
|
||||
void init_ul_hopping_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
|
||||
////////////////////////////////////////generate_grouphop(frame_parms);
|
||||
// generate_seqhop(frame_parms);
|
||||
// generate_nPRS(frame_parms);
|
||||
}
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "SCHED/extern.h"
|
||||
#include "defs.h"
|
||||
#include "extern.h"
|
||||
#include "PHY/LTE_REFSIG/defs.h"
|
||||
|
||||
|
||||
#include "common_lib.h"
|
||||
|
||||
252
openair1/PHY/LTE_TRANSPORT/lte_Isc_NB_IoT.c
Normal file
252
openair1/PHY/LTE_TRANSPORT/lte_Isc_NB_IoT.c
Normal file
@@ -0,0 +1,252 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/lte_mcs_NB_IoT.c
|
||||
* \brief Some support routines for subcarrier start into UL RB for ULSCH
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company b<>com
|
||||
* \email:
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
//#include "PHY/defs.h"
|
||||
//#include "PHY/extern.h"
|
||||
#include "PHY/LTE_TRANSPORT/proto_NB_IoT.h"
|
||||
|
||||
uint8_t tab_ack_15khz[16]= {0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3};
|
||||
uint8_t tab_ack_3_75khz[16]= {38,39,40,41,42,43,44,45,38,39,40,41,42,43,44,45};
|
||||
uint8_t tab_I_ru_N_ru_UL[8]= {1,2,3,4,5,6,8,10};
|
||||
uint8_t tab_I_rep_N_rep_UL[8]={1,2,4,8,16,32,64,128};
|
||||
|
||||
///
|
||||
uint8_t tab_ack_sc_format1[16]={0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3};
|
||||
uint8_t tab_ack_sc_format2[16]={38,39,40,41,42,43,44,45,38,39,40,41,42,43,44,45};
|
||||
/*
|
||||
// Section 16.5.1.1 in 36.213
|
||||
uint16_t get_UL_sc_start_NB_IoT(uint16_t I_sc)
|
||||
{
|
||||
|
||||
if (0<=I_sc && I_sc<=11)
|
||||
{
|
||||
return I_sc;
|
||||
|
||||
} else if (12<=I_sc && I_sc<=15) {
|
||||
|
||||
return 3*(I_sc-12);
|
||||
|
||||
} else if (16<=I_sc && I_sc<=17) {
|
||||
|
||||
return 6*(I_sc-16);
|
||||
|
||||
} else if (I_sc==18){
|
||||
|
||||
return 0;
|
||||
|
||||
} else if (I_sc>18 || I_sc<0){
|
||||
|
||||
return -1; /// error msg is needed for this case
|
||||
|
||||
} else {
|
||||
|
||||
return -1; /// error msg is needed for this case
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
uint16_t get_UL_N_rep_NB_IoT(uint8_t I_rep)
|
||||
{
|
||||
return tab_I_rep_N_rep_UL[I_rep];
|
||||
}
|
||||
|
||||
uint16_t get_UL_N_ru_NB_IoT(uint8_t I_mcs, uint8_t I_ru, uint8_t flag_msg3)
|
||||
{
|
||||
|
||||
if(flag_msg3 ==1) // msg3
|
||||
{
|
||||
|
||||
if(I_mcs == 0)
|
||||
{
|
||||
return 4;
|
||||
|
||||
} else if(I_mcs == 1) {
|
||||
|
||||
return 3;
|
||||
|
||||
} else if(I_mcs == 2) {
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
//printf("error in I_mcs value from nfapi");
|
||||
return 0;
|
||||
}
|
||||
|
||||
} else { // other NPUSCH
|
||||
|
||||
return tab_I_ru_N_ru_UL[I_ru];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
uint16_t get_UL_sc_ACK_NB_IoT(uint8_t subcarrier_spacing,uint16_t harq_ack_resource)
|
||||
{
|
||||
|
||||
if(subcarrier_spacing == 1) /// 15KHz
|
||||
{
|
||||
|
||||
return tab_ack_sc_format1[harq_ack_resource];
|
||||
|
||||
} else { // 3.75 KHz
|
||||
|
||||
return tab_ack_sc_format2[harq_ack_resource];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
uint16_t get_UL_sc_index_start_NB_IoT(uint8_t subcarrier_spacing, uint16_t I_sc, uint8_t npush_format)
|
||||
{
|
||||
|
||||
if(npush_format == 0) // format 1
|
||||
{
|
||||
|
||||
if(subcarrier_spacing == 1) ////////// 15 KHz
|
||||
{
|
||||
|
||||
if (0<=I_sc && I_sc<12)
|
||||
{
|
||||
return I_sc;
|
||||
|
||||
} else if (12<=I_sc && I_sc<16) {
|
||||
|
||||
return 3*(I_sc-12);
|
||||
|
||||
} else if (16<=I_sc && I_sc<18) {
|
||||
|
||||
return 6*(I_sc-16);
|
||||
|
||||
} else if (I_sc==18){
|
||||
|
||||
return 0;
|
||||
|
||||
} else {
|
||||
|
||||
return -1;
|
||||
printf("Error in passed nfapi parameters (I_sc)");
|
||||
|
||||
}
|
||||
|
||||
} else { //////////// 3.75 KHz
|
||||
|
||||
return I_sc; /// values 0-47
|
||||
}
|
||||
|
||||
} else { /////////////////////////////////////// format 2
|
||||
|
||||
if(subcarrier_spacing == 1) ////////// 15 KHz
|
||||
{
|
||||
|
||||
return(tab_ack_15khz[I_sc]);
|
||||
|
||||
} else { //////////// 3.75 KHz
|
||||
|
||||
return(tab_ack_3_75khz[I_sc]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////
|
||||
uint8_t get_numb_UL_sc_NB_IoT(uint8_t subcarrier_spacing, uint8_t I_sc, uint8_t npush_format)
|
||||
{
|
||||
|
||||
if(npush_format == 0) // format 1
|
||||
{
|
||||
if(subcarrier_spacing == 1) // 15 KHz
|
||||
{
|
||||
|
||||
if(I_sc >= 0 && I_sc < 12)
|
||||
{
|
||||
return 1;
|
||||
} else if (I_sc >= 12 && I_sc < 16) {
|
||||
return 3;
|
||||
} else if (I_sc >= 16 && I_sc < 18) {
|
||||
return 6;
|
||||
} else if (I_sc == 18) {
|
||||
return 12;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
uint8_t get_UL_slots_per_RU_NB_IoT(uint8_t subcarrier_spacing, uint8_t subcarrier_indcation, uint8_t UL_format)
|
||||
{
|
||||
uint8_t subcarrier_number = get_numb_UL_sc_NB_IoT(subcarrier_spacing, subcarrier_indcation, UL_format);
|
||||
|
||||
if(UL_format == 0) // format 1
|
||||
{
|
||||
if(subcarrier_spacing == 1) // 15 KHz
|
||||
{
|
||||
if (subcarrier_number == 1 )
|
||||
{
|
||||
return 16;
|
||||
|
||||
} else if (subcarrier_number == 3) {
|
||||
|
||||
return 8;
|
||||
|
||||
} else if (subcarrier_number == 6) {
|
||||
|
||||
return 4;
|
||||
|
||||
} else {
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
} else { // 3.75 KHz
|
||||
|
||||
return 16;
|
||||
}
|
||||
|
||||
} else { // format 2
|
||||
|
||||
return 4;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
266
openair1/PHY/LTE_TRANSPORT/lte_mcs_NB_IoT.c
Normal file
266
openair1/PHY/LTE_TRANSPORT/lte_mcs_NB_IoT.c
Normal file
@@ -0,0 +1,266 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/lte_mcs_NB_IoT.c
|
||||
* \brief Some support routines for MCS computations
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company b<>com
|
||||
* \email:
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
//#include "PHY/defs.h"
|
||||
//#include "PHY/extern.h"
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/proto_NB_IoT.h"
|
||||
#include "PHY/LTE_TRANSPORT/extern_NB_IoT.h"
|
||||
|
||||
|
||||
uint8_t get_Qm_UL_NB_IoT(unsigned char I_mcs, uint8_t N_sc_RU, uint8_t I_sc, uint8_t Msg3_flag)
|
||||
{
|
||||
if (Msg3_flag == 1) /////////////////////////// case of Msg3
|
||||
{
|
||||
|
||||
if(I_mcs > 0)
|
||||
{
|
||||
return 2;
|
||||
|
||||
} else if (I_mcs == 0 && I_sc <12) {
|
||||
|
||||
return 1;
|
||||
|
||||
} else { ////// I_mcs == 0 && I_sc >11
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
} else { /////////////////////// case of other NPUSCH config
|
||||
|
||||
if(N_sc_RU == 1)
|
||||
{
|
||||
if(I_mcs <2)
|
||||
{
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
|
||||
} else { /////////////// N_sc_RU > 1
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int get_G_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
|
||||
uint16_t num_ctrl_symbols = frame_parms->control_region_size; // eutra_control_region_size values are 0,1,2
|
||||
|
||||
uint8_t nb_antennas_tx_LTE = frame_parms->nb_antennas_tx;
|
||||
uint8_t nb_antennas_tx_NB_IoT = frame_parms->nb_antennas_tx_NB_IoT;
|
||||
|
||||
int G_value=0;
|
||||
|
||||
switch (nb_antennas_tx_NB_IoT + (2*nb_antennas_tx_LTE)) {
|
||||
|
||||
case 10:
|
||||
G_value = G_tab[(1*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
case 6:
|
||||
G_value = G_tab[(2*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
case 4 :
|
||||
G_value = G_tab[(3*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
case 9 :
|
||||
G_value = G_tab[(4*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
case 5:
|
||||
G_value = G_tab[(5*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
case 3 :
|
||||
G_value = G_tab[(6*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
printf("Error getting G");
|
||||
|
||||
}
|
||||
|
||||
return(G_value);
|
||||
|
||||
}
|
||||
|
||||
int get_G_SIB1_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, uint8_t operation_mode_info)
|
||||
{
|
||||
|
||||
uint16_t num_ctrl_symbols = 0; // eutra_control_region_size values are 0,1,2
|
||||
if(operation_mode_info<2) /// operation_mode_info, in-band (two value 0,1), stand-alone(3), guard band (2)
|
||||
{
|
||||
num_ctrl_symbols = 2;
|
||||
}
|
||||
uint8_t nb_antennas_tx_LTE = frame_parms->nb_antennas_tx;
|
||||
uint8_t nb_antennas_tx_NB_IoT = frame_parms->nb_antennas_tx_NB_IoT;
|
||||
|
||||
int G_value=0;
|
||||
|
||||
switch (nb_antennas_tx_NB_IoT + (2*nb_antennas_tx_LTE)) {
|
||||
|
||||
case 10:
|
||||
G_value = G_tab[(1*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
case 6:
|
||||
G_value = G_tab[(2*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
case 4 :
|
||||
G_value = G_tab[(3*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
case 9 :
|
||||
G_value = G_tab[(4*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
case 5:
|
||||
G_value = G_tab[(5*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
case 3 :
|
||||
G_value = G_tab[(6*3)-num_ctrl_symbols-1];
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
printf("Error getting G");
|
||||
|
||||
}
|
||||
|
||||
return(G_value);
|
||||
|
||||
}
|
||||
|
||||
int get_rep_num_SIB1_NB_IoT(uint8_t scheduling_info_sib1)
|
||||
{
|
||||
|
||||
int value=0;
|
||||
|
||||
if(scheduling_info_sib1 >11)
|
||||
{
|
||||
printf("value not allowed for schedulinginfo for sib1");
|
||||
|
||||
} else {
|
||||
|
||||
switch(scheduling_info_sib1 % 3)
|
||||
{
|
||||
case 0:
|
||||
value =4;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
value =8;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
value =16;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return(value);
|
||||
|
||||
}
|
||||
|
||||
int get_start_frame_SIB1_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,uint8_t repetition)
|
||||
{
|
||||
|
||||
int value=0;
|
||||
|
||||
uint16_t cell_id = frame_parms->Nid_cell ;
|
||||
|
||||
if(repetition == 4)
|
||||
{
|
||||
switch(cell_id %4)
|
||||
{
|
||||
case 0:
|
||||
value =0;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
value =16;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
value =32;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
value =48;
|
||||
break;
|
||||
}
|
||||
|
||||
} else if(repetition == 8) {
|
||||
|
||||
switch(cell_id %2)
|
||||
{
|
||||
case 0:
|
||||
value =0;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
value =16;
|
||||
break;
|
||||
}
|
||||
|
||||
} else if(repetition == 16) {
|
||||
|
||||
switch(cell_id %2)
|
||||
{
|
||||
case 0:
|
||||
value =0;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
value =1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
printf("Error in getting the starting frame of SIB1 ");
|
||||
}
|
||||
|
||||
return(value);
|
||||
|
||||
}
|
||||
|
||||
365
openair1/PHY/LTE_TRANSPORT/npbch_NB_IoT.c
Normal file
365
openair1/PHY/LTE_TRANSPORT/npbch_NB_IoT.c
Normal file
@@ -0,0 +1,365 @@
|
||||
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/npbch_NB_IoT.c
|
||||
* \Fucntions for the generation of broadcast channel (NPBCH) for NB_IoT, TS 36-212, V13.4.0 2017-02
|
||||
* \author M. KANJ, V. Savaux
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com , vincent.savaux@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
//#include "PHY/defs.h"
|
||||
//#include "PHY/defs_NB_IoT.h"
|
||||
//#include "PHY/CODING/extern.h"
|
||||
//#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
//#include "extern_NB_IoT.h"
|
||||
//#include "PHY/extern_NB_IoT.h"
|
||||
//#include "PHY/sse_intrin.h"
|
||||
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
|
||||
#include "PHY/CODING/defs_NB_IoT.h"
|
||||
#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
|
||||
#include "PHY/impl_defs_lte_NB_IoT.h"
|
||||
#include "PHY/impl_defs_top_NB_IoT.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
|
||||
//#ifdef PHY_ABSTRACTION
|
||||
//#include "SIMULATION/TOOLS/defs.h"
|
||||
//#endif
|
||||
|
||||
//#ifdef OPENAIR2
|
||||
//#include "PHY_INTERFACE/defs.h"
|
||||
//#endif
|
||||
|
||||
#define NPBCH_A 34 // 34 for NB-IoT and 24 for LTE
|
||||
|
||||
|
||||
int scrambling_npbch_REs_rel_13_5_0(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
int l,
|
||||
uint32_t symbol_offset,
|
||||
uint8_t pilots,
|
||||
unsigned short id_offset,
|
||||
uint8_t *reset,
|
||||
uint32_t *x1,
|
||||
uint32_t *x2,
|
||||
uint32_t *s,
|
||||
uint8_t *flag_32)
|
||||
{
|
||||
uint32_t tti_offset,aa;
|
||||
uint8_t re;
|
||||
uint8_t first_re,last_re;
|
||||
uint8_t c_even,c_odd;
|
||||
int16_t theta_re,theta_im;
|
||||
int16_t data_re[frame_parms->nb_antennas_tx],data_im[frame_parms->nb_antennas_tx];
|
||||
uint32_t mem_jj=0;
|
||||
|
||||
first_re = 0;
|
||||
last_re = 12;
|
||||
for (re=first_re; re<last_re; re++) { // re varies between 0 and 12 sub-carriers
|
||||
|
||||
if ((*jj)%32 == 0 && *flag_32 == 0){
|
||||
*s = lte_gold_generic_NB_IoT(x1, x2, *reset);
|
||||
*reset = 0;
|
||||
mem_jj = *jj;
|
||||
}
|
||||
c_even = (*s>>*jj)&1;
|
||||
c_odd = (*s>>(*jj+1))&1;
|
||||
if (c_even == c_odd){
|
||||
if(c_even){
|
||||
theta_re = 0;
|
||||
theta_im = -32767;
|
||||
}else{
|
||||
theta_re = 32767;
|
||||
theta_im = 0;
|
||||
}
|
||||
}else{
|
||||
if(c_even){
|
||||
theta_re = 0;
|
||||
theta_im = 32767;
|
||||
}else{
|
||||
theta_re = -32767;
|
||||
theta_im = 0;
|
||||
}
|
||||
}
|
||||
|
||||
tti_offset = symbol_offset + re; // symbol_offset = 512 * L , re_offset = 512 - 3*12 , re
|
||||
|
||||
if (pilots != 1 || re%3 != id_offset) // if re is not a pilot
|
||||
{
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
data_re[aa] = ((int16_t*)&txdataF[aa][tti_offset])[0];
|
||||
data_im[aa] = ((int16_t*)&txdataF[aa][tti_offset])[1];
|
||||
}
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
((int16_t*)&txdataF[aa][tti_offset])[0] = (int16_t) (((int32_t) data_re[aa] * (int32_t) theta_re -
|
||||
(int32_t) data_im[aa] * (int32_t) theta_im)>>15); //I //b_i
|
||||
|
||||
((int16_t*)&txdataF[aa][tti_offset])[1] = (int16_t) (((int32_t) data_im[aa] * (int32_t) theta_re +
|
||||
(int32_t) data_re[aa] * (int32_t) theta_im)>>15); //Q //b_{i+1}
|
||||
}
|
||||
|
||||
*jj = *jj + 2;
|
||||
|
||||
}
|
||||
if (mem_jj == *jj) // avoid to shift lte_gold_generic_NB_IoT 2 times
|
||||
{*flag_32 = 1;
|
||||
}else
|
||||
{*flag_32 = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int allocate_npbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
uint32_t symbol_offset,
|
||||
uint8_t *x0,
|
||||
uint8_t pilots,
|
||||
int16_t amp,
|
||||
unsigned short id_offset,
|
||||
uint32_t *re_allocated) // not used variable ??!!
|
||||
{
|
||||
MIMO_mode_t mimo_mode = (frame_parms->mode1_flag==1)?SISO:ALAMOUTI;
|
||||
|
||||
uint32_t tti_offset,aa;
|
||||
uint8_t re;
|
||||
int16_t gain_lin_QPSK;
|
||||
uint8_t first_re,last_re;
|
||||
int32_t tmp_sample1,tmp_sample2;
|
||||
|
||||
gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
first_re = 0;
|
||||
last_re = 12;
|
||||
|
||||
for (re=first_re; re<last_re; re++) { // re varies between 0 and 12 sub-carriers
|
||||
|
||||
tti_offset = symbol_offset + re; // symbol_offset = 512 * L , re_offset = 512 - 3*12 , re
|
||||
|
||||
if (pilots != 1 || re%3 != id_offset) // if re is not a pilot
|
||||
{
|
||||
// diff_re = re%3 - id_offset;
|
||||
if (mimo_mode == SISO) { //SISO mapping
|
||||
*re_allocated = *re_allocated + 1; // variable incremented but never used
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
((int16_t*)&txdataF[aa][tti_offset])[0] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
|
||||
}
|
||||
*jj = *jj + 1;
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
((int16_t*)&txdataF[aa][tti_offset])[1] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //Q //b_{i+1}
|
||||
}
|
||||
*jj = *jj + 1;
|
||||
} else if (mimo_mode == ALAMOUTI) {
|
||||
*re_allocated = *re_allocated + 1;
|
||||
|
||||
((int16_t*)&tmp_sample1)[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
((int16_t*)&tmp_sample1)[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
|
||||
// second antenna position n -> -x1*
|
||||
|
||||
((int16_t*)&tmp_sample2)[0] = (x0[*jj]==1) ? (gain_lin_QPSK) : -gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
((int16_t*)&tmp_sample2)[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
*jj=*jj+1;
|
||||
|
||||
// normalization for 2 tx antennas
|
||||
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15_NB_IoT)>>15);
|
||||
|
||||
// fill in the rest of the ALAMOUTI precoding
|
||||
if ( pilots != 1 || (re+1)%3 != id_offset) {
|
||||
((int16_t *)&txdataF[0][tti_offset+1])[0] += -((int16_t *)&txdataF[1][tti_offset])[0]; //x1
|
||||
((int16_t *)&txdataF[0][tti_offset+1])[1] += ((int16_t *)&txdataF[1][tti_offset])[1];
|
||||
((int16_t *)&txdataF[1][tti_offset+1])[0] += ((int16_t *)&txdataF[0][tti_offset])[0]; //x0*
|
||||
((int16_t *)&txdataF[1][tti_offset+1])[1] += -((int16_t *)&txdataF[0][tti_offset])[1];
|
||||
} else {
|
||||
((int16_t *)&txdataF[0][tti_offset+2])[0] += -((int16_t *)&txdataF[1][tti_offset])[0]; //x1
|
||||
((int16_t *)&txdataF[0][tti_offset+2])[1] += ((int16_t *)&txdataF[1][tti_offset])[1];
|
||||
((int16_t *)&txdataF[1][tti_offset+2])[0] += ((int16_t *)&txdataF[0][tti_offset])[0]; //x0*
|
||||
((int16_t *)&txdataF[1][tti_offset+2])[1] += -((int16_t *)&txdataF[0][tti_offset])[1];
|
||||
|
||||
re++; // skip pilots
|
||||
*re_allocated = *re_allocated + 1;
|
||||
}
|
||||
re++; // adjacent carriers are taken care of by precoding
|
||||
*re_allocated = *re_allocated + 1; // incremented variable but never used
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
/**********************************************************
|
||||
**********************************************************/
|
||||
int generate_npbch(NB_IoT_eNB_NPBCH_t *eNB_npbch,
|
||||
int32_t **txdataF,
|
||||
int amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t *npbch_pdu,
|
||||
uint8_t frame_mod64,
|
||||
unsigned short NB_IoT_RB_ID,
|
||||
uint8_t release_v13_5_0)
|
||||
{
|
||||
int i, l;
|
||||
int id_offset;
|
||||
uint32_t npbch_D,npbch_E;
|
||||
uint8_t npbch_a[5]; // 34/8 =4.25 => 4 bytes and 2 bits
|
||||
uint8_t RCC;
|
||||
unsigned short bandwidth_even_odd;
|
||||
unsigned short NB_IoT_start, RB_IoT_ID;
|
||||
uint32_t pilots;
|
||||
uint32_t jj=0;
|
||||
uint32_t re_allocated=0;
|
||||
uint32_t symbol_offset;
|
||||
uint16_t amask=0;
|
||||
///////////////////////////// for release 13.5.0 and above ////////////////////////
|
||||
uint32_t ii=0;
|
||||
uint8_t reset=1,flag_32=0;
|
||||
uint32_t x1_v13_5_0, x2_v13_5_0 =0, s_v13_5_0 =0;
|
||||
x2_v13_5_0 = (((frame_parms->Nid_cell+1) * (frame_mod64%8 + 1) * (frame_mod64%8 + 1) * (frame_mod64%8 + 1)) <<9) + frame_parms->Nid_cell;
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
frame_parms->flag_free_sf =1;
|
||||
|
||||
npbch_D = 16 + NPBCH_A;
|
||||
npbch_E = 1600;
|
||||
|
||||
if (frame_mod64==0) {
|
||||
bzero(npbch_a,5); // initializing input data stream , filling with zeros
|
||||
bzero(eNB_npbch->npbch_e,npbch_E); // filling with "0" the table pbch_e[1600]
|
||||
memset(eNB_npbch->npbch_d,LTE_NULL_NB_IoT,96); // filling with "2" the first 96 elements of table pbch_d[216]
|
||||
|
||||
for (i=0; i<5; i++) // set input bits stream
|
||||
{
|
||||
|
||||
npbch_a[i] = npbch_pdu[i]; // in LTE 24 bits with 3 bytes, but in NB_IoT 34 bits will require 4 bytes+2 bits !! to verify
|
||||
|
||||
}
|
||||
|
||||
if (frame_parms->mode1_flag == 1) // setting CRC mask depending on the number of used eNB antennas
|
||||
amask = 0x0000;
|
||||
else {
|
||||
switch (frame_parms->nb_antennas_tx) { // *****???? better replacing nb_antennas_tx_eNB by nb_antennas_tx_eNB_NB_IoT
|
||||
case 1:
|
||||
amask = 0x0000;
|
||||
break;
|
||||
case 2:
|
||||
amask = 0xffff;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ccode_encode_NB_IoT(NPBCH_A,2,npbch_a,eNB_npbch->npbch_d+96,amask); // step 1 CRC Attachment
|
||||
RCC = sub_block_interleaving_cc_NB_IoT(npbch_D,eNB_npbch->npbch_d+96,eNB_npbch->npbch_w); // step 2 Channel Coding
|
||||
lte_rate_matching_cc_NB_IoT(RCC,npbch_E,eNB_npbch->npbch_w,eNB_npbch->npbch_e); // step 3 Rate Matching
|
||||
npbch_scrambling(frame_parms, // step 4 Scrambling
|
||||
eNB_npbch->npbch_e,
|
||||
npbch_E);
|
||||
|
||||
}
|
||||
// testing if the total number of RBs is even or odd
|
||||
bandwidth_even_odd = frame_parms->N_RB_DL % 2; // 0 even, 1 odd
|
||||
RB_IoT_ID = NB_IoT_RB_ID;
|
||||
// step 5, 6, 7 // modulation and mapping (slot 1, symbols 0..3)
|
||||
for (l=3; l<14; l++) { // loop on OFDM symbols
|
||||
|
||||
if((l>=4 && l<=8) || (l>=11 && l<=13))
|
||||
{
|
||||
pilots =1;
|
||||
} else {
|
||||
pilots=0;
|
||||
}
|
||||
|
||||
id_offset = frame_parms->Nid_cell % 3; // Cell_ID_NB_IoT % 3
|
||||
|
||||
if(RB_IoT_ID < (frame_parms->N_RB_DL/2))
|
||||
{
|
||||
NB_IoT_start = frame_parms->ofdm_symbol_size - 12*(frame_parms->N_RB_DL/2) - (bandwidth_even_odd*6) + 12*(RB_IoT_ID%(int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
} else {
|
||||
NB_IoT_start = 1 + (bandwidth_even_odd*6) + 12*(RB_IoT_ID%(int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
}
|
||||
|
||||
symbol_offset = frame_parms->ofdm_symbol_size*l + NB_IoT_start; // symbol_offset = 512 * L + NB_IOT_RB start
|
||||
|
||||
allocate_npbch_REs_in_RB(frame_parms,
|
||||
txdataF,
|
||||
&jj,
|
||||
symbol_offset,
|
||||
&eNB_npbch->npbch_e[(frame_mod64/8)*(npbch_E>>3)],
|
||||
pilots,
|
||||
amp,
|
||||
id_offset,
|
||||
&re_allocated);
|
||||
|
||||
if(release_v13_5_0 == 1)
|
||||
{
|
||||
|
||||
scrambling_npbch_REs_rel_13_5_0(frame_parms,
|
||||
txdataF,
|
||||
&ii,
|
||||
l,
|
||||
symbol_offset,
|
||||
pilots,
|
||||
id_offset,
|
||||
&reset,
|
||||
&x1_v13_5_0,
|
||||
&x2_v13_5_0,
|
||||
&s_v13_5_0,
|
||||
&flag_32);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
/**********************************************************
|
||||
**********************************************************/
|
||||
void npbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t *npbch_e,
|
||||
uint32_t length) // 1600
|
||||
{
|
||||
int i;
|
||||
uint8_t reset;
|
||||
uint32_t x1, x2, s=0;
|
||||
|
||||
reset = 1;
|
||||
x2 = frame_parms->Nid_cell;
|
||||
|
||||
for (i=0; i<length; i++) {
|
||||
if ((i&0x1f)==0) {
|
||||
|
||||
s = lte_gold_generic_NB_IoT(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
npbch_e[i] = (npbch_e[i]&1) ^ ((s>>(i&0x1f))&1);
|
||||
}
|
||||
}
|
||||
493
openair1/PHY/LTE_TRANSPORT/nprach_NB_IoT.c
Normal file
493
openair1/PHY/LTE_TRANSPORT/nprach_NB_IoT.c
Normal file
@@ -0,0 +1,493 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
/*! \file PHY/LTE_TRANSPORT/nprach_eNb_NB_IoT.c
|
||||
* function for NPRACH signal detection and Timing Advance estimation
|
||||
* \author V. Savaux
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company b<>com
|
||||
* \email: vincent.savaux@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
//#include "PHY/sse_intrin.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "PHY/TOOLS/defs.h" // to take into account the dft functions
|
||||
#include "tables_nprach_NB_IoT.h"
|
||||
#include "first_sc_NB_IoT.h"
|
||||
//#include "PHY/extern.h"
|
||||
//#include "prach.h"
|
||||
//#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
//#include "SCHED/defs.h"
|
||||
//#include "SCHED/extern.h"
|
||||
//#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
int filter_xx[40] = {-2161, 453, 489, 570, 688, 838, 1014, 1209, 1420, 1639,
|
||||
1862, 2082, 2295, 2495, 2677, 2837, 2969, 3072, 3142, 3178,
|
||||
3178, 3142, 3072, 2969, 2837, 2677, 2495, 2295, 2082, 1862,
|
||||
1639, 1420, 1209, 1014, 838, 688, 570, 489, 453, -2161}; // this is a low-pass filter
|
||||
|
||||
int16_t buffer_nprach[153600];
|
||||
int16_t filtered_buffer[153600];
|
||||
int16_t signal_compensed_re[153600];
|
||||
int16_t signal_compensed_im[153600];
|
||||
int16_t output_buffer[4800];
|
||||
|
||||
uint8_t NPRACH_detection_NB_IoT(int16_t *input_buffer,uint32_t input_length){
|
||||
|
||||
uint8_t cp_type = 0; // 0: short ; 1: extended
|
||||
uint32_t nb_signal_samples,nb_noise_samples,n1,n2;
|
||||
uint64_t energy_signal=0,energy_noise=0;
|
||||
uint32_t n;
|
||||
|
||||
if(cp_type){
|
||||
|
||||
}else{
|
||||
nb_signal_samples = (uint32_t)(((uint64_t) 62670*input_length)/100000);
|
||||
nb_noise_samples = input_length - nb_signal_samples;
|
||||
}
|
||||
n1 = nb_signal_samples;
|
||||
n2 = nb_noise_samples;
|
||||
|
||||
// printf("n samples = %i %i\n",FRAME_LENGTH_COMPLEX_SAMPLESx,nb_signal_samples);
|
||||
|
||||
for(n=0;n<nb_signal_samples;n++){
|
||||
energy_signal += (((uint64_t)input_buffer[2*n]*input_buffer[2*n] + (uint64_t)input_buffer[2*n+1]*input_buffer[2*n+1])/n1);
|
||||
//energy_signal += (uint64_t)(((uint64_t)input_buffer[2*n]*input_buffer[2*n] + (uint64_t)input_buffer[2*n+1]*input_buffer[2*n+1])/10);
|
||||
}
|
||||
for(n=nb_signal_samples;n<input_length;n++){
|
||||
energy_noise += (((uint64_t)input_buffer[2*n]*input_buffer[2*n] + (uint64_t)input_buffer[2*n+1]*input_buffer[2*n+1])/n2);
|
||||
//energy_noise += (uint64_t)(((uint64_t)input_buffer[2*n]*input_buffer[2*n] + (uint64_t)input_buffer[2*n+1]*input_buffer[2*n+1])/10);
|
||||
}
|
||||
|
||||
//printf("energies = %ld %ld\n",energy_signal,energy_noise);
|
||||
if ((uint64_t)(((uint64_t) energy_signal))<(uint64_t)energy_noise>>6){
|
||||
|
||||
return 1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*uint32_t TA_estimation_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
int16_t *Rx_sub_sampled_buffer,
|
||||
uint16_t sub_sampling_rate,
|
||||
uint16_t FRAME_LENGTH_COMPLEX_SUB_SAMPLES,
|
||||
uint32_t estimated_TA_coarse,
|
||||
uint8_t coarse){
|
||||
|
||||
uint16_t length_seq_NPRACH,length_CP,length_symbol; // in number of samples, per NPRACH preamble: 4 sequences ; length of CP in number of samples
|
||||
uint16_t length_CP_0 = 2048;//eNB->frame_parms.prach_config_common.nprach_CP_Length; //NB-IoT: 0: short, 1: long
|
||||
uint32_t fs=30720000; //NB-IoT: sampling frequency of Rx_buffer, must be defined somewhere
|
||||
uint32_t fs_sub_sampled;
|
||||
uint16_t length_correl_window,base_length;
|
||||
int64_t *vec_correlation;
|
||||
int64_t max_correlation = 0;
|
||||
//int16_t **matrix_received_signal_re, **matrix_received_signal_im;
|
||||
uint16_t offset_estimation, offset_start; // offset due to first coarse estimation
|
||||
// double *** mat_to_phase_estimation_re, *** mat_to_phase_estimation_im;
|
||||
int64_t average_mat_to_phase_re, average_mat_to_phase_im;
|
||||
float estimated_phase, estimated_CFO, CFO_correction, CFO_correction_k;
|
||||
// int16_t *vec_CFO_compensation_re, *vec_CFO_compensation_im;
|
||||
// int16_t *vec_received_signal_re, *vec_received_signal_im;
|
||||
int16_t *signal_CFO_compensed_re, *signal_CFO_compensed_im;
|
||||
int32_t **sub_sequence_reference_re, **sub_sequence_reference_im;
|
||||
int32_t *sequence_reference_re, *sequence_reference_im;
|
||||
uint32_t TA_sample_estimated = 0;
|
||||
int32_t A;//,B;
|
||||
int n,k,m,o;
|
||||
int32_t pow_n1 = 1;
|
||||
uint32_t index_av_ph1, index_av_ph2;
|
||||
|
||||
if (coarse){ // coarse = 1: first estimation at 240 kHz
|
||||
|
||||
length_seq_NPRACH = (length_CP_0+5*8192)/128;
|
||||
length_CP = length_CP_0/128;
|
||||
length_symbol = 64;
|
||||
offset_start = 0;
|
||||
length_correl_window = 80; //20512/sub_sampling_rate; // corresponds to the max TA, i.e. 667.66 micro s //FRAME_LENGTH_COMPLEX_SUB_SAMPLES - 4*length_seq_NPRACH+1;
|
||||
fs_sub_sampled = (uint32_t)fs/128;
|
||||
|
||||
}else{
|
||||
|
||||
length_seq_NPRACH = (length_CP_0+5*8192)/16;
|
||||
length_CP = length_CP_0/16;
|
||||
length_symbol = 8192/16;
|
||||
|
||||
offset_estimation = 8 * estimated_TA_coarse;
|
||||
base_length = 32;
|
||||
// we arbitrarily define the length of correl window as base_length samples.
|
||||
// Check if offset_estimation is close to zero or 1282 (max lentgh of delays)
|
||||
|
||||
if (offset_estimation-base_length/2 <0){
|
||||
offset_start = 0;
|
||||
length_correl_window = offset_estimation + base_length/2;
|
||||
}
|
||||
if (offset_estimation+base_length/2 >1281){
|
||||
offset_start = offset_estimation-base_length/2;
|
||||
length_correl_window = base_length;// 512 - (1282-offset_estimation);
|
||||
}
|
||||
if ((offset_estimation-base_length/2 >=0) && (offset_estimation+base_length/2 <=1281)){
|
||||
offset_start = offset_estimation-base_length/2;
|
||||
length_correl_window = base_length;
|
||||
}
|
||||
err
|
||||
fs_sub_sampled = (uint32_t)fs/16;
|
||||
|
||||
}
|
||||
|
||||
//fs_sub_sampled = (uint32_t)fs/sub_sampling_rate;
|
||||
|
||||
// Method: MMSE (sub-optimal) CFO estimation -> CFO compensation -> ML (sub-optimal) TA estimation /============================================================/
|
||||
|
||||
//matrix_received_signal_re = (int16_t **)malloc(4*sizeof(int16_t *));
|
||||
//matrix_received_signal_im = (int16_t **)malloc(4*sizeof(int16_t *));
|
||||
// for (k=0;k<4;k++){ // # sequence
|
||||
// matrix_received_signal_re[k] = (int16_t *)malloc((length_seq_NPRACH-length_CP)*sizeof(int16_t)); // avoid CP in this process
|
||||
// matrix_received_signal_im[k] = (int16_t *)malloc((length_seq_NPRACH-length_CP)*sizeof(int16_t)); // avoid CP in this process
|
||||
// }
|
||||
signal_CFO_compensed_re = (int16_t *)malloc(4*length_seq_NPRACH*sizeof(int16_t)); /////to do : exact size of tables
|
||||
signal_CFO_compensed_im = (int16_t *)malloc(4*length_seq_NPRACH*sizeof(int16_t));
|
||||
sub_sequence_reference_re = (int32_t **)malloc(4*sizeof(int32_t *));
|
||||
sub_sequence_reference_im = (int32_t **)malloc(4*sizeof(int32_t *));
|
||||
for (k=0;k<4;k++){
|
||||
sub_sequence_reference_re[k] = (int32_t *)calloc(length_symbol,sizeof(int32_t));
|
||||
sub_sequence_reference_im[k] = (int32_t *)calloc(length_symbol,sizeof(int32_t));
|
||||
}
|
||||
sequence_reference_re = (int32_t *)malloc(4*length_seq_NPRACH*sizeof(int32_t));
|
||||
sequence_reference_im = (int32_t *)malloc(4*length_seq_NPRACH*sizeof(int32_t));
|
||||
vec_correlation = (int64_t *)calloc(length_correl_window,sizeof(int64_t));
|
||||
|
||||
for (n=0;n<length_correl_window;n++){ // loops over samples %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
// MMSE (sub-optimal) CFO estimation /============================================================/
|
||||
average_mat_to_phase_re = 0;
|
||||
average_mat_to_phase_im = 0;
|
||||
for (k=0;k<4;k++){ // # sequence
|
||||
for (o=0;o<4;o++){ // # symbol in sequence
|
||||
for (m=0;m<length_symbol;m++){ ///// creation of two variables for tab indexes "n+offset_start+k*length_seq_NPRACH+length_CP+o*length_symbol+m"
|
||||
index_av_ph1 = (n+offset_start+k*length_seq_NPRACH+length_CP+o*length_symbol+m)<<1;
|
||||
index_av_ph2 = index_av_ph1 + (length_symbol<<1);
|
||||
average_mat_to_phase_re = average_mat_to_phase_re
|
||||
- (int64_t)(Rx_sub_sampled_buffer[index_av_ph1]
|
||||
* Rx_sub_sampled_buffer[index_av_ph2])
|
||||
- (int64_t)(Rx_sub_sampled_buffer[index_av_ph1+1]
|
||||
* Rx_sub_sampled_buffer[index_av_ph2+1]);
|
||||
|
||||
average_mat_to_phase_im = average_mat_to_phase_im
|
||||
- (int64_t)(Rx_sub_sampled_buffer[index_av_ph1+1]
|
||||
* Rx_sub_sampled_buffer[index_av_ph2])
|
||||
+ (int64_t)(Rx_sub_sampled_buffer[index_av_ph1]
|
||||
* Rx_sub_sampled_buffer[index_av_ph2+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
average_mat_to_phase_re = average_mat_to_phase_re/(16*length_symbol);
|
||||
average_mat_to_phase_im = average_mat_to_phase_im/(16*length_symbol);
|
||||
estimated_phase = atan2f(average_mat_to_phase_im,average_mat_to_phase_re);
|
||||
estimated_CFO = ((float)fs*estimated_phase)/(8192*2*(float)M_PI);
|
||||
CFO_correction = 2*(float)M_PI*estimated_CFO/fs_sub_sampled;
|
||||
// CFO compensation /============================================================/
|
||||
|
||||
for (k=0;k<4*length_seq_NPRACH;k++){ ///// creation of two variables for tab indexes /// replace "2*(float)M_PI*estimated_CFO*k/fs_sub_sampled" and "2*(n+offset_start+k)"
|
||||
CFO_correction_k = (float)k*CFO_correction;
|
||||
signal_CFO_compensed_re[k] = (int16_t)((Rx_sub_sampled_buffer[(n+offset_start+k)<<1] * (int32_t)(cosf(CFO_correction_k)*32767)
|
||||
- Rx_sub_sampled_buffer[((n+offset_start+k)<<1)+1] * (int32_t)(sinf(CFO_correction_k)*32767))>>15);
|
||||
signal_CFO_compensed_im[k] = (int16_t)((Rx_sub_sampled_buffer[(n+offset_start+k)<<1] * (int32_t)(sinf(CFO_correction_k)*32767)
|
||||
+ Rx_sub_sampled_buffer[((n+offset_start+k)<<1)+1] * (int32_t)(cosf(CFO_correction_k)*32767))>>15);
|
||||
|
||||
}
|
||||
|
||||
// sub-optimal ML TA estimation /============================================================/
|
||||
|
||||
|
||||
for (k=0;k<4;k++){ // loop over the 4 sequences of a preamble
|
||||
pow_n1 = 1;
|
||||
for (o=0;o<5;o++){ // loop over the symbols of a sequence
|
||||
for (m=0;m<length_symbol;m++){
|
||||
// mon_variable=k*length_seq_NPRACH + o*length_symbol + length_CP + m ///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
sub_sequence_reference_re[k][m] = sub_sequence_reference_re[k][m] + pow_n1 * signal_CFO_compensed_re[k*length_seq_NPRACH + o*length_symbol + length_CP + m] / 5; // average over the 5 symbols of a group
|
||||
sub_sequence_reference_im[k][m] = sub_sequence_reference_im[k][m] + pow_n1 * signal_CFO_compensed_im [k*length_seq_NPRACH + o*length_symbol + length_CP + m]/ 5; // average over the 5 symbols of a group
|
||||
}
|
||||
pow_n1 = -pow_n1;
|
||||
}
|
||||
}
|
||||
|
||||
pow_n1 = 1;
|
||||
for (k=0;k<4;k++){ // loop over the 4 sequences of a preamble
|
||||
pow_n1 = 1;
|
||||
for (o=0;o<5;o++){ // loop over the symbols of a sequence // mon_variable=k*length_seq_NPRACH+o*length_symbol +length_CP +m///////////////////////////////////////////////
|
||||
for (m=0;m<length_symbol;m++){
|
||||
sequence_reference_re[k*length_seq_NPRACH+o*length_symbol +length_CP +m] = pow_n1 * sub_sequence_reference_re[k][m];
|
||||
sequence_reference_im[k*length_seq_NPRACH+o*length_symbol +length_CP +m] = pow_n1 * sub_sequence_reference_im[k][m];
|
||||
}
|
||||
pow_n1 = -pow_n1;
|
||||
}
|
||||
}
|
||||
for (k=0;k<4;k++){ // loop over the 4 sequences of a preamble
|
||||
for (m=0;m<length_CP;m++){
|
||||
sequence_reference_re[k*length_seq_NPRACH+m] = -sub_sequence_reference_re[k][length_symbol-length_CP+m];
|
||||
sequence_reference_im[k*length_seq_NPRACH+m] = -sub_sequence_reference_im[k][length_symbol-length_CP+m];
|
||||
}
|
||||
}
|
||||
|
||||
// for (m=0;m<length_seq_NPRACH;m++){
|
||||
// vec_correlation[n] = vec_correlation[n] + (double)signal_CFO_compensed_re[m] * sequence_reference_re[m] + (double)signal_CFO_compensed_im[m] * sequence_reference_im[m];
|
||||
// printf("seq=%i\n",sequence_reference_re[m]);
|
||||
// }
|
||||
|
||||
for (m=0;m<4*length_seq_NPRACH;m++){
|
||||
A = (int64_t)((signal_CFO_compensed_re[m] * sequence_reference_re[m]
|
||||
+ signal_CFO_compensed_im[m] * sequence_reference_im[m]));
|
||||
//B = -(int32_t)(((int64_t)signal_CFO_compensed_re[m] * (int64_t)sequence_reference_im[m]
|
||||
// - (int64_t)signal_CFO_compensed_im[m] * (int64_t)sequence_reference_re[m])>>32);
|
||||
vec_correlation[n] = vec_correlation[n] + A;//(int32_t)(((int64_t)A*(int64_t)A + 2*(int64_t)B*(int64_t)B)>>32);
|
||||
}
|
||||
|
||||
for (k=0;k<4;k++){ // re-initialize sub_sequence_reference matrices ////////////////////////////////////////////
|
||||
for (m=0;m<length_symbol;m++){
|
||||
sub_sequence_reference_re[k][m] = 0;
|
||||
sub_sequence_reference_im[k][m] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
for (n=0;n<length_correl_window;n++){
|
||||
//printf("\ncorr=%li \n",vec_correlation[n]);
|
||||
if(vec_correlation[n]>=max_correlation){
|
||||
max_correlation = vec_correlation[n];
|
||||
TA_sample_estimated = offset_start+ n;
|
||||
}
|
||||
}
|
||||
|
||||
free(vec_correlation);
|
||||
for (k=0;k<4;k++){ // # sequence
|
||||
//free(matrix_received_signal_re[k]);
|
||||
err//free(matrix_received_signal_im[k]);
|
||||
free(sub_sequence_reference_re[k]);
|
||||
free(sub_sequence_reference_im[k]);
|
||||
}
|
||||
//free(matrix_received_signal_re);
|
||||
//free(matrix_received_signal_im);
|
||||
free(signal_CFO_compensed_re);
|
||||
free(signal_CFO_compensed_im);
|
||||
free(sub_sequence_reference_re);
|
||||
free(sub_sequence_reference_im);
|
||||
|
||||
return TA_sample_estimated;
|
||||
|
||||
} */
|
||||
|
||||
|
||||
uint16_t subcarrier_estimation(int16_t *input_buffer){
|
||||
|
||||
uint16_t estimated_sc=0;
|
||||
int16_t *s_n_re, *s_n_im;
|
||||
uint16_t k,m,n;
|
||||
int64_t max_correl_sc_m = 0;
|
||||
int64_t max_correl_sc_k = 0;
|
||||
int64_t max_correl_sc_glob = 0;
|
||||
int n_start_offset = 1920; // start at t=8 ms
|
||||
|
||||
for (k=0;k<12;k++){
|
||||
s_n_re = &s_n_12_re[k*336];
|
||||
s_n_im = &s_n_12_im[k*336];
|
||||
|
||||
for (m=0;m<20;m++){
|
||||
for (n=0;n<336;n++){
|
||||
max_correl_sc_m = max_correl_sc_m +
|
||||
(int16_t)(((int32_t)input_buffer[(m<<1)+((n+n_start_offset)<<1)]*(int32_t)s_n_re[n] )>>15)
|
||||
+ (int16_t)(((int32_t)input_buffer[(m<<1)+((n+n_start_offset)<<1)+1]*(int32_t)s_n_im[n])>>15);
|
||||
}
|
||||
|
||||
if (max_correl_sc_m>max_correl_sc_k){
|
||||
max_correl_sc_k = max_correl_sc_m;
|
||||
}
|
||||
max_correl_sc_m = 0;
|
||||
}
|
||||
|
||||
//printf("correl = %li\n",max_correl_sc_k);
|
||||
|
||||
if (max_correl_sc_k>max_correl_sc_glob){
|
||||
max_correl_sc_glob = max_correl_sc_k;
|
||||
estimated_sc = k;
|
||||
}
|
||||
max_correl_sc_k = 0;
|
||||
}
|
||||
|
||||
return estimated_sc;
|
||||
|
||||
}
|
||||
|
||||
int16_t* sub_sampling_NB_IoT(int16_t *input_buffer, uint32_t length_input, uint32_t *length_ouput, uint16_t sub_sampling_rate){ // void function ////// adding flag for switching between output_buffers
|
||||
|
||||
int k;
|
||||
uint32_t L;
|
||||
//int16_t *output_buffer;
|
||||
int16_t *p_output_buffer;
|
||||
L = (uint32_t)(length_input / sub_sampling_rate);
|
||||
*length_ouput = L; ///// to remove
|
||||
|
||||
|
||||
|
||||
for (k=0;k<L;k++){
|
||||
output_buffer[k<<1] = input_buffer[sub_sampling_rate*(k<<1)];
|
||||
output_buffer[(k<<1)+1] = input_buffer[sub_sampling_rate*(k<<1)+1];
|
||||
}
|
||||
// for (k=0;k<2*L;k++){
|
||||
// printf("%i\n",output_buffer[k]);
|
||||
// }
|
||||
p_output_buffer=output_buffer;
|
||||
return p_output_buffer;
|
||||
|
||||
}
|
||||
|
||||
void filtering_signal(int16_t *input_buffer, int16_t *filtered_buffer, uint32_t FRAME_LENGTH_COMPLEX_SAMPLESx){
|
||||
|
||||
int n;
|
||||
//int k;
|
||||
//float f_s_RB22 = 1807.5;
|
||||
//float f_s = 7680;
|
||||
//int16_t *signal_compensed_re, *signal_compensed_im;
|
||||
int16_t *cos_x, *sin_x;
|
||||
|
||||
cos_x = cos_x_rb22;
|
||||
sin_x = sin_x_rb22;
|
||||
|
||||
|
||||
for (n=0;n<FRAME_LENGTH_COMPLEX_SAMPLESx;n++){
|
||||
|
||||
signal_compensed_re[n] = (int16_t)((input_buffer[n<<1] * (int32_t)(cos_x[n])
|
||||
+ input_buffer[(n<<1)+1] * (int32_t)(sin_x[n]))>>15);
|
||||
signal_compensed_im[n] = (int16_t)((- input_buffer[n<<1] * (int32_t)(sin_x[n])
|
||||
+ input_buffer[(n<<1)+1] * (int32_t)(cos_x[n]))>>15);
|
||||
|
||||
filtered_buffer[n<<1] = signal_compensed_re[n];
|
||||
filtered_buffer[(n<<1)+1] = signal_compensed_im[n];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*for (n=0;n<FRAME_LENGTH_COMPLEX_SAMPLESx-10;n++){
|
||||
if (n<20){
|
||||
for (k=-n;k<20;k++){
|
||||
filtered_buffer[n<<1] = filtered_buffer[n<<1] + (int16_t)(((int32_t)filter_xx[20+k]*(int32_t)signal_compensed_re[n+k])>>15);
|
||||
filtered_buffer[(n<<1)+1] = filtered_buffer[(n<<1)+1] + (int16_t)(((int32_t)filter_xx[20+k]*(int32_t)signal_compensed_im[n+k])>>15);
|
||||
}
|
||||
}else{
|
||||
for (k=-20;k<20;k++){
|
||||
filtered_buffer[n<<1] = filtered_buffer[n<<1] + (int16_t)(((int32_t)filter_xx[20+k]*(int32_t)signal_compensed_re[n+k])>>15);
|
||||
filtered_buffer[(n<<1)+1] = filtered_buffer[(n<<1)+1] + (int16_t)(((int32_t)filter_xx[20+k]*(int32_t)signal_compensed_im[n+k])>>15);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32_t process_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint16_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance){
|
||||
|
||||
|
||||
//uint32_t estimated_TA_coarse=0;
|
||||
//uint32_t estimated_TA;
|
||||
int16_t *Rx_sub_sampled_buffer_128; // *Rx_sub_sampled_buffer_16;
|
||||
uint16_t sub_sampling_rate; //NB-IoT: to be defined somewhere
|
||||
uint32_t FRAME_LENGTH_COMPLEX_SAMPLESx; // NB-IoT: length of input buffer, to be defined somewhere
|
||||
uint32_t FRAME_LENGTH_COMPLEX_SUB_SAMPLES; // Length of buffer after sub-sampling
|
||||
uint32_t *length_ouput; // Length of buffer after sub-sampling
|
||||
// uint8_t coarse=1; // flag that indicate the level of TA estimation
|
||||
int16_t *Rx_buffer;
|
||||
//int16_t *filtered_buffer;
|
||||
//int n;
|
||||
|
||||
//// 1. Coarse TA estimation using sub sampling rate = 128, i.e. fs = 240 kHz
|
||||
|
||||
FRAME_LENGTH_COMPLEX_SAMPLESx = 10*eNB->frame_parms.samples_per_tti;
|
||||
Rx_buffer = (int16_t*)&eNB->common_vars.rxdata[0][0][0]; // get the whole frame
|
||||
|
||||
memcpy(&buffer_nprach[0],&Rx_buffer[0],307200);
|
||||
|
||||
|
||||
//filtered_buffer = (int16_t *)calloc(2*FRAME_LENGTH_COMPLEX_SAMPLESx,sizeof(int16_t)); // calcule du taille exacte du tableau 76800
|
||||
memset(filtered_buffer,0,307200);
|
||||
filtering_signal(buffer_nprach,filtered_buffer,FRAME_LENGTH_COMPLEX_SAMPLESx);
|
||||
|
||||
// Sub-sampling stage /============================================================/
|
||||
|
||||
sub_sampling_rate = FRAME_LENGTH_COMPLEX_SAMPLESx/2400; // gives the sub-sampling rate leading to f=240 kHz
|
||||
length_ouput = &FRAME_LENGTH_COMPLEX_SUB_SAMPLES;
|
||||
Rx_sub_sampled_buffer_128 = sub_sampling_NB_IoT(filtered_buffer,FRAME_LENGTH_COMPLEX_SAMPLESx,length_ouput, sub_sampling_rate);
|
||||
|
||||
// Detection and TA estimation stage /============================================================/
|
||||
|
||||
if (NPRACH_detection_NB_IoT(Rx_sub_sampled_buffer_128,*length_ouput)){
|
||||
|
||||
|
||||
/* estimated_TA_coarse = TA_estimation_NB_IoT(eNB,
|
||||
Rx_sub_sampled_buffer_128,
|
||||
sub_sampling_rate,
|
||||
FRAME_LENGTH_COMPLEX_SUB_SAMPLES,
|
||||
estimated_TA_coarse,
|
||||
coarse);
|
||||
|
||||
|
||||
// 2. Fine TA estimation using sub sampling rate = 16, i.e. fs = 1.92 MHz
|
||||
|
||||
// Sub-sampling stage /============================================================/
|
||||
//// sub_sampling_rate = FRAME_LENGTH_COMPLEX_SAMPLESx/(2400*8);
|
||||
Rx_sub_sampled_buffer_16 = sub_sampling_NB_IoT(filtered_buffer,FRAME_LENGTH_COMPLEX_SAMPLESx,length_ouput, sub_sampling_rate);
|
||||
|
||||
|
||||
// Fine TA estimation stage /============================================================/
|
||||
// start1 = clock();
|
||||
coarse = 0;
|
||||
estimated_TA = TA_estimation_NB_IoT(eNB,
|
||||
Rx_sub_sampled_buffer_16,
|
||||
sub_sampling_rate,
|
||||
FRAME_LENGTH_COMPLEX_SUB_SAMPLES,
|
||||
estimated_TA_coarse,
|
||||
coarse); //
|
||||
// Needs to be stored in a variable in PHY_VARS_eNB_NB_IoT structure
|
||||
|
||||
//for (n=0;n<FRAME_LENGTH_COMPLEX_SAMPLESx;n++){
|
||||
//printf(" buf%i= %i",n,Rx_sub_sampled_buffer_128[2*n]);
|
||||
// fprintf(f," %i %i ",Rx_buffer[2*n],Rx_buffer[2*n+1]);
|
||||
//fprintf(f,"%i \n",Rx_buffer[2*n+1]);
|
||||
//}*/
|
||||
|
||||
printf("\ndetection !!! at frame %i \n",frame);
|
||||
//eNB->preamble_index_NB_IoT = subcarrier_estimation(Rx_sub_sampled_buffer_128); // c'est un uint16_t
|
||||
*preamble_index = subcarrier_estimation(Rx_sub_sampled_buffer_128);
|
||||
*timing_advance = 0;
|
||||
*rnti = 1 + frame/4;
|
||||
printf("estimated subaccier = %i\n",*preamble_index);
|
||||
return 1;//estimated_TA;
|
||||
}else{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
|
||||
186
openair1/PHY/LTE_TRANSPORT/npss_NB_IoT.c
Normal file
186
openair1/PHY/LTE_TRANSPORT/npss_NB_IoT.c
Normal file
@@ -0,0 +1,186 @@
|
||||
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
/*! \file PHY/LTE_TRANSPORT/npss_NB_IoT.c
|
||||
* \Generation of Narrowband Primary Synchronisation Signal(NPSS) for NB-IoT, TS 36-212, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/defs.h"
|
||||
///////////////#include "PHY/defs_nb_iot.h"
|
||||
#include "PHY/extern.h"
|
||||
#include <math.h>
|
||||
//#include "PHY/impl_defs_lte_NB_IoT.h"
|
||||
//#include "PHY/impl_defs_top_NB_IoT.h"
|
||||
//or #include "PHY/defs_nb_iot.h"
|
||||
#include "PHY/LTE_REFSIG/primary_synch_NB_IoT.h"
|
||||
|
||||
int generate_npss_NB_IoT(int32_t **txdataF,
|
||||
short amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned short symbol_offset, // symbol_offset should equal to 3 for NB-IoT
|
||||
unsigned short slot_offset,
|
||||
unsigned short RB_IoT_ID) // new attribute (values are between 0.. Max_RB_number-1), it does not exist for LTE
|
||||
{
|
||||
unsigned short c,aa,a,s;
|
||||
unsigned short slot_id;
|
||||
short *primary_sync;
|
||||
unsigned short NB_IoT_start; // Index of the first RE in the RB dedicated for NB-IoT
|
||||
unsigned short bandwidth_even_odd;
|
||||
|
||||
frame_parms->flag_free_sf =1;
|
||||
|
||||
slot_id = slot_offset; // The id(0..19) of the slot including the NPSS signal // For NB-IoT, slod_id should be 10 (SF5)
|
||||
primary_sync = primary_synch_NB_IoT; // primary_synch_NB_IoT[264] of primary_synch_NB_IoT.h
|
||||
|
||||
// Signal amplitude
|
||||
a = (frame_parms->nb_antennas_tx == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15_NB_IoT)>>15;
|
||||
|
||||
// Testing if the total number of RBs is even or odd (i.e. Identification of the bandwidth: 1.4, 3, 5, 10, ... MHz)
|
||||
bandwidth_even_odd = frame_parms->N_RB_DL % 2; // 0 for even, 1 for odd
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
|
||||
if(RB_IoT_ID < (frame_parms->N_RB_DL/2))
|
||||
{
|
||||
NB_IoT_start = frame_parms->ofdm_symbol_size - 12*(frame_parms->N_RB_DL/2) - (bandwidth_even_odd*6) + 12*(RB_IoT_ID%(int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
} else {
|
||||
NB_IoT_start = 1 + (bandwidth_even_odd*6) + 12*(RB_IoT_ID%(int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
}
|
||||
// For the In-band or Stand-alone case the REs of NPSS signal have the same positions
|
||||
for (s=0; s<11; s++ ) // loop on OFDM symbols
|
||||
{
|
||||
for (c=0; c<12; c++) { // loop on NB-IoT carriers
|
||||
|
||||
((short*)txdataF[aa])[2*( (slot_id*7*frame_parms->ofdm_symbol_size) + ((symbol_offset+s)*frame_parms->ofdm_symbol_size) + NB_IoT_start + c )] =
|
||||
|
||||
(a * primary_sync[2*c + (2*12*s)]) >> 15;
|
||||
|
||||
((short*)txdataF[aa])[2*( (slot_id*7*frame_parms->ofdm_symbol_size) + ((symbol_offset+s)*frame_parms->ofdm_symbol_size) + NB_IoT_start + c )+1] =
|
||||
|
||||
(a * primary_sync[2*c + (2*12*s) + 1]) >> 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
// int generate_npss_NB_IoT(int32_t **txdataF,
|
||||
// short amp,
|
||||
// LTE_DL_FRAME_PARMS *frame_parms,
|
||||
// unsigned short symbol_offset, // symbol_offset should equal to 3 for NB-IoT
|
||||
// unsigned short slot_offset,
|
||||
// unsigned short RB_IoT_ID) // new attribute (values are between 0.. Max_RB_number-1), it does not exist for LTE
|
||||
// {
|
||||
// unsigned short c,aa,a,s;
|
||||
// unsigned short slot_id;
|
||||
// short *primary_sync;
|
||||
// unsigned short NB_IoT_start; // Index of the first RE in the RB dedicated for NB-IoT
|
||||
// unsigned short bandwidth_even_odd;
|
||||
// unsigned short UL_RB_ID_NB_IoT; // index of the NB-IoT RB
|
||||
// unsigned char poffset=0, pilot=0; // poffset: base frequency offset of pilots; pilot: LTE pilot flag
|
||||
|
||||
|
||||
// UL_RB_ID_NB_IoT = frame_parms->NB_IoT_RB_ID; // index of RB dedicated to NB-IoT
|
||||
|
||||
// slot_id = slot_offset; // The id(0..19) of the slot including the NPSS signal // For NB-IoT, slod_id should be 10 (SF5)
|
||||
// primary_sync = primary_synch_NB_IoT; // primary_synch_NB_IoT[264] of primary_synch_NB_IoT.h
|
||||
|
||||
// // Signal amplitude
|
||||
// a = (frame_parms->nb_antennas_tx == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15_NB_IoT)>>15;
|
||||
|
||||
// // Testing if the total number of RBs is even or odd (i.e. Identification of the bandwidth: 1.4, 3, 5, 10, ... MHz)
|
||||
// bandwidth_even_odd = frame_parms->N_RB_DL % 2; // 0 for even, 1 for odd
|
||||
|
||||
// for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
|
||||
// if(RB_IoT_ID < (frame_parms->N_RB_DL/2))
|
||||
// { // RB in first half (below DC)
|
||||
// // NB_IoT_start = frame_parms->ofdm_symbol_size - 12*(frame_parms->N_RB_DL/2) - (bandwidth_even_odd*6) + 12*(RB_IoT_ID%(int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
// NB_IoT_start = UL_RB_ID_NB_IoT*12 + frame_parms->first_carrier_offset;
|
||||
// } else { // RB in the second half (above DC): DC is taken into account
|
||||
// // NB_IoT_start = 1+ (bandwidth_even_odd*6) + 12*(RB_IoT_ID%(int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
// NB_IoT_start = 1 + bandwidth_even_odd*6 + 6*(2*UL_RB_ID_NB_IoT - (frame_parms->N_RB_DL+bandwidth_even_odd));
|
||||
// }
|
||||
// // For the In-band or Stand-alone case the REs of NPSS signal have the same positions
|
||||
// for (s=0; s<11; s++ ) // loop on OFDM symbols
|
||||
// {
|
||||
// // CRS (LTE pilot) position within subframe in time
|
||||
// // Note that pilot position takes into account symbol_offset value
|
||||
// if (frame_parms->mode1_flag==1){ // SISO mode
|
||||
// if (s==1 || s==4 || s==8){
|
||||
// pilot = 1;
|
||||
// if (s==1 || s==8){
|
||||
// poffset = 3;
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// if (pilot == 0){
|
||||
// for (c=0; c<12; c++) { // loop on NB-IoT carriers
|
||||
|
||||
// ((short*)txdataF[aa])[2*( (slot_id*7*frame_parms->ofdm_symbol_size) + ((symbol_offset+s)*frame_parms->ofdm_symbol_size) + NB_IoT_start + c )] =
|
||||
|
||||
// (a * primary_sync[2*c + (2*12*s)]) >> 15;
|
||||
|
||||
// ((short*)txdataF[aa])[2*( (slot_id*7*frame_parms->ofdm_symbol_size) + ((symbol_offset+s)*frame_parms->ofdm_symbol_size) + NB_IoT_start + c )+1] =
|
||||
|
||||
// (a * primary_sync[2*c + (2*12*s) + 1]) >> 15;
|
||||
// }
|
||||
// }
|
||||
// else{
|
||||
// for (c=0; c<12; c++) { // loop on NB-IoT carriers
|
||||
// if ((c!=(frame_parms->nushift+poffset)) &&
|
||||
// (c!=((frame_parms->nushift+poffset+6)%12)))
|
||||
// {
|
||||
// ((short*)txdataF[aa])[2*( (slot_id*7*frame_parms->ofdm_symbol_size) + ((symbol_offset+s)*frame_parms->ofdm_symbol_size) + NB_IoT_start + c )] =
|
||||
|
||||
// (a * primary_sync[2*c + (2*12*s)]) >> 15;
|
||||
|
||||
// ((short*)txdataF[aa])[2*( (slot_id*7*frame_parms->ofdm_symbol_size) + ((symbol_offset+s)*frame_parms->ofdm_symbol_size) + NB_IoT_start + c )+1] =
|
||||
|
||||
// (a * primary_sync[2*c + (2*12*s) + 1]) >> 15;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// pilot = 0;
|
||||
// poffset = 0;
|
||||
// }
|
||||
// }
|
||||
|
||||
// return(0);
|
||||
// }
|
||||
|
||||
/* (for LTE)
|
||||
int generate_pss_emul(PHY_VARS_eNB_NB_IoT *phy_vars_eNb,uint8_t sect_id)
|
||||
{
|
||||
|
||||
msg("[PHY] EMUL eNB generate_pss_emul eNB %d, sect_id %d\n",phy_vars_eNb->Mod_id,sect_id);
|
||||
eNB_transport_info[phy_vars_eNb->Mod_id][phy_vars_eNb->CC_id].cntl.pss=sect_id;
|
||||
return(0);
|
||||
}
|
||||
*/
|
||||
295
openair1/PHY/LTE_TRANSPORT/nsss_NB_IoT.c
Normal file
295
openair1/PHY/LTE_TRANSPORT/nsss_NB_IoT.c
Normal file
@@ -0,0 +1,295 @@
|
||||
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/nsss_NB_IoT.c
|
||||
* \Generation of Narrowband Secondary Synchronisation Signal(NSSS) for NB-IoT, TS 36-212, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
//#include <math.h>
|
||||
#include "PHY/defs.h"
|
||||
//#include "PHY/defs_NB_IoT.h" // not can be replaced by impl_defs_lte_NB_IoT & impl_defs_top_NB_IoT if "msg" function is not used
|
||||
//#include "defs.h"
|
||||
//#include "PHY/extern_NB_IoT.h"
|
||||
#include "PHY/extern.h"
|
||||
//#include "PHY/impl_defs_lte_NB_IoT.h"
|
||||
//#include "PHY/impl_defs_top_NB_IoT.h"
|
||||
#include "nsss_NB_IoT.h"
|
||||
|
||||
int generate_sss_NB_IoT(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint16_t symbol_offset, // symbol_offset = 3 for NB-IoT
|
||||
uint16_t slot_offset,
|
||||
unsigned short frame_number, // new attribute (Get value from higher layer), it does not exist for LTE
|
||||
unsigned short RB_IoT_ID) // new attribute (values are between 0.. Max_RB_number-1), it does not exist for LTE
|
||||
{
|
||||
uint8_t aa,Nid2,f,q,s,c,u;
|
||||
int16_t *d;
|
||||
uint16_t n_f,Nid_NB_IoT;
|
||||
unsigned short a;
|
||||
uint16_t slot_id; // slot_id = 17 in NB_IoT
|
||||
unsigned short bandwidth_even_odd;
|
||||
unsigned short NB_IoT_start;
|
||||
|
||||
frame_parms->flag_free_sf =1;
|
||||
|
||||
n_f = frame_number;
|
||||
Nid_NB_IoT = frame_parms->Nid_cell; // supposing Cell_Id of LTE = Cell_Id of NB-IoT // if different , NB_IOT_DL_FRAME_PARMS should be includes as attribute
|
||||
|
||||
f = (n_f/2) % 4; // f = 0, 1, 2, 3
|
||||
q = Nid_NB_IoT/126; // q = 0, 1, 2, 3
|
||||
u = (Nid_NB_IoT % 126);
|
||||
|
||||
Nid2 = q*4 + f; // Nid2 = 0..15
|
||||
|
||||
switch (Nid2) {
|
||||
case 0:
|
||||
d = d0f0;
|
||||
break;
|
||||
case 1:
|
||||
d = d0f1;
|
||||
break;
|
||||
case 2:
|
||||
d = d0f2;
|
||||
break;
|
||||
case 3:
|
||||
d = d0f3;
|
||||
break;
|
||||
case 4:
|
||||
d = d1f0;
|
||||
break;
|
||||
case 5:
|
||||
d = d1f1;
|
||||
break;
|
||||
case 6:
|
||||
d = d1f2;
|
||||
break;
|
||||
case 7:
|
||||
d = d1f3;
|
||||
break;
|
||||
case 8:
|
||||
d = d2f0;
|
||||
break;
|
||||
case 9:
|
||||
d = d2f1;
|
||||
break;
|
||||
case 10:
|
||||
d = d2f2;
|
||||
break;
|
||||
case 11:
|
||||
d = d2f3;
|
||||
case 12:
|
||||
d = d3f0;
|
||||
break;
|
||||
case 13:
|
||||
d = d3f1;
|
||||
break;
|
||||
case 14:
|
||||
d = d3f2;
|
||||
break;
|
||||
case 15:
|
||||
d = d3f3;
|
||||
break;
|
||||
|
||||
default:
|
||||
msg("[NSSS] ERROR\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
slot_id = slot_offset;
|
||||
|
||||
// Signal amplitude
|
||||
a = (frame_parms->nb_antennas_tx == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15_NB_IoT)>>15;
|
||||
|
||||
// Testing if the total number of RBs is even or odd (i.e. Identification of the bandwidth: 1.4, 3, 5, 10, ... MHz)
|
||||
bandwidth_even_odd = frame_parms->N_RB_DL % 2; // 0 even, 1 odd
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
|
||||
if(RB_IoT_ID < (frame_parms->N_RB_DL/2))
|
||||
{
|
||||
NB_IoT_start = frame_parms->ofdm_symbol_size - 12*(frame_parms->N_RB_DL/2) - (bandwidth_even_odd*6) + 12*(RB_IoT_ID%(int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
} else {
|
||||
NB_IoT_start = 1 + (bandwidth_even_odd*6) + 12*(RB_IoT_ID%(int)(ceil(frame_parms->N_RB_DL/(float)2)));
|
||||
}
|
||||
// For the In-band or Stand-alone case the REs of NPSS signal have the same positions
|
||||
for (s=0; s<11; s++ ) // loop on OFDM symbols
|
||||
{
|
||||
for (c=0; c<12; c++) { // loop on NB-IoT carriers
|
||||
|
||||
((short*)txdataF[aa])[2*( (slot_id*7*frame_parms->ofdm_symbol_size) + ((symbol_offset+s)*frame_parms->ofdm_symbol_size) + NB_IoT_start + c )] =
|
||||
|
||||
(a * d[(2*u*132) + (2*c) + (2*s*12) ]) >> 15;
|
||||
|
||||
((short*)txdataF[aa])[2*( (slot_id*7*frame_parms->ofdm_symbol_size) + ((symbol_offset+s)*frame_parms->ofdm_symbol_size) + NB_IoT_start + c )+1] =
|
||||
|
||||
(a * d[(2*u*132) + (2*c) + (2*s*12) + 1]) >> 15;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
int rx_nsss_NB_IoT(PHY_VARS_UE_NB_IoT *ue,int32_t *tot_metric)
|
||||
{
|
||||
|
||||
uint8_t Nid2,q_est,u_est;
|
||||
NB_IoT_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
int l,k,m;
|
||||
int toto=0;
|
||||
int16_t *d, *nsss_sf;
|
||||
int32_t nsss_ext[2][132]; // up to 2 rx antennas ?
|
||||
int32_t metric; // correlation metric
|
||||
|
||||
// we suppose we are in NSSS subframe, after DFT
|
||||
// this could be changed in further version
|
||||
for (l=0;l<11;l++){
|
||||
toto = nsss_extract_NB_IoT(ue,frame_parms,nsss_ext,l);
|
||||
LOG_D(PHY,"toto is %d\n",toto);
|
||||
}
|
||||
|
||||
// now do the Cell ID estimation based on the precomputed sequences in PHY/LTE_TRANSPORT/nsss_NB_IoT.h
|
||||
|
||||
*tot_metric = -99999999;
|
||||
nsss_sf = (int16_t*)&nsss_ext[0][0];
|
||||
|
||||
for (Nid2=0;Nid2<16;Nid2++){
|
||||
|
||||
switch (Nid2) {
|
||||
case 0:
|
||||
d = d0f0;
|
||||
break;
|
||||
case 1:
|
||||
d = d0f1;
|
||||
break;
|
||||
case 2:
|
||||
d = d0f2;
|
||||
break;
|
||||
case 3:
|
||||
d = d0f3;
|
||||
break;
|
||||
case 4:
|
||||
d = d1f0;
|
||||
break;
|
||||
case 5:
|
||||
d = d1f1;
|
||||
break;
|
||||
case 6:
|
||||
d = d1f2;
|
||||
break;
|
||||
case 7:
|
||||
d = d1f3;
|
||||
break;
|
||||
case 8:
|
||||
d = d2f0;
|
||||
break;
|
||||
case 9:
|
||||
d = d2f1;
|
||||
break;
|
||||
case 10:
|
||||
d = d2f2;
|
||||
break;
|
||||
case 11:
|
||||
d = d2f3;
|
||||
case 12:
|
||||
d = d3f0;
|
||||
break;
|
||||
case 13:
|
||||
d = d3f1;
|
||||
break;
|
||||
case 14:
|
||||
d = d3f2;
|
||||
break;
|
||||
case 15:
|
||||
d = d3f3;
|
||||
break;
|
||||
|
||||
default:
|
||||
msg("[NSSS] ERROR\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
for (k=0;k<126;k++){ // corresponds to u in standard
|
||||
metric = 0;
|
||||
|
||||
for (m=0;m<132;m++){ // 132 resource elements in NSSS subframe
|
||||
|
||||
metric += (int32_t)d[(k*126+m)<<1] * (int32_t)nsss_sf[(k*126+m)<<1] +
|
||||
(int32_t)d[((k*126+m)<<1)+1] * (int32_t)nsss_sf[((k*126+m)<<1)+1]; // real part of correlation
|
||||
|
||||
}
|
||||
|
||||
if (metric > *tot_metric){
|
||||
q_est = Nid2/4;
|
||||
u_est = k;
|
||||
ue->frame_parms.Nid_cell = q_est*126 + u_est;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int nsss_extract_NB_IoT(PHY_VARS_UE_NB_IoT *ue,
|
||||
NB_IoT_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **nsss_ext,
|
||||
int l)
|
||||
{
|
||||
uint8_t i,aarx;
|
||||
unsigned short UL_RB_ID_NB_IoT; // index of RB dedicated to NB-IoT
|
||||
int32_t *nsss_rxF,*nsssF_ext;
|
||||
int32_t **rxdataF;
|
||||
int first_symbol_offset = 3; // NSSS starts at third symbol in subframe
|
||||
|
||||
UL_RB_ID_NB_IoT = frame_parms->NB_IoT_RB_ID;
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[0].rxdataF; // Note that
|
||||
nsssF_ext = &nsss_ext[aarx][l*12];
|
||||
|
||||
if (UL_RB_ID_NB_IoT <= (frame_parms->N_RB_DL>>1)) { // NB-IoT RB is in the first half
|
||||
nsss_rxF = &rxdataF[aarx][(UL_RB_ID_NB_IoT*12 + frame_parms->first_carrier_offset + ((l+first_symbol_offset)*(frame_parms->ofdm_symbol_size)))];
|
||||
}// For second half of RBs skip DC carrier
|
||||
else{ // NB-IoT RB is in the second half
|
||||
nsss_rxF = &rxdataF[aarx][(1 + 6*(2*UL_RB_ID_NB_IoT - frame_parms->N_RB_DL) + ((l+first_symbol_offset)*(frame_parms->ofdm_symbol_size)))];
|
||||
//dl_ch0++;
|
||||
}
|
||||
|
||||
for (i=0; i<12; i++) {
|
||||
nsssF_ext[i]=nsss_rxF[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
54
openair1/PHY/LTE_TRANSPORT/nsss_NB_IoT.h
Normal file
54
openair1/PHY/LTE_TRANSPORT/nsss_NB_IoT.h
Normal file
File diff suppressed because one or more lines are too long
133
openair1/PHY/LTE_TRANSPORT/nsss_gen_NB_IoT.m
Normal file
133
openair1/PHY/LTE_TRANSPORT/nsss_gen_NB_IoT.m
Normal file
@@ -0,0 +1,133 @@
|
||||
clear all
|
||||
% nsss_gen / matlab
|
||||
% Copyright 2016 b<>com. All rights reserved.
|
||||
|
||||
% description: generation of NSSS subframe
|
||||
% Reference: 3GPP TS36.211 release 13
|
||||
% author: Vincent Savaux, b<>com, Rennes, France
|
||||
% email: vincent.savaux@b-com.com
|
||||
|
||||
% Input : \
|
||||
% Output : matrix NSSS_frame
|
||||
% Parameters
|
||||
% frame_number = 100;
|
||||
% cellID = 200;
|
||||
% % % Mapping results to estimated u-3
|
||||
|
||||
|
||||
SNR_start = -10;
|
||||
SNR_end = 2;
|
||||
vec_SNR = SNR_start : 2 : SNR_end;
|
||||
N_loop = 40;
|
||||
Proba_fail = zeros(1,length(vec_SNR));
|
||||
|
||||
mat_bn = zeros(4,128); % mat_bn contains the 4 possible Hadamard sequences defined in the standard
|
||||
mat_bn(1,:) = ones(1,128);
|
||||
mat_bn(2,:) = [1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 1 ...
|
||||
-1 1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 ...
|
||||
1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 ...
|
||||
-1 1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 ...
|
||||
1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 1 ...
|
||||
-1 1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 ...
|
||||
1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1];
|
||||
mat_bn(3,:) = [1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 1 ...
|
||||
-1 1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 1 1 ...
|
||||
-1 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 ...
|
||||
1 -1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 ...
|
||||
1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 1 ...
|
||||
-1 1 1 -1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 1 1 ...
|
||||
-1 1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 1];
|
||||
mat_bn(4,:) = [1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 1 ...
|
||||
-1 1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 1 1 ...
|
||||
-1 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 ...
|
||||
1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 ...
|
||||
-1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 ...
|
||||
1 -1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 ...
|
||||
1 -1 1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 1 1 -1];
|
||||
mat_bn = [mat_bn,mat_bn(:,1:4)]; % see the definition of m in stadard
|
||||
|
||||
mat_theta_f = zeros(4,132); % mat_bn contains the 4 possible phase sequences defined in the standard
|
||||
mat_theta_f(1,:) = ones(1,132);
|
||||
mat_theta_f(2,:) = repmat([1,-j,-1,j],1,33);
|
||||
mat_theta_f(3,:) = repmat([1,-1],1,66);
|
||||
mat_theta_f(4,:) = repmat([1,j,-1,-j],1,33);
|
||||
|
||||
mat_16_theta = round(kron(mat_theta_f,ones(4,1))); % mat_bn contains the 4x4=16 possible pseudo-random sequences
|
||||
mat_16_bn = repmat(mat_bn,4,1);
|
||||
mat_16 = mat_16_theta.*mat_16_bn;
|
||||
corresponding_values = zeros(16,2); % first column for q, second for theta_f
|
||||
corresponding_values(:,1) = repmat([0;1;2;3],4,1); % mapping column to q
|
||||
corresponding_values(:,2) = kron([0;1;2;3],ones(4,1)); % mapping column to theta_f
|
||||
|
||||
for k = 1 : length(vec_SNR) % loop on the SNR
|
||||
N_fail = 0;
|
||||
for loop = 1 : N_loop
|
||||
SNR = vec_SNR(k);
|
||||
frame_number = 2*randi([0,3],1);
|
||||
cellID = randi([0,503],1);
|
||||
|
||||
% function NSSS_subframe = nsss_gen(frame_number,cellID)
|
||||
theta_f = 33/132*mod(frame_number/2,4); % as defined in stadard
|
||||
u = mod(cellID,126) + 3; % root of ZC sequence, defined in standard
|
||||
q = floor(cellID/126);
|
||||
size_RB = 12; % number of sub-carrier per RB
|
||||
N_ZC = 131;
|
||||
L_sub_frame = 14; % number of OFDM symbols per subframe
|
||||
j = 1i;
|
||||
vec_n = 0:N_ZC;
|
||||
vec_n1 = mod(vec_n,131);
|
||||
vec_bq = mat_bn(q+1,:);
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Creation of the signal
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
% ZC sequence in frequency domain
|
||||
|
||||
ZC_sequence = exp(-j*pi*u*vec_n1.*(vec_n1+1)/N_ZC);
|
||||
had_sequence = exp(-j*2*pi*theta_f*vec_n);
|
||||
vec_bq_had = vec_bq.*had_sequence;
|
||||
P_noise = 10^(-SNR/10); % SNR in dB to noise power
|
||||
noise = sqrt(P_noise/2)*randn(1,132)+sqrt(P_noise/2)*j*randn(1,132);
|
||||
vec_d = vec_bq.*had_sequence.*ZC_sequence + noise;
|
||||
mat_NSSS = flipud(reshape(vec_d,size_RB,L_sub_frame-3));
|
||||
NSSS_subframe = [zeros(size_RB,3),mat_NSSS];
|
||||
|
||||
% end
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Exhaustive cell ID research
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
sequence_r = repmat(vec_d,16,1).*conj(mat_16); % this remove the phase component
|
||||
vec_u = 3 : 128;
|
||||
mat_u = repmat(vec_u.',1,length(vec_n1));
|
||||
mat_n1 = repmat(vec_n1,126,1);
|
||||
sequence_ZC = exp(-j*pi*mat_u.*mat_n1.*(mat_n1+1)/N_ZC);
|
||||
|
||||
matrix_max_correl = zeros(126,16); % this will be filled by the maximum of correlation value
|
||||
for s_ = 1 : 16
|
||||
seq_ref = sequence_r(s_,:);
|
||||
for u_ = 1 : 126
|
||||
correl = xcorr(seq_ref,sequence_ZC(u_,:));
|
||||
[val_max,ind_max] = max(abs(correl));
|
||||
matrix_max_correl(u_,s_) = val_max;
|
||||
end
|
||||
end
|
||||
|
||||
max_correl = max(max(matrix_max_correl)); % get the max of all correlation values
|
||||
index_max = find(matrix_max_correl==max_correl);
|
||||
estim_u_ = mod(index_max,126)-1;
|
||||
index_column = (index_max-mod(index_max,126))/126+1;
|
||||
estim_q_ = corresponding_values(index_column);
|
||||
estim_cell_ID = q*126 + estim_u_;
|
||||
|
||||
if cellID ~= estim_cell_ID
|
||||
N_fail = N_fail + 1;
|
||||
end
|
||||
|
||||
end
|
||||
Proba_fail(k) = N_fail/N_loop;
|
||||
end
|
||||
|
||||
plot(vec_SNR,Proba_fail)
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "PHY/extern.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
|
||||
|
||||
#ifdef PHY_ABSTRACTION
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
#endif
|
||||
@@ -50,6 +51,8 @@
|
||||
#include "PHY_INTERFACE/defs.h"
|
||||
#endif
|
||||
|
||||
#include "PHY/LTE_REFSIG/defs.h"
|
||||
|
||||
#define PBCH_A 24
|
||||
|
||||
int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
216
openair1/PHY/LTE_TRANSPORT/pilots_NB_IoT.c
Normal file
216
openair1/PHY/LTE_TRANSPORT/pilots_NB_IoT.c
Normal file
@@ -0,0 +1,216 @@
|
||||
/***********************************************************************
|
||||
|
||||
**********************************************************************/
|
||||
/*! \file PHY/LTE_TRANSPORT/pilots_NB_IoT.c
|
||||
* \Generation of Reference signal (RS) for NB-IoT, TS 36-211, V13.4.0 2017-02
|
||||
* \author M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.0
|
||||
* \company bcom
|
||||
* \email: matthieu.kanj@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "PHY/LTE_REFSIG/defs_NB_IoT.h"
|
||||
|
||||
void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint16_t Ntti, // Ntti = 0..9
|
||||
unsigned short RB_ID, // RB reserved for NB-IoT
|
||||
unsigned short With_NSSS) // With_NSSS = 1; if the frame include a sub-Frame with NSSS signal
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->frame_parms;
|
||||
uint16_t subframe = Ntti;
|
||||
uint32_t tti_offset,slot_offset,Nsymb,samples_per_symbol; // tti,
|
||||
uint8_t first_pilot,second_pilot;
|
||||
unsigned short RB_IoT_ID = RB_ID;
|
||||
Nsymb = 14;
|
||||
first_pilot = 5; // first pilot position
|
||||
second_pilot = 6; // second pilot position
|
||||
|
||||
slot_offset = (Ntti*2)%20;
|
||||
|
||||
if(subframe !=5 && ((With_NSSS*subframe)!= 9) ) // condition to avoid NPSS and NSSS signals
|
||||
{
|
||||
tti_offset = subframe*frame_parms->ofdm_symbol_size*Nsymb; // begins with 0
|
||||
samples_per_symbol = frame_parms->ofdm_symbol_size; // ex. 512
|
||||
|
||||
//Generate Pilots for slot 0 and 1
|
||||
|
||||
//antenna 0 symbol 5 slot 0
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,
|
||||
&txdataF[0][tti_offset + (first_pilot*samples_per_symbol)], // tti_offset 512 x 32 bits
|
||||
amp,
|
||||
slot_offset,
|
||||
0,
|
||||
0,
|
||||
RB_IoT_ID);
|
||||
|
||||
//antenna 0 symbol 6 slot 0
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[0][tti_offset + (second_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
slot_offset,
|
||||
1,
|
||||
0,
|
||||
RB_IoT_ID);
|
||||
|
||||
//antenna 0 symbol 5 slot 1
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[0][tti_offset + (7*samples_per_symbol) + (first_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
1+slot_offset,
|
||||
0,
|
||||
0,
|
||||
RB_IoT_ID);
|
||||
|
||||
//antenna 0 symbol 6 slot 1
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[0][tti_offset + (7*samples_per_symbol) + (second_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
1+slot_offset,
|
||||
1,
|
||||
0,
|
||||
RB_IoT_ID);
|
||||
|
||||
if (frame_parms->nb_antennas_tx > 1) { // Pilots generation with two antennas
|
||||
|
||||
// antenna 1 symbol 5 slot 0
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (first_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
slot_offset,
|
||||
0,
|
||||
1,
|
||||
RB_IoT_ID);
|
||||
|
||||
// antenna 1 symbol 6 slot 0
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (second_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
slot_offset,
|
||||
1,
|
||||
1,
|
||||
RB_IoT_ID);
|
||||
|
||||
//antenna 1 symbol 5 slot 1
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (7*samples_per_symbol) + (first_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
1+slot_offset,
|
||||
0,
|
||||
1,
|
||||
RB_IoT_ID);
|
||||
|
||||
// antenna 1 symbol 6 slot 1
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (7*samples_per_symbol) + (second_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
1+slot_offset,
|
||||
1,
|
||||
1,
|
||||
RB_IoT_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
/*
|
||||
void generate_pilots_NB_IoT(PHY_VARS_eNB_NB_IoT *phy_vars_eNB,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint16_t Ntti, // Ntti = 10
|
||||
unsigned short RB_IoT_ID, // RB reserved for NB-IoT
|
||||
unsigned short With_NSSS) // With_NSSS = 1; if the frame include a sub-Frame with NSSS signal
|
||||
{
|
||||
|
||||
NB_IoT_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->frame_parms_NB_IoT;
|
||||
|
||||
uint32_t tti,tti_offset,slot_offset,Nsymb,samples_per_symbol;
|
||||
uint8_t first_pilot,second_pilot;
|
||||
|
||||
Nsymb = 14;
|
||||
first_pilot = 5; // first pilot position
|
||||
second_pilot = 6; // second pilot position
|
||||
|
||||
for (tti=0; tti<Ntti; tti++) { // loop on sub-frames
|
||||
|
||||
tti_offset = tti*frame_parms->ofdm_symbol_size*Nsymb; // begins with 0
|
||||
samples_per_symbol = frame_parms->ofdm_symbol_size; // ex. 512
|
||||
slot_offset = (tti*2)%20; // 0, 2, 4, ....... 18
|
||||
|
||||
if((slot_offset != 10) && ((With_NSSS*slot_offset) != 18)) { // condition to avoid NPSS and NSSS signals
|
||||
|
||||
//Generate Pilots for slot 0 and 1
|
||||
|
||||
//antenna 0 symbol 5 slot 0
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,
|
||||
&txdataF[0][tti_offset + (first_pilot*samples_per_symbol)], // tti_offset 512 x 32 bits
|
||||
amp,
|
||||
RB_IoT_ID,
|
||||
slot_offset,
|
||||
0, //p
|
||||
0);
|
||||
|
||||
//antenna 0 symbol 6 slot 0
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[0][tti_offset + (second_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
RB_IoT_ID,
|
||||
slot_offset,
|
||||
1,
|
||||
0);
|
||||
|
||||
//antenna 0 symbol 5 slot 1
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[0][tti_offset + (7*samples_per_symbol) + (first_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
RB_IoT_ID,
|
||||
1+slot_offset,
|
||||
0,
|
||||
0);
|
||||
|
||||
//antenna 0 symbol 6 slot 1
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[0][tti_offset + (7*samples_per_symbol) + (second_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
RB_IoT_ID,
|
||||
1+slot_offset,
|
||||
1,
|
||||
0);
|
||||
|
||||
if (frame_parms->nb_antennas_tx > 1) { // Pilots generation with two antennas
|
||||
|
||||
// antenna 1 symbol 5 slot 0
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (first_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
RB_IoT_ID,
|
||||
slot_offset,
|
||||
0,
|
||||
1);
|
||||
|
||||
// antenna 1 symbol 6 slot 0
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (second_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
RB_IoT_ID,
|
||||
slot_offset,
|
||||
1,
|
||||
1);
|
||||
|
||||
//antenna 1 symbol 5 slot 1
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (7*samples_per_symbol) + (first_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
RB_IoT_ID,
|
||||
1+slot_offset,
|
||||
0,
|
||||
1);
|
||||
|
||||
// antenna 1 symbol 6 slot 1
|
||||
lte_dl_cell_spec_NB_IoT(phy_vars_eNB,&txdataF[1][tti_offset + (7*samples_per_symbol) + (second_pilot*samples_per_symbol)],
|
||||
amp,
|
||||
RB_IoT_ID,
|
||||
1+slot_offset,
|
||||
1,
|
||||
1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -60,6 +60,7 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch);
|
||||
*/
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS* frame_parms);
|
||||
|
||||
|
||||
/** \fn free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
|
||||
\brief This function frees memory allocated for a particular DLSCH at UE
|
||||
@param dlsch Pointer to DLSCH to be removed
|
||||
@@ -84,6 +85,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch);
|
||||
|
||||
LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
|
||||
|
||||
|
||||
LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag);
|
||||
|
||||
/** \fn dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
@@ -122,14 +124,14 @@ int32_t dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
time_stats_t *i_stats);
|
||||
|
||||
int32_t dlsch_encoding_SIC(PHY_VARS_UE *ue,
|
||||
uint8_t *a,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
time_stats_t *rm_stats,
|
||||
time_stats_t *te_stats,
|
||||
time_stats_t *i_stats);
|
||||
uint8_t *a,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
time_stats_t *rm_stats,
|
||||
time_stats_t *te_stats,
|
||||
time_stats_t *i_stats);
|
||||
|
||||
|
||||
|
||||
@@ -269,7 +271,6 @@ int32_t allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
|
||||
int *P1_SHIFT,
|
||||
int *P2_SHIFT);
|
||||
|
||||
|
||||
/** \fn int32_t dlsch_modulation(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint32_t sub_frame_offset,
|
||||
@@ -295,11 +296,11 @@ int32_t dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
LTE_eNB_DLSCH_t *dlsch1);
|
||||
|
||||
int32_t dlsch_modulation_SIC(int32_t **sic_buffer,
|
||||
uint32_t sub_frame_offset,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch0,
|
||||
int G);
|
||||
uint32_t sub_frame_offset,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch0,
|
||||
int G);
|
||||
/*
|
||||
\brief This function is the top-level routine for generation of the sub-frame signal (frequency-domain) for MCH.
|
||||
@param txdataF Table of pointers for frequency-domain TX signals
|
||||
@@ -396,7 +397,6 @@ void generate_ue_spec_pilots(PHY_VARS_eNB *phy_vars_eNB,
|
||||
int16_t amp,
|
||||
uint16_t Ntti,
|
||||
uint8_t beamforming_mode);
|
||||
|
||||
int32_t generate_pss(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -1742,7 +1742,7 @@ int32_t generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
|
||||
uint8_t eNB_id);
|
||||
double sinr_eff_cqi_calc(PHY_VARS_UE *phy_vars_ue,
|
||||
uint8_t eNB_id,
|
||||
uint8_t subframe);
|
||||
uint8_t subframe);
|
||||
|
||||
uint8_t sinr2cqi(double sinr,uint8_t trans_mode);
|
||||
|
||||
|
||||
651
openair1/PHY/LTE_TRANSPORT/proto_NB_IoT.h
Normal file
651
openair1/PHY/LTE_TRANSPORT/proto_NB_IoT.h
Normal file
@@ -0,0 +1,651 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/proto.h
|
||||
* \brief Function prototypes for PHY physical/transport channel processing and generation V8.6 2009-03
|
||||
* \author R. Knopp, F. Kaltenberger
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr
|
||||
* \last changes: M. Kanj, V. Savaux
|
||||
* \date: 2018
|
||||
* \company: b<>com
|
||||
* \email: matthieu.kanj@b-com.com, vincent.savaux@b-com.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#ifndef __LTE_TRANSPORT_PROTO_NB_IOT__H__
|
||||
#define __LTE_TRANSPORT_PROTO_NB_IOT__H__
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
#include "PHY/defs.h"
|
||||
//#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
|
||||
//#include <math.h>
|
||||
|
||||
//NPSS
|
||||
void free_eNB_dlsch_NB_IoT(NB_IoT_eNB_NDLSCH_t *dlsch);
|
||||
void free_eNB_dlcch_NB_IoT(NB_IoT_eNB_NPDCCH_t *dlcch);
|
||||
|
||||
void init_unscrambling_lut_NB_IoT(void);
|
||||
|
||||
int generate_npss_NB_IoT(int32_t **txdataF,
|
||||
short amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned short symbol_offset, // symbol_offset should equal to 3 for NB-IoT
|
||||
unsigned short slot_offset,
|
||||
unsigned short RB_IoT_ID); // new attribute (values are between 0.. Max_RB_number-1), it does not exist for LTE
|
||||
|
||||
//NSSS
|
||||
|
||||
int generate_sss_NB_IoT(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint16_t symbol_offset, // symbol_offset = 3 for NB-IoT
|
||||
uint16_t slot_offset,
|
||||
unsigned short frame_number, // new attribute (Get value from higher layer), it does not exist for LTE
|
||||
unsigned short RB_IoT_ID); // new attribute (values are between 0.. Max_RB_number-1), it does not exist for LTE
|
||||
|
||||
//*****************Vincent part for Cell ID estimation from NSSS ******************//
|
||||
|
||||
int rx_nsss_NB_IoT(PHY_VARS_UE_NB_IoT *ue,int32_t *tot_metric);
|
||||
|
||||
int nsss_extract_NB_IoT(PHY_VARS_UE_NB_IoT *ue,
|
||||
NB_IoT_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **nsss_ext,
|
||||
int l);
|
||||
|
||||
//NRS
|
||||
|
||||
void generate_pilots_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint16_t Ntti, // Ntti = 10
|
||||
unsigned short RB_IoT_ID, // RB reserved for NB-IoT
|
||||
unsigned short With_NSSS); // With_NSSS = 1; if the frame include a sub-Frame with NSSS signal
|
||||
|
||||
|
||||
//NPBCH
|
||||
|
||||
int allocate_npbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
uint32_t symbol_offset,
|
||||
uint8_t *x0,
|
||||
uint8_t pilots,
|
||||
int16_t amp,
|
||||
unsigned short id_offset,
|
||||
uint32_t *re_allocated);
|
||||
|
||||
// NPDSCH
|
||||
int allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
uint32_t symbol_offset,
|
||||
uint8_t *x0,
|
||||
uint8_t pilots,
|
||||
int16_t amp,
|
||||
unsigned short id_offset,
|
||||
uint8_t pilot_shift,
|
||||
uint32_t *re_allocated);
|
||||
|
||||
int generate_NDLSCH_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
NB_IoT_eNB_NDLSCH_t *RAR,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int RB_IoT_ID,
|
||||
uint8_t release_v13_5_0);
|
||||
|
||||
int generate_NPDCCH_NB_IoT(NB_IoT_eNB_NPDCCH_t *DCI,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int RB_IoT_ID);
|
||||
|
||||
int generate_SIB23(NB_IoT_eNB_NDLSCH_t *SIB23,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int RB_IoT_ID,
|
||||
uint8_t release_v13_5_0);
|
||||
|
||||
int generate_SIB1(NB_IoT_eNB_NDLSCH_t *sib1_struct,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
int RB_IoT_ID,
|
||||
uint8_t operation_mode,
|
||||
uint8_t release_v13_5_0);
|
||||
|
||||
int generate_npbch(NB_IoT_eNB_NPBCH_t *eNB_npbch,
|
||||
int32_t **txdataF,
|
||||
int amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t *npbch_pdu,
|
||||
uint8_t frame_mod64,
|
||||
unsigned short NB_IoT_RB_ID,
|
||||
uint8_t release_v13_5_0);
|
||||
|
||||
|
||||
void npbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t *npbch_e,
|
||||
uint32_t length);
|
||||
|
||||
|
||||
void dlsch_scrambling_Gen_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
NB_IoT_eNB_NDLSCH_t *dlsch,
|
||||
int tot_bits, // total number of bits to transmit
|
||||
uint16_t Nf, // Nf is the frame number (0..9)
|
||||
uint8_t Ns,
|
||||
uint32_t rnti,
|
||||
uint8_t release_v13_5_0,
|
||||
uint8_t SIB);
|
||||
|
||||
NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(uint8_t length, LTE_DL_FRAME_PARMS* frame_parms);
|
||||
|
||||
NB_IoT_eNB_NPDCCH_t *new_eNB_dlcch_NB_IoT(LTE_DL_FRAME_PARMS* frame_parms);
|
||||
|
||||
/*void dlsch_scrambling_Gen_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
NB_IoT_eNB_NDLSCH_t *dlsch,
|
||||
int tot_bits, // total number of bits to transmit
|
||||
uint16_t Nf, // Nf is the frame number (0..9)
|
||||
uint8_t Ns,
|
||||
uint32_t rnti, /// for SIB1 the SI_RNTI should be get from the DL request
|
||||
uint8_t type);*/
|
||||
/*
|
||||
int scrambling_npbch_REs_rel_14(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
int l,
|
||||
uint32_t symbol_offset,
|
||||
uint8_t pilots,
|
||||
unsigned short id_offset,
|
||||
uint8_t *reset,
|
||||
uint32_t *x1,
|
||||
uint32_t *x2,
|
||||
uint32_t *s);
|
||||
*/
|
||||
// Functions below implement 36-211 and 36-212
|
||||
|
||||
/*Use the UL DCI Information to configure PHY and also Pack the DCI*/
|
||||
int generate_eNB_ulsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
DCI_CONTENT *DCI_Content,
|
||||
uint16_t rnti,
|
||||
NB_IoT_eNB_NPDCCH_t *ndlcch,
|
||||
uint8_t aggregation,
|
||||
uint8_t npdcch_start_symbol,
|
||||
uint8_t ncce_index);
|
||||
|
||||
|
||||
/*Use the DL DCI Information to configure PHY and also Pack the DCI*/
|
||||
int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
DCI_CONTENT *DCI_Content,
|
||||
uint16_t rnti,
|
||||
DCI_format_NB_IoT_t dci_format,
|
||||
NB_IoT_eNB_NPDCCH_t *ndlcch,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t aggregation,
|
||||
uint8_t npdcch_start_symbol,
|
||||
uint8_t ncce_index);
|
||||
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
\brief Decoding of PUSCH/ACK/RI/ACK from 36-212.
|
||||
@param phy_vars_eNB Pointer to eNB top-level descriptor
|
||||
@param proc Pointer to RXTX proc variables
|
||||
@param UE_id ID of UE transmitting this PUSCH
|
||||
@param subframe Index of subframe for PUSCH
|
||||
@param control_only_flag Receive PUSCH with control information only
|
||||
@param Nbundled Nbundled parameter for ACK/NAK scrambling from 36-212/36-213
|
||||
@param llr8_flag If 1, indicate that the 8-bit turbo decoder should be used
|
||||
@returns 0 on success
|
||||
*/
|
||||
/*unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
|
||||
eNB_rxtx_proc_t *proc,
|
||||
uint8_t UE_id,
|
||||
uint8_t control_only_flag,
|
||||
uint8_t Nbundled,
|
||||
uint8_t llr8_flag);
|
||||
*/
|
||||
|
||||
// NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB_IoT(uint8_t abstraction_flag);
|
||||
|
||||
|
||||
uint8_t subframe2harq_pid_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe);
|
||||
|
||||
|
||||
/** \brief Compute Q (modulation order) based on I_MCS for PUSCH. Implements table 8.6.1-1 from 36.213.
|
||||
@param I_MCS */
|
||||
|
||||
//uint8_t get_Qm_ul_NB_IoT(uint8_t I_MCS);
|
||||
|
||||
/** \fn dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
uint8_t *input_buffer,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch,
|
||||
int frame,
|
||||
uint8_t subframe)
|
||||
\brief This function performs a subset of the bit-coding functions for LTE as described in 36-212, Release 8.Support is limited to turbo-coded channels (DLSCH/ULSCH). The implemented functions are:
|
||||
- CRC computation and addition
|
||||
- Code block segmentation and sub-block CRC addition
|
||||
- Channel coding (Turbo coding)
|
||||
- Rate matching (sub-block interleaving, bit collection, selection and transmission
|
||||
- Code block concatenation
|
||||
@param eNB Pointer to eNB PHY context
|
||||
@param input_buffer Pointer to input buffer for sub-frame
|
||||
@param frame_parms Pointer to frame descriptor structure
|
||||
@param num_pdcch_symbols Number of PDCCH symbols in this subframe
|
||||
@param dlsch Pointer to dlsch to be encoded
|
||||
@param frame Frame number
|
||||
@param subframe Subframe number
|
||||
@param rm_stats Time statistics for rate-matching
|
||||
@param te_stats Time statistics for turbo-encoding
|
||||
@param i_stats Time statistics for interleaving
|
||||
@returns status
|
||||
*/
|
||||
|
||||
int dci_modulation_NB_IoT(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t control_region_size,
|
||||
NB_IoT_eNB_NPDCCH_t *dlcch,
|
||||
unsigned int npdsch_data_subframe,
|
||||
uint8_t agr_level,
|
||||
uint8_t ncce_index,
|
||||
unsigned int subframe,
|
||||
unsigned short NB_IoT_RB_ID);
|
||||
|
||||
int dci_allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
uint32_t symbol_offset,
|
||||
uint8_t *x0,
|
||||
uint8_t pilots,
|
||||
uint8_t pilot_shift,
|
||||
int16_t amp,
|
||||
unsigned short id_offset,
|
||||
uint8_t ncce_index,
|
||||
uint8_t agr_level,
|
||||
uint32_t *re_allocated);
|
||||
|
||||
|
||||
void dci_encoding_NB_IoT(uint8_t *a,
|
||||
NB_IoT_eNB_NPDCCH_t *dlcch,
|
||||
uint8_t A,
|
||||
uint16_t G,
|
||||
uint8_t ncce_index,
|
||||
uint8_t agr_level);
|
||||
|
||||
|
||||
void npdcch_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
NB_IoT_eNB_NPDCCH_t *dlcch, // Input data
|
||||
int G, // Total number of bits to transmit in one subframe(case of DCI = G)
|
||||
uint8_t Ns, //XXX we pass the subframe // Slot number (0..19)
|
||||
uint8_t ncce_index,
|
||||
uint8_t agr_level);
|
||||
|
||||
|
||||
int dlsch_modulation_NB_IoT(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t control_region_size, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
|
||||
NB_IoT_eNB_NDLSCH_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
|
||||
int G, // number of bits per subframe
|
||||
unsigned int npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
|
||||
unsigned int subframe,
|
||||
unsigned short NB_IoT_RB_ID);
|
||||
/*
|
||||
int dlsch_modulation_rar_NB_IoT(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t control_region_size, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
|
||||
NB_IoT_DL_eNB_HARQ_t *dlsch0, //NB_IoT_eNB_NDLSCH_t
|
||||
int G, // number of bits per subframe
|
||||
unsigned int npdsch_data_subframe, // subframe index of the data table of npdsch channel (G*Nsf) , values are between 0..Nsf
|
||||
unsigned int subframe,
|
||||
unsigned short NB_IoT_RB_ID,
|
||||
uint8_t option);
|
||||
*/
|
||||
int32_t dlsch_encoding_NB_IoT(unsigned char *a,
|
||||
NB_IoT_eNB_NDLSCH_t *dlsch, // NB_IoT_eNB_NDLSCH_t
|
||||
uint8_t Nsf, // number of subframes required for npdsch pdu transmission calculated from Isf (3GPP spec table)
|
||||
unsigned int G); // G (number of available RE) is implicitly multiplied by 2 (since only QPSK modulation)
|
||||
|
||||
|
||||
void get_pilots_position(uint8_t npusch_format,uint8_t subcarrier_spacing,uint8_t *pilot_pos1,uint8_t *pilot_pos2,uint8_t *pilots_slot);
|
||||
|
||||
void UL_channel_estimation_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *fp,
|
||||
uint16_t UL_RB_ID_NB_IoT,
|
||||
uint16_t Nsc_RU,
|
||||
uint8_t pilot_pos1,
|
||||
uint8_t pilot_pos2,
|
||||
uint16_t ul_sc_start,
|
||||
uint8_t Qm,
|
||||
uint16_t N_SF_per_word,
|
||||
uint8_t rx_subframe);
|
||||
|
||||
void get_llr_per_sf_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *fp,
|
||||
uint8_t npusch_format,
|
||||
uint8_t counter_sf,
|
||||
uint16_t N_SF_per_word,
|
||||
uint8_t pilot_pos1,
|
||||
uint8_t pilot_pos2,
|
||||
uint16_t ul_sc_start,
|
||||
uint16_t Nsc_RU);
|
||||
|
||||
void descrambling_NPUSCH_data_NB_IoT(LTE_DL_FRAME_PARMS *fp,
|
||||
int16_t *ulsch_llr,
|
||||
int16_t *y,
|
||||
uint8_t Qm,
|
||||
unsigned int Cmux,
|
||||
uint32_t rnti_tmp,
|
||||
uint8_t rx_subframe,
|
||||
uint32_t rx_frame);
|
||||
|
||||
void descrambling_NPUSCH_ack_NB_IoT(LTE_DL_FRAME_PARMS *fp,
|
||||
int32_t *y_msg5,
|
||||
int32_t *llr_msg5,
|
||||
uint32_t rnti_tmp,
|
||||
uint16_t *counter_ack,
|
||||
uint8_t rx_subframe,
|
||||
uint32_t rx_frame);
|
||||
|
||||
void turbo_decoding_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
NB_IoT_eNB_NULSCH_t *ulsch_NB_IoT,
|
||||
eNB_rxtx_proc_t *proc,
|
||||
uint8_t npusch_format,
|
||||
unsigned int G,
|
||||
uint8_t rvdx,
|
||||
uint8_t Qm,
|
||||
uint32_t rx_frame,
|
||||
uint8_t rx_subframe);
|
||||
|
||||
void decode_NPUSCH_msg_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *fp,
|
||||
eNB_rxtx_proc_t *proc,
|
||||
uint8_t npusch_format,
|
||||
uint16_t N_SF_per_word,
|
||||
uint16_t Nsc_RU,
|
||||
uint16_t N_UL_slots,
|
||||
uint8_t Qm,
|
||||
uint8_t pilots_slot,
|
||||
uint32_t rnti_tmp,
|
||||
uint8_t rx_subframe,
|
||||
uint32_t rx_frame);
|
||||
|
||||
void deinterleaving_NPUSCH_data_NB_IoT(NB_IoT_UL_eNB_HARQ_t *ulsch_harq, int16_t *y, unsigned int G);
|
||||
|
||||
|
||||
uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
eNB_rxtx_proc_t *proc,
|
||||
uint8_t eNB_id, // this is the effective sector id
|
||||
uint8_t UE_id,
|
||||
uint16_t UL_RB_ID_NB_IoT, // 22 , to be included in // to be replaced by NB_IoT_start ??
|
||||
uint8_t subframe,
|
||||
uint32_t frame);
|
||||
|
||||
void ulsch_extract_rbs_single_NB_IoT(int32_t **rxdataF,
|
||||
int32_t **rxdataF_ext,
|
||||
uint16_t UL_RB_ID_NB_IoT, // index of UL NB_IoT resource block !!! may be defined twice : in frame_parms and in NB_IoT_UL_eNB_HARQ_t
|
||||
uint16_t N_sc_RU, // number of subcarriers in UL
|
||||
uint8_t l,
|
||||
uint8_t Ns,
|
||||
LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void ulsch_channel_level_NB_IoT(int32_t **drs_ch_estimates_ext,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *avg,
|
||||
uint16_t nb_rb);
|
||||
|
||||
void ulsch_channel_compensation_NB_IoT(int32_t **rxdataF_ext,
|
||||
int32_t **ul_ch_estimates_ext,
|
||||
int32_t **ul_ch_mag,
|
||||
int32_t **ul_ch_magb,
|
||||
int32_t **rxdataF_comp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t symbol,
|
||||
uint8_t Qm,
|
||||
uint16_t nb_rb,
|
||||
uint8_t output_shift);
|
||||
|
||||
void lte_idft_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH);
|
||||
|
||||
void extract_CQI_NB_IoT(void *o,UCI_format_NB_IoT_t uci_format,NB_IoT_eNB_UE_stats *stats,uint8_t N_RB_DL, uint16_t * crnti, uint8_t * access_mode);
|
||||
|
||||
//*****************Vincent part for nprach ******************//
|
||||
uint32_t process_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe,uint16_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance);
|
||||
|
||||
uint32_t TA_estimation_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
int16_t *Rx_sub_sampled_buffer,
|
||||
uint16_t sub_sampling_rate,
|
||||
uint16_t FRAME_LENGTH_COMPLEX_SUB_SAMPLES,
|
||||
uint32_t estimated_TA_coarse,
|
||||
uint8_t coarse);
|
||||
|
||||
uint8_t NPRACH_detection_NB_IoT(int16_t *input_buffer,uint32_t FRAME_LENGTH_COMPLEX_SAMPLESx);
|
||||
|
||||
int16_t* sub_sampling_NB_IoT(int16_t *input_buffer, uint32_t length_input, uint32_t *length_ouput, uint16_t sub_sampling_rate);
|
||||
|
||||
void filtering_signal(int16_t *input_buffer, int16_t *filtered_buffer, uint32_t FRAME_LENGTH_COMPLEX_SAMPLESx);
|
||||
//************************************************************//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//uint8_t get_UL_I_TBS_from_MCS_NB_IoT(uint8_t I_mcs, uint8_t N_sc_RU, uint8_t Msg3_flag);
|
||||
|
||||
uint8_t get_Qm_UL_NB_IoT(unsigned char I_mcs, uint8_t N_sc_RU, uint8_t I_sc, uint8_t Msg3_flag);
|
||||
|
||||
//uint16_t get_UL_sc_start_NB_IoT(uint16_t I_sc);
|
||||
|
||||
uint16_t get_UL_sc_ACK_NB_IoT(uint8_t subcarrier_spacing,uint16_t harq_ack_resource);
|
||||
|
||||
uint16_t get_UL_sc_index_start_NB_IoT(uint8_t subcarrier_spacing, uint16_t I_sc, uint8_t npush_format);
|
||||
|
||||
uint16_t get_UL_N_ru_NB_IoT(uint8_t I_mcs, uint8_t I_ru, uint8_t flag_msg3);
|
||||
|
||||
uint16_t get_UL_N_rep_NB_IoT(uint8_t I_rep);
|
||||
|
||||
uint8_t get_numb_UL_sc_NB_IoT(uint8_t subcarrier_spacing, uint8_t I_sc, uint8_t npush_format);
|
||||
|
||||
uint8_t get_UL_slots_per_RU_NB_IoT(uint8_t subcarrier_spacing, uint8_t subcarrier_indcation, uint8_t UL_format);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void generate_grouphop_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void init_ul_hopping_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void rotate_single_carrier_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
uint8_t eNB_id,
|
||||
uint8_t symbol, //symbol within subframe
|
||||
uint8_t counter_msg3, /// to be replaced by the number of received part
|
||||
uint16_t ul_sc_start,
|
||||
uint8_t Qm,
|
||||
uint16_t N_SF_per_word,
|
||||
uint8_t option);
|
||||
|
||||
void fill_rbs_zeros_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
uint16_t ul_sc_start,
|
||||
uint8_t UE_id,
|
||||
uint8_t symbol);
|
||||
|
||||
int32_t ulsch_bpsk_llr_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int16_t *ulsch_llr,
|
||||
uint8_t symbol,
|
||||
uint16_t ul_sc_start,
|
||||
uint8_t UE_id,
|
||||
int16_t **llrp);
|
||||
|
||||
int32_t ulsch_qpsk_llr_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int16_t *ulsch_llr,
|
||||
uint8_t symbol,
|
||||
uint8_t UE_id,
|
||||
uint16_t ul_sc_start,
|
||||
uint8_t Nsc_RU,
|
||||
int16_t *llrp);
|
||||
|
||||
void rotate_bpsk_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
uint16_t ul_sc_start,
|
||||
uint8_t UE_id,
|
||||
uint8_t symbol);
|
||||
//************************************************************//
|
||||
|
||||
|
||||
int rx_npdsch_NB_IoT(PHY_VARS_UE_NB_IoT *ue,
|
||||
unsigned char eNB_id,
|
||||
unsigned char eNB_id_i, //if this == ue->n_connected_eNB, we assume MU interference
|
||||
uint32_t frame,
|
||||
uint8_t subframe,
|
||||
unsigned char symbol,
|
||||
unsigned char first_symbol_flag,
|
||||
unsigned char i_mod,
|
||||
unsigned char harq_pid);
|
||||
|
||||
unsigned short dlsch_extract_rbs_single_NB_IoT(int **rxdataF,
|
||||
int **dl_ch_estimates,
|
||||
int **rxdataF_ext,
|
||||
int **dl_ch_estimates_ext,
|
||||
unsigned short pmi,
|
||||
unsigned char *pmi_ext,
|
||||
unsigned int *rb_alloc,
|
||||
unsigned char symbol,
|
||||
unsigned char subframe,
|
||||
uint32_t frame,
|
||||
uint32_t high_speed_flag,
|
||||
NB_IoT_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void dlsch_channel_level_NB_IoT(int **dl_ch_estimates_ext,
|
||||
NB_IoT_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *avg,
|
||||
uint8_t symbol,
|
||||
unsigned short nb_rb);
|
||||
|
||||
void dlsch_channel_compensation_NB_IoT(int **rxdataF_ext,
|
||||
int **dl_ch_estimates_ext,
|
||||
int **dl_ch_mag,
|
||||
int **dl_ch_magb,
|
||||
int **rxdataF_comp,
|
||||
int **rho,
|
||||
NB_IoT_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char symbol,
|
||||
uint8_t first_symbol_flag,
|
||||
unsigned char mod_order,
|
||||
unsigned short nb_rb,
|
||||
unsigned char output_shift,
|
||||
PHY_MEASUREMENTS_NB_IoT *measurements);
|
||||
|
||||
int dlsch_qpsk_llr_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int16_t *dlsch_llr,
|
||||
uint8_t symbol,
|
||||
uint8_t first_symbol_flag,
|
||||
uint16_t nb_rb,
|
||||
int16_t **llr32p,
|
||||
uint8_t beamforming_mode);
|
||||
|
||||
/// Vincent: temporary functions
|
||||
|
||||
int ul_chest_tmp_NB_IoT(int32_t **rxdataF_ext,
|
||||
int32_t **ul_ch_estimates,
|
||||
uint8_t l, //symbol within slot
|
||||
uint8_t Ns,
|
||||
uint8_t counter_msg3,
|
||||
uint8_t pilot_pos1,
|
||||
uint8_t pilot_pos2,
|
||||
uint16_t ul_sc_start,
|
||||
uint8_t Qm,
|
||||
uint16_t N_SF_per_word,
|
||||
LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
/// Channel estimation for NPUSCH format 2
|
||||
int ul_chest_tmp_f2_NB_IoT(int32_t **rxdataF_ext,
|
||||
int32_t **ul_ch_estimates,
|
||||
uint8_t l, //symbol within slot
|
||||
uint8_t Ns,
|
||||
uint8_t counter_msg3,
|
||||
uint8_t flag,
|
||||
uint8_t subframerx,
|
||||
uint8_t Qm,
|
||||
uint16_t ul_sc_start,
|
||||
LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void rotate_channel_sc_tmp_NB_IoT(int16_t *estimated_channel,
|
||||
uint8_t l,
|
||||
uint8_t Qm,
|
||||
uint8_t counter_msg3,
|
||||
uint16_t N_SF_per_word,
|
||||
uint16_t ul_sc_start,
|
||||
uint8_t flag);
|
||||
|
||||
int ul_chequal_tmp_NB_IoT(int32_t **rxdataF_ext,
|
||||
int32_t **rxdataF_comp,
|
||||
int32_t **ul_ch_estimates,
|
||||
uint8_t l, //symbol within slot
|
||||
uint8_t Ns,
|
||||
LTE_DL_FRAME_PARMS *frame_parms);
|
||||
///
|
||||
|
||||
////////////////////////////NB-IoT testing ///////////////////////////////
|
||||
void clean_eNb_ulsch_NB_IoT(NB_IoT_eNB_NULSCH_t *ulsch);
|
||||
|
||||
int get_G_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
int get_G_SIB1_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, uint8_t operation_mode_info);
|
||||
|
||||
int get_rep_num_SIB1_NB_IoT(uint8_t scheduling_info_sib1);
|
||||
|
||||
int get_start_frame_SIB1_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,uint8_t repetition);
|
||||
|
||||
NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB_IoT(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1263,7 +1263,7 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX
|
||||
int32_t IP_CsData_allsfavg[NB_ANTENNAS_RX][14][4][2];
|
||||
int32_t IP_allavg[D_NPUCCH_SF5];
|
||||
//int16_t temp_ch[2];
|
||||
int16_t m[NUMBER_OF_UE_MAX], m_self, same_m_number;
|
||||
int16_t m[NUMBER_OF_UE_MAX], m_self=0, same_m_number;
|
||||
uint16_t n3_pucch_sameRB[NUMBER_OF_UE_MAX];
|
||||
int16_t n_oc0[NUMBER_OF_UE_MAX];
|
||||
int16_t n_oc1[NUMBER_OF_UE_MAX];
|
||||
|
||||
62
openair1/PHY/LTE_TRANSPORT/sc_rotation_NB_IoT.h
Normal file
62
openair1/PHY/LTE_TRANSPORT/sc_rotation_NB_IoT.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/sc_rotation_NB_IoT.c
|
||||
* \brief Some support routines for MCS computations
|
||||
* \author V. SAVAUX, M. KANJ
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company b<>com
|
||||
* \email:
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __PHY_LTE_TRANSPORT_SC_ROTATION_NB_IOT__H__
|
||||
#define __PHY_LTE_TRANSPORT_SC_ROTATION_NB_IOT__H__
|
||||
|
||||
|
||||
int16_t e_phi_re_p5[120] = {32767, 24811, 4807, -17531, -31357, -29956, -14010, 0, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, 0, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, 0, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, -1, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, 0, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, 0, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, -1, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, 0, -21403, -32413, -27684, -9512, 13278, 29621};
|
||||
int16_t e_phi_im_p5[120] = {0, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, -1, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, 0, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, 0, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, -1, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, 0, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, 0, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, -1, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009};
|
||||
int16_t e_phi_re_m6[120] = {32767, 24811, 4807, -17531, -31357, -29956, -14010, 0, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, 0, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, 0, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, -1, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, 0, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, 0, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, -1, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, 0, -21403, -32413, -27684, -9512, 13278, 29621};
|
||||
int16_t e_phi_im_m6[120] = {0, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, 0, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, -1, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, -1, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, 0, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, -1, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010, -1, 21402, 32412, 27683, 9511, -13279, -29622, -32767, -24812, -4808, 17530, 31356, 29955, 14009, 0, -21403, -32413, -27684, -9512, 13278, 29621, 32767, 24811, 4807, -17531, -31357, -29956, -14010};
|
||||
int16_t e_phi_re_m5[120] = {32767, 13278, -22005, -31114, -3212, 28510, 26318, 0, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, -1, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, -1, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, 0, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, -1, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, 0, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, 0, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, -1, 29955, 24278, -10279, -32610, -16151, 19519};
|
||||
int16_t e_phi_im_m5[120] = {0, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, 0, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, 0, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, -1, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, 0, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, -1, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, -1, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, 0, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319};
|
||||
int16_t e_phi_re_m4[120] = {32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, 0, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, -1, -32758, 1607, 32678, -3212, -32521, 4807};
|
||||
int16_t e_phi_im_m4[120] = {0, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, -1, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413};
|
||||
int16_t e_phi_re_m3[120] = {32767, -14733, -19520, 32284, -9512, -23732, 30851, 0, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, -1, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, 0, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, 0, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, -1, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, -1, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, 0, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, -1, 29268, -26319, -5602, 31356, -22595, -11039};
|
||||
int16_t e_phi_im_m3[120] = {0, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, -1, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, -1, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, -1, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, 0, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, -1, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, -1, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, 0, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852};
|
||||
int16_t e_phi_re_m2[120] = {32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, -1, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, 0, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, 0, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, 0, -20160, 31785, -29956, 15446, 5601, -24279};
|
||||
int16_t e_phi_im_m2[120] = {0, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, -1, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, 0, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, 0, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, 0, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, 0, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005};
|
||||
int16_t e_phi_re_m1[120] = {32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, 0, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, -1, 7179, -14010, 20159, -25330, 29268, -31786};
|
||||
int16_t e_phi_im_m1[120] = {0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, 0, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962};
|
||||
int16_t e_phi_re_0[120] = {32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, 0, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, -1, 7179, -14010, 20159, -25330, 29268, -31786};
|
||||
int16_t e_phi_im_0[120] = {0, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, 0, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961, -1, -7180, 14009, -20160, 25329, -29269, 31785, -32767, 31970, -29622, 25831, -20788, 14732, -7962, -1, 7179, -14010, 20159, -25330, 29268, -31786, 32767, -31971, 29621, -25832, 20787, -14733, 7961};
|
||||
int16_t e_phi_re_p1[120] = {32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, -1, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, 0, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, 0, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, 0, -20160, 31785, -29956, 15446, 5601, -24279};
|
||||
int16_t e_phi_im_p1[120] = {0, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, 0, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, -1, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, 0, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004, 0, -20160, 31785, -29956, 15446, 5601, -24279, 32767, -25832, 7961, 13278, -28898, 32284, -22005, -1, 20159, -31786, 29955, -15447, -5602, 24278, -32767, 25831, -7962, -13279, 28897, -32285, 22004};
|
||||
int16_t e_phi_re_p2[120] = {32767, -14733, -19520, 32284, -9512, -23732, 30851, 0, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, -1, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, 0, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, 0, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, -1, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, -1, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, 0, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, -1, 29268, -26319, -5602, 31356, -22595, -11039};
|
||||
int16_t e_phi_im_p2[120] = {0, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, 0, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, 0, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, 0, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, -1, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, 0, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851, 0, -29269, 26318, 5601, -31357, 22594, 11038, -32767, 14732, 19519, -32285, 9511, 23731, -30852, -1, 29268, -26319, -5602, 31356, -22595, -11039, 32767, -14733, -19520, 32284, -9512, -23732, 30851};
|
||||
int16_t e_phi_re_p3[120] = {32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, 0, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, -1, -32758, 1607, 32678, -3212, -32521, 4807};
|
||||
int16_t e_phi_im_p3[120] = {0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, -1, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412, 0, -32758, 1607, 32678, -3212, -32521, 4807, 32767, -805, -32728, 2410, 32609, -4012, -32413, 0, 32757, -1608, -32679, 3211, 32520, -4808, -32767, 804, 32727, -2411, -32610, 4011, 32412};
|
||||
int16_t e_phi_re_p4[120] = {32767, 13278, -22005, -31114, -3212, 28510, 26318, 0, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, -1, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, -1, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, 0, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, -1, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, 0, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, 0, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, -1, 29955, 24278, -10279, -32610, -16151, 19519};
|
||||
int16_t e_phi_im_p4[120] = {0, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, -1, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, -1, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, 0, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, -1, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, 0, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318, 0, -29956, -24279, 10278, 32609, 16150, -19520, -32767, -13279, 22004, 31113, 3211, -28511, -26319, -1, 29955, 24278, -10279, -32610, -16151, 19519, 32767, 13278, -22005, -31114, -3212, 28510, 26318};
|
||||
|
||||
#endif
|
||||
583
openair1/PHY/LTE_TRANSPORT/tables_nprach_NB_IoT.h
Normal file
583
openair1/PHY/LTE_TRANSPORT/tables_nprach_NB_IoT.h
Normal file
File diff suppressed because one or more lines are too long
324
openair1/PHY/LTE_TRANSPORT/uci_NB_IoT.h
Normal file
324
openair1/PHY/LTE_TRANSPORT/uci_NB_IoT.h
Normal file
@@ -0,0 +1,324 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef __UCI_NB_IOT__H__
|
||||
#define __UCI_NB_IOT__H__
|
||||
//#include "PHY/types_NB_IoT.h"
|
||||
|
||||
|
||||
|
||||
typedef enum {
|
||||
ue_selected_NB_IoT,
|
||||
wideband_cqi_rank1_2A_NB_IoT, //wideband_cqi_rank1_2A,
|
||||
wideband_cqi_rank2_2A_NB_IoT, //wideband_cqi_rank2_2A,
|
||||
HLC_subband_cqi_nopmi_NB_IoT, //HLC_subband_cqi_nopmi,
|
||||
HLC_subband_cqi_rank1_2A_NB_IoT, //HLC_subband_cqi_rank1_2A,
|
||||
HLC_subband_cqi_rank2_2A_NB_IoT, //HLC_subband_cqi_rank2_2A,
|
||||
HLC_subband_cqi_modes123_NB_IoT, //HLC_subband_cqi_modes123
|
||||
HLC_subband_cqi_mcs_CBA_NB_IoT, // MCS and RNTI, for contention-based acces
|
||||
unknown_cqi_NB_IoT//
|
||||
} UCI_format_NB_IoT_t;
|
||||
|
||||
// **********************************************1.5 MHz***************************************************************************
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:16;
|
||||
uint32_t pmi:12;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
wideband_cqi_rank1_2A_1_5MHz_NB_IoT ;
|
||||
#define sizeof_wideband_cqi_rank1_2A_1_5MHz_NB_IoT 16
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint16_t padding:2;
|
||||
uint16_t pmi:6;
|
||||
uint16_t cqi2:4;
|
||||
uint16_t cqi1:4;
|
||||
}
|
||||
wideband_cqi_rank2_2A_1_5MHz_NB_IoT ;
|
||||
#define sizeof_wideband_cqi_rank2_2A_1_5MHz_NB_IoT 14
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:16;
|
||||
uint32_t diffcqi1:12;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_nopmi_1_5MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_nopmi_1_5MHz_NB_IoT 16
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:14;
|
||||
uint32_t pmi:2;
|
||||
uint32_t diffcqi1:12;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT 18
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint64_t padding:31;
|
||||
uint64_t pmi:1;
|
||||
uint64_t diffcqi2:12;
|
||||
uint64_t cqi2:4;
|
||||
uint64_t diffcqi1:12;
|
||||
uint64_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT 33
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:16;
|
||||
uint32_t diffcqi1:12;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_modes123_1_5MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_modes123_1_5MHz_NB_IoT 16
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:11;
|
||||
uint32_t crnti:16;
|
||||
uint32_t mcs:5;
|
||||
}
|
||||
HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT 21
|
||||
|
||||
|
||||
// **********************************************5 MHz***************************************************************************
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:14;
|
||||
uint32_t pmi:14;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
wideband_cqi_rank1_2A_5MHz_NB_IoT ;
|
||||
#define sizeof_wideband_cqi_rank1_2A_5MHz_NB_IoT 18
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint16_t padding:1;
|
||||
uint16_t pmi:7;
|
||||
uint16_t cqi2:4;
|
||||
uint16_t cqi1:4;
|
||||
}
|
||||
wideband_cqi_rank2_2A_5MHz_NB_IoT ;
|
||||
#define sizeof_wideband_cqi_rank2_2A_5MHz_NB_IoT 15
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:14;
|
||||
uint32_t diffcqi1:14;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_nopmi_5MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_nopmi_5MHz_NB_IoT 18
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:12;
|
||||
uint32_t pmi:2;
|
||||
uint32_t diffcqi1:14;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_rank1_2A_5MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_rank1_2A_5MHz_NB_IoT 20
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint64_t padding:27;
|
||||
uint64_t pmi:1;
|
||||
uint64_t diffcqi2:14;
|
||||
uint64_t cqi2:4;
|
||||
uint64_t diffcqi1:14;
|
||||
uint64_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_rank2_2A_5MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_rank2_2A_5MHz_NB_IoT 37
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:14;
|
||||
uint32_t diffcqi1:14;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_modes123_5MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_modes123_5MHz_NB_IoT 18
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:11;
|
||||
uint32_t crnti:16;
|
||||
uint32_t mcs:5;
|
||||
}
|
||||
HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT 21
|
||||
|
||||
// **********************************************10 MHz***************************************************************************
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:10;
|
||||
uint32_t pmi:18;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
wideband_cqi_rank1_2A_10MHz_NB_IoT ;
|
||||
#define sizeof_wideband_cqi_rank1_2A_10MHz_NB_IoT 22
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:15;
|
||||
uint32_t pmi:9;
|
||||
uint32_t cqi2:4;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
wideband_cqi_rank2_2A_10MHz_NB_IoT ;
|
||||
#define sizeof_wideband_cqi_rank2_2A_10MHz_NB_IoT 17
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:10;
|
||||
uint32_t diffcqi1:18;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_nopmi_10MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_nopmi_10MHz_NB_IoT 22
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:8;
|
||||
uint32_t pmi:2;
|
||||
uint32_t diffcqi1:18;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_rank1_2A_10MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_rank1_2A_10MHz_NB_IoT 24
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint64_t padding:19;
|
||||
uint64_t pmi:1;
|
||||
uint64_t diffcqi2:18;
|
||||
uint64_t cqi2:4;
|
||||
uint64_t diffcqi1:18;
|
||||
uint64_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_rank2_2A_10MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_rank2_2A_10MHz_NB_IoT 45
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:10;
|
||||
uint32_t diffcqi1:18;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_modes123_10MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_modes123_10MHz_NB_IoT 22
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:11;
|
||||
uint32_t crnti:16;
|
||||
uint32_t mcs:5;
|
||||
}
|
||||
HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT 21
|
||||
|
||||
// **********************************************20 MHz***************************************************************************
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:2;
|
||||
uint32_t pmi:26;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
wideband_cqi_rank1_2A_20MHz_NB_IoT ;
|
||||
#define sizeof_wideband_cqi_rank1_2A_20MHz_NB_IoT 20
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:11;
|
||||
uint32_t pmi:13;
|
||||
uint32_t cqi2:4;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
wideband_cqi_rank2_2A_20MHz_NB_IoT ;
|
||||
#define sizeof_wideband_cqi_rank2_2A_20MHz_NB_IoT 21
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:2;
|
||||
uint32_t diffcqi1:26;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_nopmi_20MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_nopmi_20MHz_NB_IoT 30
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
// uint32_t padding:12;
|
||||
uint32_t pmi:2;
|
||||
uint32_t diffcqi1:26;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_rank1_2A_20MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_rank1_2A_20MHz_NB_IoT 32
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint64_t padding:3;
|
||||
uint64_t pmi:1;
|
||||
uint64_t diffcqi2:26;
|
||||
uint64_t cqi2:4;
|
||||
uint64_t diffcqi1:26;
|
||||
uint64_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_rank2_2A_20MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_rank2_2A_20MHz_NB_IoT 61
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:2;
|
||||
uint32_t diffcqi1:26;
|
||||
uint32_t cqi1:4;
|
||||
}
|
||||
HLC_subband_cqi_modes123_20MHz_NB_IoT;
|
||||
#define sizeof_HLC_subband_cqi_modes123_20MHz_NB_IoT 30
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t padding:11;
|
||||
uint32_t crnti:16;
|
||||
uint32_t mcs:5;
|
||||
}
|
||||
HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT;
|
||||
|
||||
#define sizeof_HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT 21
|
||||
|
||||
#define MAX_CQI_PAYLOAD_NB_IoT (sizeof(HLC_subband_cqi_rank2_2A_20MHz_NB_IoT)*8*20)
|
||||
#define MAX_CQI_BITS_NB_IoT (sizeof(HLC_subband_cqi_rank2_2A_20MHz_NB_IoT)*8)
|
||||
#define MAX_CQI_BYTES_NB_IoT (sizeof(HLC_subband_cqi_rank2_2A_20MHz_NB_IoT))
|
||||
#define MAX_ACK_PAYLOAD_NB_IoT 18
|
||||
#define MAX_RI_PAYLOAD_NB_IoT 6
|
||||
|
||||
#endif
|
||||
431
openair1/PHY/LTE_TRANSPORT/uci_tools_NB_IoT.c
Normal file
431
openair1/PHY/LTE_TRANSPORT/uci_tools_NB_IoT.c
Normal file
@@ -0,0 +1,431 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/phich.c
|
||||
* \brief Routines for generation of and computations regarding the uplink control information (UCI) for PUSCH. V8.6 2009-03
|
||||
* \author R. Knopp, F. Kaltenberger, A. Bhamri
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr, florian.kaltenberger@eurecom.fr, ankit.bhamri@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "PHY/extern_NB_IoT.h"
|
||||
#ifdef DEBUG_UCI_TOOLS
|
||||
#include "PHY/vars_NB_IoT.h"
|
||||
#endif
|
||||
|
||||
|
||||
void do_diff_cqi_NB_IoT(uint8_t N_RB_DL,
|
||||
uint8_t *DL_subband_cqi,
|
||||
uint8_t DL_cqi,
|
||||
uint32_t diffcqi1)
|
||||
{
|
||||
|
||||
uint8_t nb_sb,i,offset;
|
||||
|
||||
// This is table 7.2.1-3 from 36.213 (with k replaced by the number of subbands, nb_sb)
|
||||
switch (N_RB_DL) {
|
||||
case 6:
|
||||
nb_sb=1;
|
||||
break;
|
||||
|
||||
case 15:
|
||||
nb_sb = 4;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
nb_sb = 7;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
nb_sb = 9;
|
||||
break;
|
||||
|
||||
case 75:
|
||||
nb_sb = 10;
|
||||
break;
|
||||
|
||||
case 100:
|
||||
nb_sb = 13;
|
||||
break;
|
||||
|
||||
default:
|
||||
nb_sb=0;
|
||||
break;
|
||||
}
|
||||
|
||||
memset(DL_subband_cqi,0,13);
|
||||
|
||||
for (i=0; i<nb_sb; i++) {
|
||||
offset = (diffcqi1>>(2*i))&3;
|
||||
|
||||
if (offset == 3)
|
||||
DL_subband_cqi[i] = DL_cqi - 1;
|
||||
else
|
||||
DL_subband_cqi[i] = DL_cqi + offset;
|
||||
}
|
||||
}
|
||||
|
||||
void extract_CQI_NB_IoT(void *o,UCI_format_NB_IoT_t uci_format,NB_IoT_eNB_UE_stats *stats, uint8_t N_RB_DL, uint16_t * crnti, uint8_t * access_mode)
|
||||
{
|
||||
|
||||
|
||||
uint8_t i;
|
||||
LOG_D(PHY,"[eNB][UCI] N_RB_DL %d uci format %d\n", N_RB_DL,uci_format);
|
||||
|
||||
switch(N_RB_DL) {
|
||||
case 6:
|
||||
switch(uci_format) {
|
||||
case wideband_cqi_rank1_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_1_5MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_1_5MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case wideband_cqi_rank2_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->cqi2);
|
||||
|
||||
if (stats->DL_cqi[1] > 24)
|
||||
stats->DL_cqi[1] = 24;
|
||||
|
||||
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_nopmi_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_1_5MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_1_5MHz_NB_IoT *)o)->diffcqi1);
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_rank1_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT *)o)->diffcqi1));
|
||||
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_rank2_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->cqi2);
|
||||
|
||||
if (stats->DL_cqi[1] > 24)
|
||||
stats->DL_cqi[1] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->diffcqi1));
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->diffcqi2));
|
||||
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_mcs_CBA_NB_IoT:
|
||||
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT *)o)->crnti) && (*crnti !=0)) {
|
||||
*access_mode=CBA_ACCESS;
|
||||
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
|
||||
((HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT *)o)->crnti);
|
||||
} else {
|
||||
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
|
||||
*crnti, ((HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT *)o)->crnti);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case unknown_cqi:
|
||||
default:
|
||||
LOG_N(PHY,"[eNB][UCI] received unknown uci (rb %d)\n",N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 25:
|
||||
|
||||
switch(uci_format) {
|
||||
case wideband_cqi_rank1_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_5MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_5MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case wideband_cqi_rank2_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_5MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_5MHz_NB_IoT *)o)->cqi2);
|
||||
|
||||
if (stats->DL_cqi[1] > 24)
|
||||
stats->DL_cqi[1] = 24;
|
||||
|
||||
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_5MHz_NB_IoT *)o)->pmi;
|
||||
//this translates the 2-layer PMI into a single layer PMI for the first codeword
|
||||
//the PMI for the second codeword will be stats->DL_pmi_single^0x1555
|
||||
stats->DL_pmi_single = 0;
|
||||
for (i=0;i<7;i++)
|
||||
stats->DL_pmi_single = stats->DL_pmi_single | (((stats->DL_pmi_dual&(1<i))>>i)*2)<<2*i;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_nopmi_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_5MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_5MHz_NB_IoT *)o)->diffcqi1);
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_rank1_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_5MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_5MHz_NB_IoT *)o)->diffcqi1));
|
||||
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_5MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_rank2_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_5MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_5MHz_NB_IoT *)o)->cqi2);
|
||||
|
||||
if (stats->DL_cqi[1] > 24)
|
||||
stats->DL_cqi[1] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_5MHz_NB_IoT *)o)->diffcqi1));
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_5MHz_NB_IoT *)o)->diffcqi2));
|
||||
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_5MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_mcs_CBA_NB_IoT:
|
||||
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT *)o)->crnti) && (*crnti !=0)) {
|
||||
*access_mode=CBA_ACCESS;
|
||||
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
|
||||
((HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT *)o)->crnti);
|
||||
} else {
|
||||
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
|
||||
*crnti, ((HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT *)o)->crnti);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case unknown_cqi_NB_IoT:
|
||||
default:
|
||||
LOG_N(PHY,"[eNB][UCI] received unknown uci (rb %d)\n",N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 50:
|
||||
switch(uci_format) {
|
||||
case wideband_cqi_rank1_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_10MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_10MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case wideband_cqi_rank2_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_10MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_10MHz_NB_IoT *)o)->cqi2);
|
||||
|
||||
if (stats->DL_cqi[1] > 24)
|
||||
stats->DL_cqi[1] = 24;
|
||||
|
||||
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_10MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_nopmi_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_10MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_10MHz_NB_IoT *)o)->diffcqi1);
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_rank1_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_10MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_10MHz_NB_IoT *)o)->diffcqi1));
|
||||
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_10MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_rank2_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_10MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_10MHz_NB_IoT *)o)->cqi2);
|
||||
|
||||
if (stats->DL_cqi[1] > 24)
|
||||
stats->DL_cqi[1] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_10MHz_NB_IoT *)o)->diffcqi1));
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_10MHz_NB_IoT *)o)->diffcqi2));
|
||||
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_10MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_mcs_CBA_NB_IoT:
|
||||
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT *)o)->crnti) && (*crnti !=0)) {
|
||||
*access_mode=CBA_ACCESS;
|
||||
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
|
||||
((HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT *)o)->crnti);
|
||||
} else {
|
||||
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
|
||||
*crnti, ((HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT *)o)->crnti);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case unknown_cqi_NB_IoT:
|
||||
default:
|
||||
LOG_N(PHY,"[eNB][UCI] received unknown uci (RB %d)\n",N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 100:
|
||||
switch(uci_format) {
|
||||
case wideband_cqi_rank1_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_20MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_20MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case wideband_cqi_rank2_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_20MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_20MHz_NB_IoT *)o)->cqi2);
|
||||
|
||||
if (stats->DL_cqi[1] > 24)
|
||||
stats->DL_cqi[1] = 24;
|
||||
|
||||
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_20MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_nopmi_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_20MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_20MHz_NB_IoT *)o)->diffcqi1);
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_rank1_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_20MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_20MHz_NB_IoT *)o)->diffcqi1));
|
||||
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_20MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_rank2_2A_NB_IoT:
|
||||
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_20MHz_NB_IoT *)o)->cqi1);
|
||||
|
||||
if (stats->DL_cqi[0] > 24)
|
||||
stats->DL_cqi[0] = 24;
|
||||
|
||||
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_20MHz_NB_IoT *)o)->cqi2);
|
||||
|
||||
if (stats->DL_cqi[1] > 24)
|
||||
stats->DL_cqi[1] = 24;
|
||||
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_20MHz_NB_IoT *)o)->diffcqi1));
|
||||
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_20MHz_NB_IoT *)o)->diffcqi2));
|
||||
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_20MHz_NB_IoT *)o)->pmi;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_mcs_CBA_NB_IoT:
|
||||
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT *)o)->crnti) && (*crnti !=0)) {
|
||||
*access_mode=CBA_ACCESS;
|
||||
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
|
||||
((HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT *)o)->crnti);
|
||||
} else {
|
||||
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
|
||||
*crnti, ((HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT *)o)->crnti);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case unknown_cqi_NB_IoT:
|
||||
default:
|
||||
LOG_N(PHY,"[eNB][UCI] received unknown uci (RB %d)\n",N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_N(PHY,"[eNB][UCI] unknown RB %d\n",N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -164,6 +164,86 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uin
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
NB_IoT_eNB_NULSCH_t *new_eNB_ulsch_NB(uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
NB_IoT_eNB_NULSCH_t *ulsch;
|
||||
uint8_t exit_flag = 0,i,r;
|
||||
unsigned char bw_scaling =1;
|
||||
|
||||
// switch (N_RB_UL) {
|
||||
// case 6:
|
||||
// bw_scaling =16;
|
||||
// break;
|
||||
//
|
||||
// case 25:
|
||||
// bw_scaling =4;
|
||||
// break;
|
||||
//
|
||||
// case 50:
|
||||
// bw_scaling =2;
|
||||
// break;
|
||||
//
|
||||
// default:
|
||||
// bw_scaling =1;
|
||||
// break;
|
||||
// }
|
||||
|
||||
ulsch = (NB_IoT_eNB_NULSCH_t *)malloc16(sizeof(NB_IoT_eNB_NULSCH_t));
|
||||
|
||||
if (ulsch) {
|
||||
memset(ulsch,0,sizeof(LTE_eNB_ULSCH_t));
|
||||
//MP: add some parameters in npusch structure for convolutional coding to be set
|
||||
ulsch->Mlimit = 4;
|
||||
|
||||
|
||||
ulsch->harq_process = (LTE_UL_eNB_HARQ_t *)malloc16(sizeof(LTE_UL_eNB_HARQ_t));
|
||||
|
||||
if (ulsch->harq_process) {
|
||||
memset(ulsch->harq_process,0,sizeof(LTE_UL_eNB_HARQ_t));
|
||||
ulsch->harq_process->b = (uint8_t*)malloc16(MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
|
||||
|
||||
if (ulsch->harq_process->b)
|
||||
memset(ulsch->harq_process->b,0,MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
|
||||
else
|
||||
exit_flag=3;
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS/bw_scaling; r++) {
|
||||
ulsch->harq_process->c[r] = (uint8_t*)malloc16(((r==0)?8:0) + 3+768);
|
||||
if (ulsch->harq_process->c[r])
|
||||
memset(ulsch->harq_process->c[r],0,((r==0)?8:0) + 3+768);
|
||||
else
|
||||
exit_flag=2;
|
||||
|
||||
ulsch->harq_process->d[r] = (short*)malloc16(((3*8*6144)+12+96)*sizeof(short));
|
||||
|
||||
if (ulsch->harq_process->d[r])
|
||||
memset(ulsch->harq_process->d[r],0,((3*8*6144)+12+96)*sizeof(short));
|
||||
else
|
||||
exit_flag=2;
|
||||
}
|
||||
|
||||
ulsch->harq_process->subframe_scheduling_flag = 0;
|
||||
}
|
||||
} else {
|
||||
exit_flag=1;
|
||||
}
|
||||
|
||||
|
||||
if (exit_flag==0)
|
||||
return(ulsch);
|
||||
}
|
||||
|
||||
LOG_E(PHY,"new_ue_ulsch: exit_flag = %d\n",exit_flag);
|
||||
free_eNB_ulsch(ulsch);
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch)
|
||||
{
|
||||
|
||||
@@ -212,7 +292,7 @@ uint8_t extract_cqi_crc(uint8_t *cqi,uint8_t CQI_LENGTH)
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
int ulsch_decoding_data_2thread0(td_params* tdp) {
|
||||
|
||||
PHY_VARS_eNB *eNB = tdp->eNB;
|
||||
@@ -648,6 +728,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
|
||||
|
||||
return( (ret>proc->tdp.ret) ? ret : proc->tdp.ret );
|
||||
}
|
||||
*/
|
||||
|
||||
int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) {
|
||||
|
||||
@@ -657,7 +738,8 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
|
||||
int ret = 1;
|
||||
int16_t dummy_w[MAX_NUM_ULSCH_SEGMENTS][3*(6144+64)];
|
||||
LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id];
|
||||
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
|
||||
//int Q_m = get_Qm_ul(ulsch_harq->mcs);
|
||||
int G = ulsch_harq->G;
|
||||
unsigned int E;
|
||||
|
||||
2384
openair1/PHY/LTE_TRANSPORT/ulsch_decoding_NB_IoT.c
Normal file
2384
openair1/PHY/LTE_TRANSPORT/ulsch_decoding_NB_IoT.c
Normal file
File diff suppressed because it is too large
Load Diff
2020
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation_NB_IoT.c
Normal file
2020
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation_NB_IoT.c
Normal file
File diff suppressed because it is too large
Load Diff
37
openair1/PHY/LTE_TRANSPORT/vars_NB_IoT.h
Normal file
37
openair1/PHY/LTE_TRANSPORT/vars_NB_IoT.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
//#include "dlsch_tbs.h"
|
||||
//#include "dlsch_tbs_full.h"
|
||||
//#include "sss.h"
|
||||
#ifndef __PHY_LTE_TRANSPORT_VARS_NB_IOT__H__
|
||||
#define __PHY_LTE_TRANSPORT_VARS_NB_IOT__H__
|
||||
|
||||
unsigned char cs_ri_normal_NB_IoT[4] = {1,4,7,10};
|
||||
unsigned char cs_ri_extended_NB_IoT[4] = {0,3,5,8};
|
||||
unsigned char cs_ack_normal_NB_IoT[4] = {2,3,8,9};
|
||||
unsigned char cs_ack_extended_NB_IoT[4] = {1,2,6,7};
|
||||
|
||||
int G_tab[18] = {200,224,240,208,232,256,220,244,268,216,240,256,224,248,264,236,260,284};
|
||||
|
||||
int8_t wACK_RX_NB_IoT[5][4] = {{-1,-1,-1,-1},{-1,1,-1,1},{-1,-1,1,1},{-1,1,1,-1},{1,1,1,1}};
|
||||
|
||||
#endif
|
||||
117
openair1/PHY/TOOLS/time_meas_NB_IoT.c
Normal file
117
openair1/PHY/TOOLS/time_meas_NB_IoT.c
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "time_meas_NB_IoT.h"
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
|
||||
// global var for openair performance profiler
|
||||
int opp_enabled = 0;
|
||||
|
||||
|
||||
double get_cpu_freq_GHz(void) {
|
||||
|
||||
time_stats_t ts = {0};
|
||||
reset_meas(&ts);
|
||||
ts.trials++;
|
||||
ts.in = rdtsc_oai();
|
||||
sleep(1);
|
||||
ts.diff = (rdtsc_oai()-ts.in);
|
||||
cpu_freq_GHz = (double)ts.diff/1000000000;
|
||||
printf("CPU Freq is %f \n", cpu_freq_GHz);
|
||||
return cpu_freq_GHz;
|
||||
}
|
||||
|
||||
void print_meas_now(time_stats_t *ts, const char* name, FILE* file_name){
|
||||
|
||||
if (opp_enabled) {
|
||||
|
||||
//static double cpu_freq_GHz = 3.2;
|
||||
|
||||
//if (cpu_freq_GHz == 0.0)
|
||||
//cpu_freq_GHz = get_cpu_freq_GHz(); // super slow
|
||||
|
||||
if (ts->trials>0) {
|
||||
|
||||
//fprintf(file_name,"Name %25s: Processing %15.3f ms for SF %d, diff_now %15.3f \n", name,(ts->diff_now/(cpu_freq_GHz*1000000.0)),subframe,ts->diff_now);
|
||||
fprintf(file_name,"%15.3f ms, diff_now %15.3f \n",(ts->diff_now/(cpu_freq_GHz*1000000.0)),(double)ts->diff_now);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time)
|
||||
{
|
||||
|
||||
if (opp_enabled) {
|
||||
|
||||
static int first_time = 0;
|
||||
static double cpu_freq_GHz = 0.0;
|
||||
|
||||
if (cpu_freq_GHz == 0.0)
|
||||
cpu_freq_GHz = get_cpu_freq_GHz();
|
||||
|
||||
if (first_time == 0) {
|
||||
first_time=1;
|
||||
|
||||
if ((total_exec_time == NULL) || (sf_exec_time== NULL))
|
||||
fprintf(stderr, "%25s %25s %25s %25s %25s %6f\n","Name","Total","Per Trials", "Num Trials","CPU_F_GHz", cpu_freq_GHz);
|
||||
else
|
||||
fprintf(stderr, "%25s %25s %25s %20s %15s %6f\n","Name","Total","Average/Frame","Trials", "CPU_F_GHz", cpu_freq_GHz);
|
||||
}
|
||||
|
||||
if (ts->trials>0) {
|
||||
//printf("%20s: total: %10.3f ms, average: %10.3f us (%10d trials)\n", name, ts->diff/cpu_freq_GHz/1000000.0, ts->diff/ts->trials/cpu_freq_GHz/1000.0, ts->trials);
|
||||
|
||||
if ((total_exec_time == NULL) || (sf_exec_time== NULL)) {
|
||||
fprintf(stderr, "%25s: %15.3f ms ; %15.3f us; %15d;\n",
|
||||
name,
|
||||
(ts->diff/cpu_freq_GHz/1000000.0),
|
||||
(ts->diff/ts->trials/cpu_freq_GHz/1000.0),
|
||||
ts->trials);
|
||||
} else {
|
||||
fprintf(stderr, "%25s: %15.3f ms (%5.2f%%); %15.3f us (%5.2f%%); %15d;\n",
|
||||
name,
|
||||
(ts->diff/cpu_freq_GHz/1000000.0),
|
||||
((ts->diff/cpu_freq_GHz/1000000.0)/(total_exec_time->diff/cpu_freq_GHz/1000000.0))*100, // percentage
|
||||
(ts->diff/ts->trials/cpu_freq_GHz/1000.0),
|
||||
((ts->diff/ts->trials/cpu_freq_GHz/1000.0)/(sf_exec_time->diff/sf_exec_time->trials/cpu_freq_GHz/1000.0))*100, // percentage
|
||||
ts->trials);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
double get_time_meas_us(time_stats_t *ts)
|
||||
{
|
||||
|
||||
static double cpu_freq_GHz = 0.0;
|
||||
|
||||
if (cpu_freq_GHz == 0.0)
|
||||
cpu_freq_GHz = get_cpu_freq_GHz();
|
||||
|
||||
if (ts->trials>0)
|
||||
return (ts->diff/ts->trials/cpu_freq_GHz/1000.0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
158
openair1/PHY/TOOLS/time_meas_NB_IoT.h
Normal file
158
openair1/PHY/TOOLS/time_meas_NB_IoT.h
Normal file
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef __TIME_MEAS_DEFS_NB_IoT__H__
|
||||
#define __TIME_MEAS_DEFS_NB_IoT__H__
|
||||
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/types.h>
|
||||
// global var to enable openair performance profiler
|
||||
|
||||
extern int opp_enabled_NB_IoT;
|
||||
|
||||
double cpu_freq_GHz;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
|
||||
typedef struct {
|
||||
|
||||
long long in;
|
||||
long long diff;
|
||||
long long diff_now;
|
||||
long long p_time; /*!< \brief absolute process duration */
|
||||
long long diff_square; /*!< \brief process duration square */
|
||||
long long max;
|
||||
int trials;
|
||||
int meas_flag;
|
||||
} time_stats_t_NB_IoT;
|
||||
#elif defined(__arm__)
|
||||
typedef struct {
|
||||
uint32_t in;
|
||||
uint32_t diff_now;
|
||||
uint32_t diff;
|
||||
uint32_t p_time; /*!< \brief absolute process duration */
|
||||
uint32_t diff_square; /*!< \brief process duration square */
|
||||
uint32_t max;
|
||||
int trials;
|
||||
} time_stats_t_NB_IoT;
|
||||
|
||||
#endif
|
||||
static inline void start_meas_NB_IoT(time_stats_t_NB_IoT *ts) __attribute__((always_inline));
|
||||
static inline void stop_meas_NB_IoT(time_stats_t_NB_IoT *ts) __attribute__((always_inline));
|
||||
|
||||
/*
|
||||
void print_meas_now(time_stats_t *ts, const char* name, FILE* file_name);
|
||||
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time);
|
||||
double get_time_meas_us(time_stats_t *ts);
|
||||
double get_cpu_freq_GHz(void);
|
||||
*/
|
||||
#if defined(__i386__)
|
||||
static inline unsigned long long rdtsc_oai_NB_IoT(void) __attribute__((always_inline));
|
||||
static inline unsigned long long rdtsc_oai_NB_IoT(void)
|
||||
{
|
||||
unsigned long long int x;
|
||||
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
|
||||
return x;
|
||||
}
|
||||
#elif defined(__x86_64__)
|
||||
static inline unsigned long long rdtsc_oai_NB_IoT(void) __attribute__((always_inline));
|
||||
static inline unsigned long long rdtsc_oai_NB_IoT(void)
|
||||
{
|
||||
unsigned long long a, d;
|
||||
__asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
|
||||
return (d<<32) | a;
|
||||
}
|
||||
|
||||
#elif defined(__arm__)
|
||||
static inline uint32_t rdtsc_oai_NB_IoT(void) __attribute__((always_inline));
|
||||
static inline uint32_t rdtsc_oai_NB_IoT(void)
|
||||
{
|
||||
uint32_t r = 0;
|
||||
asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(r) );
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static inline void start_meas_NB_IoT(time_stats_t_NB_IoT *ts)
|
||||
{
|
||||
|
||||
if (opp_enabled_NB_IoT) {
|
||||
if (ts->meas_flag==0) {
|
||||
ts->trials++;
|
||||
ts->in = rdtsc_oai_NB_IoT();
|
||||
ts->meas_flag=1;
|
||||
}
|
||||
else {
|
||||
ts->in = rdtsc_oai_NB_IoT();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void stop_meas_NB_IoT(time_stats_t_NB_IoT *ts)
|
||||
{
|
||||
|
||||
if (opp_enabled_NB_IoT) {
|
||||
long long out = rdtsc_oai_NB_IoT();
|
||||
|
||||
ts->diff_now = (out-ts->in);
|
||||
|
||||
ts->diff_now = (out-ts->in);
|
||||
ts->diff += (out-ts->in);
|
||||
/// process duration is the difference between two clock points
|
||||
ts->p_time = (out-ts->in);
|
||||
ts->diff_square += (out-ts->in)*(out-ts->in);
|
||||
|
||||
if ((out-ts->in) > ts->max)
|
||||
ts->max = out-ts->in;
|
||||
|
||||
ts->meas_flag=0;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void reset_meas_NB_IoT(time_stats_t_NB_IoT *ts) {
|
||||
|
||||
ts->trials=0;
|
||||
ts->diff=0;
|
||||
ts->diff_now=0;
|
||||
ts->p_time=0;
|
||||
ts->diff_square=0;
|
||||
ts->max=0;
|
||||
ts->meas_flag=0;
|
||||
|
||||
}
|
||||
|
||||
static inline void copy_meas_NB_IoT(time_stats_t_NB_IoT *dst_ts,time_stats_t_NB_IoT *src_ts)
|
||||
{
|
||||
|
||||
if (opp_enabled_NB_IoT) {
|
||||
dst_ts->trials=src_ts->trials;
|
||||
dst_ts->diff=src_ts->diff;
|
||||
dst_ts->max=src_ts->max;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -120,6 +120,9 @@ static inline void* malloc16_clear( size_t size )
|
||||
#include "impl_defs_top.h"
|
||||
#include "impl_defs_lte.h"
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
|
||||
#include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h"
|
||||
|
||||
#include "PHY/TOOLS/time_meas.h"
|
||||
#include "PHY/CODING/defs.h"
|
||||
#include "PHY/TOOLS/defs.h"
|
||||
@@ -128,6 +131,7 @@ static inline void* malloc16_clear( size_t size )
|
||||
#ifdef OPENAIR_LTE
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/defs.h"
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include "targets/ARCH/COMMON/common_lib.h"
|
||||
@@ -138,6 +142,8 @@ static inline void* malloc16_clear( size_t size )
|
||||
|
||||
#define NB_BANDS_MAX 8
|
||||
|
||||
#include "defs_common.h"
|
||||
|
||||
#ifdef OCP_FRAMEWORK
|
||||
#include <enums.h>
|
||||
#else
|
||||
@@ -187,34 +193,7 @@ typedef struct {
|
||||
|
||||
} PHY_VARS_RN;
|
||||
|
||||
/// Context data structure for RX/TX portion of subframe processing
|
||||
typedef struct {
|
||||
/// Component Carrier index
|
||||
uint8_t CC_id;
|
||||
/// timestamp transmitted to HW
|
||||
openair0_timestamp timestamp_tx;
|
||||
/// subframe to act upon for transmission
|
||||
int subframe_tx;
|
||||
/// subframe to act upon for reception
|
||||
int subframe_rx;
|
||||
/// frame to act upon for transmission
|
||||
int frame_tx;
|
||||
/// frame to act upon for reception
|
||||
int frame_rx;
|
||||
/// \brief Instance count for RXn-TXnp4 processing thread.
|
||||
/// \internal This variable is protected by \ref mutex_rxtx.
|
||||
int instance_cnt_rxtx;
|
||||
/// pthread structure for RXn-TXnp4 processing thread
|
||||
pthread_t pthread_rxtx;
|
||||
/// pthread attributes for RXn-TXnp4 processing thread
|
||||
pthread_attr_t attr_rxtx;
|
||||
/// condition variable for tx processing thread
|
||||
pthread_cond_t cond_rxtx;
|
||||
/// mutex for RXn-TXnp4 processing thread
|
||||
pthread_mutex_t mutex_rxtx;
|
||||
/// scheduling parameters for RXn-TXnp4 thread
|
||||
struct sched_param sched_param_rxtx;
|
||||
} eNB_rxtx_proc_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
struct PHY_VARS_eNB_s *eNB;
|
||||
@@ -230,137 +209,7 @@ typedef struct {
|
||||
int G;
|
||||
} te_params;
|
||||
|
||||
/// Context data structure for eNB subframe processing
|
||||
typedef struct eNB_proc_t_s {
|
||||
/// Component Carrier index
|
||||
uint8_t CC_id;
|
||||
/// thread index
|
||||
int thread_index;
|
||||
/// timestamp received from HW
|
||||
openair0_timestamp timestamp_rx;
|
||||
/// timestamp to send to "slave rru"
|
||||
openair0_timestamp timestamp_tx;
|
||||
/// subframe to act upon for reception
|
||||
int subframe_rx;
|
||||
/// symbol mask for IF4p5 reception per subframe
|
||||
uint32_t symbol_mask[10];
|
||||
/// subframe to act upon for PRACH
|
||||
int subframe_prach;
|
||||
/// frame to act upon for reception
|
||||
int frame_rx;
|
||||
/// frame to act upon for transmission
|
||||
int frame_tx;
|
||||
/// frame offset for secondary eNBs (to correct for frame asynchronism at startup)
|
||||
int frame_offset;
|
||||
/// frame to act upon for PRACH
|
||||
int frame_prach;
|
||||
/// \internal This variable is protected by \ref mutex_fep.
|
||||
int instance_cnt_fep;
|
||||
/// \internal This variable is protected by \ref mutex_td.
|
||||
int instance_cnt_td;
|
||||
/// \internal This variable is protected by \ref mutex_te.
|
||||
int instance_cnt_te;
|
||||
/// \brief Instance count for FH processing thread.
|
||||
/// \internal This variable is protected by \ref mutex_FH.
|
||||
int instance_cnt_FH;
|
||||
/// \brief Instance count for rx processing thread.
|
||||
/// \internal This variable is protected by \ref mutex_prach.
|
||||
int instance_cnt_prach;
|
||||
// instance count for over-the-air eNB synchronization
|
||||
int instance_cnt_synch;
|
||||
/// \internal This variable is protected by \ref mutex_asynch_rxtx.
|
||||
int instance_cnt_asynch_rxtx;
|
||||
/// pthread structure for FH processing thread
|
||||
pthread_t pthread_FH;
|
||||
/// pthread structure for eNB single processing thread
|
||||
pthread_t pthread_single;
|
||||
/// pthread structure for asychronous RX/TX processing thread
|
||||
pthread_t pthread_asynch_rxtx;
|
||||
/// flag to indicate first RX acquisition
|
||||
int first_rx;
|
||||
/// flag to indicate first TX transmission
|
||||
int first_tx;
|
||||
/// pthread attributes for parallel fep thread
|
||||
pthread_attr_t attr_fep;
|
||||
/// pthread attributes for parallel turbo-decoder thread
|
||||
pthread_attr_t attr_td;
|
||||
/// pthread attributes for parallel turbo-encoder thread
|
||||
pthread_attr_t attr_te;
|
||||
/// pthread attributes for FH processing thread
|
||||
pthread_attr_t attr_FH;
|
||||
/// pthread attributes for single eNB processing thread
|
||||
pthread_attr_t attr_single;
|
||||
/// pthread attributes for prach processing thread
|
||||
pthread_attr_t attr_prach;
|
||||
/// pthread attributes for over-the-air synch thread
|
||||
pthread_attr_t attr_synch;
|
||||
/// pthread attributes for asynchronous RX thread
|
||||
pthread_attr_t attr_asynch_rxtx;
|
||||
/// scheduling parameters for parallel fep thread
|
||||
struct sched_param sched_param_fep;
|
||||
/// scheduling parameters for parallel turbo-decoder thread
|
||||
struct sched_param sched_param_td;
|
||||
/// scheduling parameters for parallel turbo-encoder thread
|
||||
struct sched_param sched_param_te;
|
||||
/// scheduling parameters for FH thread
|
||||
struct sched_param sched_param_FH;
|
||||
/// scheduling parameters for single eNB thread
|
||||
struct sched_param sched_param_single;
|
||||
/// scheduling parameters for prach thread
|
||||
struct sched_param sched_param_prach;
|
||||
/// scheduling parameters for over-the-air synchronization thread
|
||||
struct sched_param sched_param_synch;
|
||||
/// scheduling parameters for asynch_rxtx thread
|
||||
struct sched_param sched_param_asynch_rxtx;
|
||||
/// pthread structure for parallel fep thread
|
||||
pthread_t pthread_fep;
|
||||
/// pthread structure for parallel turbo-decoder thread
|
||||
pthread_t pthread_td;
|
||||
/// pthread structure for parallel turbo-encoder thread
|
||||
pthread_t pthread_te;
|
||||
/// pthread structure for PRACH thread
|
||||
pthread_t pthread_prach;
|
||||
/// pthread structure for eNB synch thread
|
||||
pthread_t pthread_synch;
|
||||
/// condition variable for parallel fep thread
|
||||
pthread_cond_t cond_fep;
|
||||
/// condition variable for parallel turbo-decoder thread
|
||||
pthread_cond_t cond_td;
|
||||
/// condition variable for parallel turbo-encoder thread
|
||||
pthread_cond_t cond_te;
|
||||
/// condition variable for FH thread
|
||||
pthread_cond_t cond_FH;
|
||||
/// condition variable for PRACH processing thread;
|
||||
pthread_cond_t cond_prach;
|
||||
// condition variable for over-the-air eNB synchronization
|
||||
pthread_cond_t cond_synch;
|
||||
/// condition variable for asynch RX/TX thread
|
||||
pthread_cond_t cond_asynch_rxtx;
|
||||
/// mutex for parallel fep thread
|
||||
pthread_mutex_t mutex_fep;
|
||||
/// mutex for parallel turbo-decoder thread
|
||||
pthread_mutex_t mutex_td;
|
||||
/// mutex for parallel turbo-encoder thread
|
||||
pthread_mutex_t mutex_te;
|
||||
/// mutex for FH
|
||||
pthread_mutex_t mutex_FH;
|
||||
/// mutex for PRACH thread
|
||||
pthread_mutex_t mutex_prach;
|
||||
// mutex for over-the-air eNB synchronization
|
||||
pthread_mutex_t mutex_synch;
|
||||
/// mutex for asynch RX/TX thread
|
||||
pthread_mutex_t mutex_asynch_rxtx;
|
||||
/// parameters for turbo-decoding worker thread
|
||||
td_params tdp;
|
||||
/// parameters for turbo-encoding worker thread
|
||||
te_params tep;
|
||||
/// set of scheduling variables RXn-TXnp4 threads
|
||||
eNB_rxtx_proc_t proc_rxtx[2];
|
||||
/// number of slave threads
|
||||
int num_slaves;
|
||||
/// array of pointers to slaves
|
||||
struct eNB_proc_t_s **slave_proc;
|
||||
} eNB_proc_t;
|
||||
|
||||
|
||||
|
||||
/// Context data structure for RX/TX portion of subframe processing
|
||||
@@ -426,6 +275,8 @@ typedef struct {
|
||||
UE_rxtx_proc_t proc_rxtx[2];
|
||||
} UE_proc_t;
|
||||
|
||||
|
||||
|
||||
/// Top-level PHY Data Structure for eNB
|
||||
typedef struct PHY_VARS_eNB_s {
|
||||
/// Module ID indicator for this instance
|
||||
@@ -449,7 +300,7 @@ typedef struct PHY_VARS_eNB_s {
|
||||
void (*fep)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc);
|
||||
int (*td)(struct PHY_VARS_eNB_s *eNB,int UE_id,int harq_pid,int llr8_flag);
|
||||
int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *);
|
||||
void (*proc_uespec_rx)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type);
|
||||
void (*proc_uespec_rx)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc);
|
||||
void (*proc_tx)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc,relaying_type_t r_type,PHY_VARS_RN *rn);
|
||||
void (*tx_fh)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc);
|
||||
void (*rx_fh)(struct PHY_VARS_eNB_s *eNB,int *frame, int *subframe);
|
||||
@@ -466,15 +317,20 @@ typedef struct PHY_VARS_eNB_s {
|
||||
LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX];
|
||||
LTE_eNB_PRACH prach_vars;
|
||||
LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_UE_MAX][2]; // Nusers times two spatial streams
|
||||
LTE_eNB_ULSCH_t *ulsch[NUMBER_OF_UE_MAX+1]; // Nusers + number of RA
|
||||
LTE_eNB_ULSCH_t *ulsch[NUMBER_OF_UE_MAX+1]; // Nusers + number of RA (the ulsch[0] contains RAR)
|
||||
LTE_eNB_DLSCH_t *dlsch_SI,*dlsch_ra;
|
||||
LTE_eNB_DLSCH_t *dlsch_MCH;
|
||||
LTE_eNB_UE_stats UE_stats[NUMBER_OF_UE_MAX];
|
||||
LTE_eNB_UE_stats *UE_stats_ptr[NUMBER_OF_UE_MAX];
|
||||
|
||||
|
||||
/// cell-specific reference symbols
|
||||
uint32_t lte_gold_table[20][2][14];
|
||||
|
||||
|
||||
/// cell-specific reference symbols
|
||||
uint32_t lte_gold_table_NB_IoT[20][2][14];
|
||||
|
||||
/// UE-specific reference symbols (p=5), TM 7
|
||||
uint32_t lte_gold_uespec_port5_table[NUMBER_OF_UE_MAX][20][38];
|
||||
|
||||
@@ -563,7 +419,6 @@ typedef struct PHY_VARS_eNB_s {
|
||||
// Pointers for active physicalConfigDedicated to be applied in current subframe
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX];
|
||||
|
||||
|
||||
uint32_t rb_mask_ul[4];
|
||||
|
||||
/// Information regarding TM5
|
||||
@@ -652,6 +507,35 @@ typedef struct PHY_VARS_eNB_s {
|
||||
/// Pointer for ifdevice buffer struct
|
||||
if_buffer_t ifbuffer;
|
||||
|
||||
/////////////// NB-IoT testing ////////////////////////////
|
||||
volatile uint16_t preamble_index_NB_IoT;
|
||||
NB_IoT_eNB_NPBCH_t npbch;
|
||||
NB_IoT_eNB_NDLSCH_t *ndlsch[NUMBER_OF_UE_MAX];
|
||||
NB_IoT_eNB_NULSCH_t *nulsch[NUMBER_OF_UE_MAX+1]; //nulsch[0] contains the RAR
|
||||
NB_IoT_eNB_NDLSCH_t *ndlsch_SIB1;
|
||||
NB_IoT_eNB_NDLSCH_t *ndlsch_SIB23;
|
||||
NB_IoT_eNB_NDLSCH_t *ndlsch_RAR;
|
||||
NB_IoT_eNB_NPDCCH_t *npdcch[NUMBER_OF_UE_MAX_NB_IoT];
|
||||
//NB_IoT_eNB_NDLSCH_t ndlsch_rar;
|
||||
NB_IoT_eNB_NPDCCH_t *npdcch_DCI;
|
||||
|
||||
NB_IoT_eNB_NULSCH_t *ulsch_NB_IoT[NUMBER_OF_UE_MAX+1];
|
||||
NB_IoT_eNB_NULSCH_t *ulsch_msg3_NB_IoT;
|
||||
|
||||
NPRACH_CONFIG_COMMON nprach_config_common;
|
||||
////////////// For IF Module /////////////////////////////
|
||||
|
||||
IF_Module_NB_IoT_t *if_inst; // should be replaced by if_inst_NB_IoT; to avoid conflict during the merge with develop branch
|
||||
UL_IND_NB_IoT_t UL_INFO; // should be replaced by UL_INFO_NB_IoT;
|
||||
pthread_mutex_t UL_INFO_mutex;
|
||||
/// NFAPI NPRACH information
|
||||
//nfapi_preamble_pdu_t preamble_list_NB_IoT[MAX_NUM_RX_PRACH_PREAMBLES]; // MAX_NUM_RX_PRACH_PREAMBLES in PHY/defs_eNB.h
|
||||
|
||||
//nfapi_preamble_pdu_t preamble_list_NB_IoT[4];
|
||||
|
||||
uint8_t msg3_pdu[6];
|
||||
DCI_PDU_NB_IoT *DCI_pdu;
|
||||
//////////////////// END /////////////////////////////////
|
||||
} PHY_VARS_eNB;
|
||||
|
||||
#define debug_msg if (((mac_xface->frame%100) == 0) || (mac_xface->frame < 50)) msg
|
||||
@@ -935,6 +819,7 @@ void exit_fun(const char* s);
|
||||
|
||||
static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) {
|
||||
|
||||
// lock the mutex, if lock successfully, it would return the 0, the other value means failed
|
||||
if (pthread_mutex_lock(mutex) != 0) {
|
||||
LOG_E( PHY, "[SCHED][eNB] error locking mutex for %s\n",name);
|
||||
exit_fun("nothing to add");
|
||||
|
||||
1115
openair1/PHY/defs_NB_IoT.h
Normal file
1115
openair1/PHY/defs_NB_IoT.h
Normal file
File diff suppressed because it is too large
Load Diff
261
openair1/PHY/defs_common.h
Normal file
261
openair1/PHY/defs_common.h
Normal file
@@ -0,0 +1,261 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/defs.h
|
||||
\brief Top-level defines and structure definitions
|
||||
\author R. Knopp, F. Kaltenberger
|
||||
\date 2011
|
||||
\version 0.1
|
||||
\company Eurecom
|
||||
\email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
|
||||
\note
|
||||
\warning
|
||||
*/
|
||||
#ifndef __PHY_DEFS_COMMON__H__
|
||||
#define __PHY_DEFS_COMMON__H__
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "common_lib.h"
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
/// Context data structure for RX/TX portion of subframe processing
|
||||
typedef struct {
|
||||
/// Component Carrier index
|
||||
uint8_t CC_id;
|
||||
/// timestamp transmitted to HW
|
||||
openair0_timestamp timestamp_tx;
|
||||
/// subframe to act upon for transmission
|
||||
int subframe_tx;
|
||||
/// subframe to act upon for reception
|
||||
int subframe_rx;
|
||||
/// frame to act upon for transmission
|
||||
int frame_tx;
|
||||
/// frame to act upon for reception
|
||||
int frame_rx;
|
||||
|
||||
uint16_t HFN;
|
||||
/// \brief Instance count for RXn-TXnp4 processing thread.
|
||||
/// \internal This variable is protected by \ref mutex_rxtx.
|
||||
int instance_cnt_rxtx;
|
||||
/// pthread structure for RXn-TXnp4 processing thread
|
||||
pthread_t pthread_rxtx;
|
||||
/// pthread attributes for RXn-TXnp4 processing thread
|
||||
pthread_attr_t attr_rxtx;
|
||||
/// condition variable for tx processing thread
|
||||
pthread_cond_t cond_rxtx;
|
||||
/// mutex for RXn-TXnp4 processing thread
|
||||
pthread_mutex_t mutex_rxtx;
|
||||
/// scheduling parameters for RXn-TXnp4 thread
|
||||
struct sched_param sched_param_rxtx;
|
||||
|
||||
uint32_t ra_rnti_computed;
|
||||
|
||||
uint8_t dci_to_transmit;
|
||||
|
||||
uint32_t frame_dscr_msg3;
|
||||
uint32_t subframe_dscr_msg3;
|
||||
|
||||
uint32_t frame_msg5;
|
||||
uint32_t subframe_msg5;
|
||||
|
||||
uint8_t rar_to_transmit;
|
||||
uint8_t subframe_SP;
|
||||
uint8_t subframe_SP2;
|
||||
int next_frame_tx;
|
||||
int next_subframe_tx;
|
||||
uint8_t SP;
|
||||
uint8_t SP2;
|
||||
uint8_t there_is_sib23;
|
||||
int next_frame_tx_DCI;
|
||||
int next_subframe_tx_DCI;
|
||||
int subframe_delay;
|
||||
int subframe_real;
|
||||
uint32_t sheduling_info_rar;
|
||||
uint8_t flag_scrambling;
|
||||
|
||||
uint8_t flag_msg3;
|
||||
uint8_t counter_msg3;
|
||||
uint32_t frame_msg3;
|
||||
|
||||
uint8_t flag_DCI_msg4;
|
||||
uint8_t flag_msg4;
|
||||
uint8_t counter_DCI_msg4;
|
||||
uint8_t counter_msg4;
|
||||
uint32_t frame_DCI_msg4;
|
||||
uint32_t frame_msg4;
|
||||
uint32_t subframe_DCI_msg4;
|
||||
uint32_t subframe_msg4;
|
||||
|
||||
uint8_t guard;
|
||||
uint8_t counter_msg5;
|
||||
uint8_t remaining_dci;
|
||||
|
||||
uint8_t remaining_rar;
|
||||
|
||||
uint8_t flag_msg5;
|
||||
|
||||
uint32_t frame_dscr_msg5;
|
||||
uint32_t subframe_dscr_msg5;
|
||||
|
||||
} eNB_rxtx_proc_t;
|
||||
|
||||
/// Context data structure for eNB subframe processing
|
||||
typedef struct eNB_proc_t_s {
|
||||
/// Component Carrier index
|
||||
uint8_t CC_id;
|
||||
/// thread index
|
||||
int thread_index;
|
||||
/// timestamp received from HW
|
||||
openair0_timestamp timestamp_rx;
|
||||
/// timestamp to send to "slave rru"
|
||||
openair0_timestamp timestamp_tx;
|
||||
/// subframe to act upon for reception
|
||||
int subframe_rx;
|
||||
/// symbol mask for IF4p5 reception per subframe
|
||||
uint32_t symbol_mask[10];
|
||||
/// subframe to act upon for PRACH
|
||||
int subframe_prach;
|
||||
/// frame to act upon for reception
|
||||
int frame_rx;
|
||||
/// frame to act upon for transmission
|
||||
int frame_tx;
|
||||
/// frame offset for secondary eNBs (to correct for frame asynchronism at startup)
|
||||
int frame_offset;
|
||||
/// frame to act upon for PRACH
|
||||
int frame_prach;
|
||||
/// \internal This variable is protected by \ref mutex_fep.
|
||||
int instance_cnt_fep;
|
||||
/// \internal This variable is protected by \ref mutex_td.
|
||||
int instance_cnt_td;
|
||||
/// \internal This variable is protected by \ref mutex_te.
|
||||
int instance_cnt_te;
|
||||
/// \brief Instance count for FH processing thread.
|
||||
/// \internal This variable is protected by \ref mutex_FH.
|
||||
int instance_cnt_FH;
|
||||
/// \brief Instance count for rx processing thread.
|
||||
/// \internal This variable is protected by \ref mutex_prach.
|
||||
int instance_cnt_prach;
|
||||
// instance count for over-the-air eNB synchronization
|
||||
int instance_cnt_synch;
|
||||
/// \internal This variable is protected by \ref mutex_asynch_rxtx.
|
||||
int instance_cnt_asynch_rxtx;
|
||||
/// pthread structure for FH processing thread
|
||||
pthread_t pthread_FH;
|
||||
/// pthread structure for eNB single processing thread
|
||||
pthread_t pthread_single;
|
||||
/// pthread structure for asychronous RX/TX processing thread
|
||||
pthread_t pthread_asynch_rxtx;
|
||||
/// flag to indicate first RX acquisition
|
||||
int first_rx;
|
||||
/// flag to indicate first TX transmission
|
||||
int first_tx;
|
||||
/// pthread attributes for parallel fep thread
|
||||
pthread_attr_t attr_fep;
|
||||
/// pthread attributes for parallel turbo-decoder thread
|
||||
pthread_attr_t attr_td;
|
||||
/// pthread attributes for parallel turbo-encoder thread
|
||||
pthread_attr_t attr_te;
|
||||
/// pthread attributes for FH processing thread
|
||||
pthread_attr_t attr_FH;
|
||||
/// pthread attributes for single eNB processing thread
|
||||
pthread_attr_t attr_single;
|
||||
/// pthread attributes for prach processing thread
|
||||
pthread_attr_t attr_prach;
|
||||
/// pthread attributes for over-the-air synch thread
|
||||
pthread_attr_t attr_synch;
|
||||
/// pthread attributes for asynchronous RX thread
|
||||
pthread_attr_t attr_asynch_rxtx;
|
||||
/// scheduling parameters for parallel fep thread
|
||||
struct sched_param sched_param_fep;
|
||||
/// scheduling parameters for parallel turbo-decoder thread
|
||||
struct sched_param sched_param_td;
|
||||
/// scheduling parameters for parallel turbo-encoder thread
|
||||
struct sched_param sched_param_te;
|
||||
/// scheduling parameters for FH thread
|
||||
struct sched_param sched_param_FH;
|
||||
/// scheduling parameters for single eNB thread
|
||||
struct sched_param sched_param_single;
|
||||
/// scheduling parameters for prach thread
|
||||
struct sched_param sched_param_prach;
|
||||
/// scheduling parameters for over-the-air synchronization thread
|
||||
struct sched_param sched_param_synch;
|
||||
/// scheduling parameters for asynch_rxtx thread
|
||||
struct sched_param sched_param_asynch_rxtx;
|
||||
/// pthread structure for parallel fep thread
|
||||
pthread_t pthread_fep;
|
||||
/// pthread structure for parallel turbo-decoder thread
|
||||
pthread_t pthread_td;
|
||||
/// pthread structure for parallel turbo-encoder thread
|
||||
pthread_t pthread_te;
|
||||
/// pthread structure for PRACH thread
|
||||
pthread_t pthread_prach;
|
||||
/// pthread structure for eNB synch thread
|
||||
pthread_t pthread_synch;
|
||||
/// condition variable for parallel fep thread
|
||||
pthread_cond_t cond_fep;
|
||||
/// condition variable for parallel turbo-decoder thread
|
||||
pthread_cond_t cond_td;
|
||||
/// condition variable for parallel turbo-encoder thread
|
||||
pthread_cond_t cond_te;
|
||||
/// condition variable for FH thread
|
||||
pthread_cond_t cond_FH;
|
||||
/// condition variable for PRACH processing thread;
|
||||
pthread_cond_t cond_prach;
|
||||
// condition variable for over-the-air eNB synchronization
|
||||
pthread_cond_t cond_synch;
|
||||
/// condition variable for asynch RX/TX thread
|
||||
pthread_cond_t cond_asynch_rxtx;
|
||||
/// mutex for parallel fep thread
|
||||
pthread_mutex_t mutex_fep;
|
||||
/// mutex for parallel turbo-decoder thread
|
||||
pthread_mutex_t mutex_td;
|
||||
/// mutex for parallel turbo-encoder thread
|
||||
pthread_mutex_t mutex_te;
|
||||
/// mutex for FH
|
||||
pthread_mutex_t mutex_FH;
|
||||
/// mutex for PRACH thread
|
||||
pthread_mutex_t mutex_prach;
|
||||
// mutex for over-the-air eNB synchronization
|
||||
pthread_mutex_t mutex_synch;
|
||||
/// mutex for asynch RX/TX thread
|
||||
pthread_mutex_t mutex_asynch_rxtx;
|
||||
/// parameters for turbo-decoding worker thread
|
||||
// td_params tdp;
|
||||
/// parameters for turbo-encoding worker thread
|
||||
// te_params tep;
|
||||
/// set of scheduling variables RXn-TXnp4 threads
|
||||
eNB_rxtx_proc_t proc_rxtx[2];
|
||||
/// number of slave threads
|
||||
int num_slaves;
|
||||
/// array of pointers to slaves
|
||||
struct eNB_proc_t_s **slave_proc;
|
||||
} eNB_proc_t;
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
139
openair1/PHY/extern_NB_IoT.h
Normal file
139
openair1/PHY/extern_NB_IoT.h
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef __PHY_EXTERN_NB_IOT_H__
|
||||
#define __PHY_EXTERN_NB_IOT_H__
|
||||
|
||||
//#include "PHY/defs.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "openair2/PHY_INTERFACE/defs_NB_IoT.h"
|
||||
//#include "PHY_INTERFACE/IF_Module_NB_IoT.h"
|
||||
/*
|
||||
extern char* namepointer_chMag ;
|
||||
extern char* namepointer_log2;
|
||||
extern char fmageren_name2[512];
|
||||
|
||||
extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX];
|
||||
extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
|
||||
*/
|
||||
#include "PHY/LTE_TRANSPORT/extern_NB_IoT.h"
|
||||
//#include "SIMULATION/ETH_TRANSPORT/extern.h"
|
||||
|
||||
extern unsigned int DAQ_MBOX_NB_IoT;
|
||||
extern int number_of_cards_NB_IoT;
|
||||
|
||||
//extern PHY_CONFIG *PHY_config;
|
||||
//extern PHY_VARS *PHY_vars;
|
||||
#ifndef OCP_FRAMEWORK
|
||||
extern PHY_VARS_UE_NB_IoT ***PHY_vars_UE_NB_IoT_g;
|
||||
extern PHY_VARS_eNB_NB_IoT ***PHY_vars_eNB_NB_IoT_g;
|
||||
extern PHY_VARS_RN_NB_IoT **PHY_vars_RN_NB_IoT_g;
|
||||
extern NB_IoT_DL_FRAME_PARMS *nb_iot_frame_parms_g;
|
||||
#else
|
||||
#define MAX_UE 10
|
||||
#define MAX_eNB_NB_IoT 20
|
||||
extern PHY_VARS_UE_NB_IoT *PHY_vars_UE_NB_IoT_g[MAX_UE][MAX_NUM_CCs];
|
||||
extern PHY_VARS_eNB_NB_IoT *PHY_vars_eNB_NB_IoT_g[MAX_eNB_NB_IoT][MAX_NUM_CCs];
|
||||
#endif
|
||||
|
||||
|
||||
//extern MAC_xface_NB_IoT *mac_xface_NB_IoT;
|
||||
|
||||
|
||||
extern short primary_synch_NB_IoT[264];
|
||||
/*
|
||||
extern short primary_synch1[144];
|
||||
extern short primary_synch2[144];
|
||||
extern unsigned char primary_synch0_tab[72];
|
||||
extern unsigned char primary_synch1_tab[72];
|
||||
extern unsigned char primary_synch2_tab[72]; */
|
||||
extern int16_t *primary_synch0_time_NB_IoT; //!< index: [0..ofdm_symbol_size*2[
|
||||
// extern int16_t *primary_synch1_time; //!< index: [0..ofdm_symbol_size*2[
|
||||
// extern int16_t *primary_synch2_time; //!< index: [0..ofdm_symbol_size*2[
|
||||
extern int *sync_corr_ue0_NB_IoT; //!< index [0..10*samples_per_tti[
|
||||
/*
|
||||
extern int *sync_corr_ue1; //!< index [0..10*samples_per_tti[
|
||||
extern int *sync_corr_ue2; //!< index [0..10*samples_per_tti[
|
||||
|
||||
extern int flagMag;
|
||||
//extern short **txdataF_rep_tmp;
|
||||
|
||||
extern char mode_string[4][20];
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
#ifndef OPENAIR2
|
||||
extern unsigned char NB_eNB_INST;
|
||||
extern unsigned char NB_UE_INST;
|
||||
extern unsigned char NB_RN_INST;
|
||||
#endif
|
||||
|
||||
extern unsigned int ULSCH_max_consecutive_errors;
|
||||
extern int flag_LA;
|
||||
extern double sinr_bler_map[MCS_COUNT][2][MCS_TABLE_LENGTH_MAX];
|
||||
extern double sinr_bler_map_up[MCS_COUNT][2][16];
|
||||
extern int table_length[MCS_COUNT];
|
||||
extern double sinr_to_cqi[4][16];
|
||||
extern int cqi_to_mcs[16];
|
||||
|
||||
//for MU-MIMO abstraction using MIESM
|
||||
//this 2D arrarays contains SINR, MI and RBIR in rows 1, 2, and 3 respectively
|
||||
extern double MI_map_4qam[3][162];
|
||||
extern double MI_map_16qam[3][197];
|
||||
extern double MI_map_64qam[3][227];
|
||||
|
||||
extern double beta1_dlsch_MI[6][MCS_COUNT];
|
||||
extern double beta2_dlsch_MI[6][MCS_COUNT];
|
||||
|
||||
extern double q_qpsk[8];
|
||||
extern double q_qam16[8];
|
||||
extern double q_qam64[8];
|
||||
|
||||
extern double p_qpsk[8];
|
||||
extern double p_qam16[8];
|
||||
extern double p_qam64[8];
|
||||
|
||||
extern double beta1_dlsch[6][MCS_COUNT];
|
||||
extern double beta2_dlsch[6][MCS_COUNT];
|
||||
|
||||
extern char eNB_functions[6][20];
|
||||
extern char eNB_timing[2][20];
|
||||
|
||||
*/
|
||||
extern int16_t unscrambling_lut_NB_IoT[65536*16];
|
||||
/*
|
||||
extern uint8_t scrambling_lut[65536*16];
|
||||
|
||||
extern unsigned short msrsb_6_40[8][4];
|
||||
extern unsigned short msrsb_41_60[8][4];
|
||||
extern unsigned short msrsb_61_80[8][4];
|
||||
extern unsigned short msrsb_81_110[8][4];
|
||||
extern unsigned short Nb_6_40[8][4];
|
||||
extern unsigned short Nb_41_60[8][4];
|
||||
extern unsigned short Nb_61_80[8][4];
|
||||
extern unsigned short Nb_81_110[8][4];
|
||||
|
||||
extern uint16_t hundred_times_log10_NPRB[100];
|
||||
extern uint8_t alpha_lut[8];
|
||||
*/
|
||||
#endif /*__PHY_EXTERN_H__ */
|
||||
|
||||
@@ -35,6 +35,11 @@
|
||||
|
||||
|
||||
#include "types.h"
|
||||
|
||||
////////////////// NB-IoT testing //////////////////
|
||||
//#include "impl_defs_lte_NB_IoT.h"
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
//#include "defs.h"
|
||||
|
||||
#define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME 10
|
||||
@@ -63,6 +68,53 @@ typedef enum {EXTENDED=1,NORMAL=0} lte_prefix_type_t;
|
||||
|
||||
typedef enum {LOCALIZED=0,DISTRIBUTED=1} vrb_t;
|
||||
|
||||
////////////////////////////////////////// NB-IoT testing ///////////////////////////////////////////////////////////////
|
||||
typedef struct{
|
||||
/// The base sequence of DMRS sequence in a cell for 3 tones transmission; see TS 36.211 [21, 10.1.4.1.2]. If absent, it is given by NB-IoT CellID mod 12. Value 12 is not used.
|
||||
uint16_t threeTone_BaseSequence;
|
||||
/// Define 3 cyclic shifts for the 3-tone case, see TS 36.211 [21, 10.1.4.1.2].
|
||||
uint16_t threeTone_CyclicShift;
|
||||
/// The base sequence of DMRS sequence in a cell for 6 tones transmission; see TS 36.211 [21, 10.1.4.1.2]. If absent, it is given by NB-IoT CellID mod 14. Value 14 is not used.
|
||||
uint16_t sixTone_BaseSequence;
|
||||
/// Define 4 cyclic shifts for the 6-tone case, see TS 36.211 [21, 10.1.4.1.2].
|
||||
uint16_t sixTone_CyclicShift;
|
||||
/// The base sequence of DMRS sequence in a cell for 12 tones transmission; see TS 36.211 [21, 10.1.4.1.2]. If absent, it is given by NB-IoT CellID mod 30. Value 30 is not used.
|
||||
uint16_t twelveTone_BaseSequence;
|
||||
|
||||
}DMRS_CONFIGx_t;
|
||||
|
||||
/// UL-ReferenceSignalsNPUSCH from 36.331 RRC spec
|
||||
typedef struct {
|
||||
/// Parameter: Group-hopping-enabled, see TS 36.211 (5.5.1.3). \vr{[0..1]}
|
||||
uint8_t groupHoppingEnabled;
|
||||
/// , see TS 36.211 (5.5.1.3). \vr{[0..29]}
|
||||
uint8_t groupAssignmentNPUSCH;
|
||||
/// Parameter: cyclicShift, see TS 36.211 (Table 5.5.2.1.1-2). \vr{[0..7]}
|
||||
uint8_t cyclicShift;
|
||||
/// nPRS for cyclic shift of DRS \note not part of offical UL-ReferenceSignalsPUSCH ASN1 specification.
|
||||
uint8_t nPRS[20];
|
||||
/// group hopping sequence for DMRS, 36.211, Section 10.1.4.1.3. Second index corresponds to the four possible subcarrier configurations
|
||||
uint8_t grouphop[20][4];
|
||||
/// sequence hopping sequence for DRS \note not part of offical UL-ReferenceSignalsPUSCH ASN1 specification.
|
||||
uint8_t seqhop[20];
|
||||
} UL_REFERENCE_SIGNALS_NPUSCHx_t;
|
||||
|
||||
|
||||
/// PUSCH-ConfigCommon from 36.331 RRC spec.
|
||||
typedef struct {
|
||||
/// Number of repetitions for ACK/NACK HARQ response to NPDSCH containing Msg4 per NPRACH resource, see TS 36.213 [23, 16.4.2].
|
||||
uint8_t ack_NACK_NumRepetitions_Msg4[3];
|
||||
/// SRS SubframeConfiguration. See TS 36.211 [21, table 5.5.3.3-1]. Value sc0 corresponds to value 0, sc1 to value 1 and so on.
|
||||
uint8_t srs_SubframeConfig;
|
||||
/// Parameter: \f$N^{HO}_{RB}\f$, see TS 36.211 (5.3.4). \vr{[0..98]}
|
||||
DMRS_CONFIGx_t dmrs_Config;
|
||||
/// Ref signals configuration
|
||||
UL_REFERENCE_SIGNALS_NPUSCHx_t ul_ReferenceSignalsNPUSCH;
|
||||
|
||||
} NPUSCH_CONFIG_COMMONx;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// Enumeration for parameter PHICH-Duration \ref PHICH_CONFIG_COMMON::phich_duration.
|
||||
typedef enum {
|
||||
normal=0,
|
||||
@@ -587,6 +639,20 @@ typedef struct {
|
||||
|
||||
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[MAX_MBSFN_AREA];
|
||||
|
||||
////////////////////////// NB-IoT testing //////////////////////////////
|
||||
uint8_t subcarrier_spacing;
|
||||
|
||||
uint16_t control_region_size;
|
||||
|
||||
uint8_t nb_antennas_tx_NB_IoT; // to replace with NB_IoT_frame_params
|
||||
|
||||
NPUSCH_CONFIG_COMMONx npusch_config_common;
|
||||
|
||||
uint8_t RB_ID_NB_IoT; // to be used
|
||||
|
||||
uint8_t flag_free_sf; // flag to indicate for NPDSCH and NPDCCH process if the current SF already used
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
} LTE_DL_FRAME_PARMS;
|
||||
|
||||
typedef enum {
|
||||
|
||||
832
openair1/PHY/impl_defs_lte_NB_IoT.h
Normal file
832
openair1/PHY/impl_defs_lte_NB_IoT.h
Normal file
@@ -0,0 +1,832 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/impl_defs_lte.h
|
||||
* \brief LTE Physical channel configuration and variable structure definitions
|
||||
* \author R. Knopp, F. Kaltenberger
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __PHY_IMPL_DEFS_NB_IOT__H__
|
||||
#define __PHY_IMPL_DEFS_NB_IOT__H__
|
||||
|
||||
#include "types_NB_IoT.h"
|
||||
//#include "defs.h"
|
||||
|
||||
typedef enum {TDD_NB_IoT=1,FDD_NB_IoT=0} NB_IoT_frame_type_t;
|
||||
typedef enum {EXTENDED_NB_IoT=1,NORMAL_NB_IoT=0} NB_IoT_prefix_type_t;
|
||||
typedef enum {SF_DL_NB_IoT, SF_UL_NB_IoT, SF_S_NB_IoT} NB_IoT_subframe_t;
|
||||
|
||||
#define A_SEQUENCE_OF(type) A_SET_OF(type)
|
||||
|
||||
#define A_SET_OF(type) \
|
||||
struct { \
|
||||
type **array; \
|
||||
int count; /* Meaningful size */ \
|
||||
int size; /* Allocated size */ \
|
||||
void (*free)(type *); \
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////
|
||||
/// Union for \ref TPC_PDCCH_CONFIG::tpc_Index.
|
||||
typedef union {
|
||||
/// Index of N when DCI format 3 is used. See TS 36.212 (5.3.3.1.6). \vr{[1..15]}
|
||||
uint8_t indexOfFormat3;
|
||||
/// Index of M when DCI format 3A is used. See TS 36.212 (5.3.3.1.7). \vr{[1..31]}
|
||||
uint8_t indexOfFormat3A;
|
||||
} TPC_INDEX_NB_IoT_t;
|
||||
|
||||
/// TPC-PDCCH-Config Information Element from 36.331 RRC spec
|
||||
typedef struct {
|
||||
/// RNTI for power control using DCI format 3/3A, see TS 36.212. \vr{[0..65535]}
|
||||
uint16_t rnti;
|
||||
/// Index of N or M, see TS 36.212 (5.3.3.1.6 and 5.3.3.1.7), where N or M is dependent on the used DCI format (i.e. format 3 or 3a).
|
||||
TPC_INDEX_NB_IoT_t tpc_Index;
|
||||
} TPC_PDCCH_CONFIG_NB_IoT;
|
||||
/// Enumeration for parameter \f$N_\text{ANRep}\f$ \ref PUCCH_CONFIG_DEDICATED::repetitionFactor.
|
||||
typedef enum {
|
||||
//n2=0,
|
||||
n4_n,
|
||||
n6_n
|
||||
} ACKNAKREP_NB_IoT_t;
|
||||
|
||||
/// Enumeration for \ref PUCCH_CONFIG_DEDICATED::tdd_AckNackFeedbackMode.
|
||||
typedef enum {
|
||||
bundling_N=0,
|
||||
multiplexing_N
|
||||
} ANFBmode_NB_IoT_t;
|
||||
|
||||
/// PUCCH-ConfigDedicated from 36.331 RRC spec
|
||||
typedef struct {
|
||||
/// Flag to indicate ACK NAK repetition activation, see TS 36.213 (10.1). \vr{[0..1]}
|
||||
uint8_t ackNackRepetition;
|
||||
/// Parameter: \f$N_\text{ANRep}\f$, see TS 36.213 (10.1).
|
||||
ACKNAKREP_NB_IoT_t repetitionFactor;
|
||||
/// Parameter: \f$n^{(1)}_\text{PUCCH,ANRep}\f$, see TS 36.213 (10.1). \vr{[0..2047]}
|
||||
uint16_t n1PUCCH_AN_Rep;
|
||||
/// Feedback mode, see TS 36.213 (7.3). \details Applied to both PUCCH and PUSCH feedback. For TDD, should always be set to bundling.
|
||||
ANFBmode_NB_IoT_t tdd_AckNackFeedbackMode;
|
||||
} PUCCH_CONFIG_DEDICATED_NB_IoT;
|
||||
// UE specific PUSCH configuration.
|
||||
typedef struct {
|
||||
/// Parameter: \f$I^\text{HARQ-ACK}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-1). \vr{[0..15]}
|
||||
uint16_t betaOffset_ACK_Index;
|
||||
/// Parameter: \f$I^{RI}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-2). \vr{[0..15]}
|
||||
uint16_t betaOffset_RI_Index;
|
||||
/// Parameter: \f$I^{CQI}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-3). \vr{[0..15]}
|
||||
uint16_t betaOffset_CQI_Index;
|
||||
} PUSCH_CONFIG_DEDICATED_NB_IoT;
|
||||
/// Enumeration for Parameter \f$P_A\f$ \ref PDSCH_CONFIG_DEDICATED::p_a.
|
||||
typedef enum {
|
||||
//dBm6=0, ///< (dB-6) corresponds to -6 dB
|
||||
// dBm477, ///< (dB-4dot77) corresponds to -4.77 dB
|
||||
// dBm3, ///< (dB-3) corresponds to -3 dB
|
||||
//dBm177, ///< (dB-1dot77) corresponds to -1.77 dB
|
||||
//dB0, ///< corresponds to 0 dB
|
||||
// dB1, ///< corresponds to 1 dB
|
||||
dB2_NB, ///< corresponds to 2 dB
|
||||
dB3_NB ///< corresponds to 3 dB
|
||||
} PA_NB_IoT_t;
|
||||
|
||||
/// PDSCH-ConfigDedicated from 36.331 RRC spec
|
||||
typedef struct {
|
||||
/// Parameter: \f$P_A\f$, see TS 36.213 (5.2).
|
||||
PA_NB_IoT_t p_a;
|
||||
} PDSCH_CONFIG_DEDICATED_NB_IoT;
|
||||
|
||||
/// UplinkPowerControlDedicated Information Element from 36.331 RRC spec
|
||||
typedef struct {
|
||||
/// Parameter: \f$P_\text{0\_UE\_PUSCH}(1)\f$, see TS 36.213 (5.1.1.1), unit dB. \vr{[-8..7]}\n This field is applicable for non-persistent scheduling, only.
|
||||
int8_t p0_UE_PUSCH;
|
||||
/// Parameter: Ks, see TS 36.213 (5.1.1.1). \vr{[0..1]}\n en0 corresponds to value 0 corresponding to state “disabled”. en1 corresponds to value 1.25 corresponding to “enabled”. \note the specification sais it is an enumerated value. \warning the enumeration values do not correspond to the given values in the specification (en1 should be 1.25).
|
||||
uint8_t deltaMCS_Enabled;
|
||||
/// Parameter: Accumulation-enabled, see TS 36.213 (5.1.1.1). \vr{[0..1]} 1 corresponds to "enabled" whereas 0 corresponds to "disabled".
|
||||
uint8_t accumulationEnabled;
|
||||
/// Parameter: \f$P_\text{0\_UE\_PUCCH}(1)\f$, see TS 36.213 (5.1.2.1), unit dB. \vr{[-8..7]}
|
||||
int8_t p0_UE_PUCCH;
|
||||
/// Parameter: \f$P_\text{SRS\_OFFSET}\f$, see TS 36.213 (5.1.3.1). \vr{[0..15]}\n For Ks=1.25 (\ref deltaMCS_Enabled), the actual parameter value is pSRS_Offset value - 3. For Ks=0, the actual parameter value is -10.5 + 1.5*pSRS_Offset value.
|
||||
int8_t pSRS_Offset;
|
||||
/// Specifies the filtering coefficient for RSRP measurements used to calculate path loss, as specified in TS 36.213 (5.1.1.1).\details The same filtering mechanism applies as for quantityConfig described in 5.5.3.2. \note the specification sais it is an enumerated value.
|
||||
uint8_t filterCoefficient;
|
||||
} UL_POWER_CONTROL_DEDICATED_NB_IoT;
|
||||
|
||||
/// Union for \ref TPC_PDCCH_CONFIG::tpc_Index.
|
||||
//typedef union {
|
||||
/// Index of N when DCI format 3 is used. See TS 36.212 (5.3.3.1.6). \vr{[1..15]}
|
||||
// uint8_t indexOfFormat3;
|
||||
/// Index of M when DCI format 3A is used. See TS 36.212 (5.3.3.1.7). \vr{[1..31]}
|
||||
// uint8_t indexOfFormat3A;
|
||||
//} TPC_INDEX_NB_IoT_t;
|
||||
|
||||
/// CQI-ReportPeriodic
|
||||
typedef struct {
|
||||
/// Parameter: \f$n^{(2)}_\text{PUCCH}\f$, see TS 36.213 (7.2). \vr{[0..1185]}, -1 indicates inactivity
|
||||
int16_t cqi_PUCCH_ResourceIndex;
|
||||
/// Parameter: CQI/PMI Periodicity and Offset Configuration Index \f$I_\text{CQI/PMI}\f$, see TS 36.213 (tables 7.2.2-1A and 7.2.2-1C). \vr{[0..1023]}
|
||||
int16_t cqi_PMI_ConfigIndex;
|
||||
/// Parameter: K, see 36.213 (4.2.2). \vr{[1..4]}
|
||||
uint8_t K;
|
||||
/// Parameter: RI Config Index \f$I_\text{RI}\f$, see TS 36.213 (7.2.2-1B). \vr{[0..1023]}, -1 indicates inactivity
|
||||
int16_t ri_ConfigIndex;
|
||||
/// Parameter: Simultaneous-AN-and-CQI, see TS 36.213 (10.1). \vr{[0..1]} 1 indicates that simultaneous transmission of ACK/NACK and CQI is allowed.
|
||||
uint8_t simultaneousAckNackAndCQI;
|
||||
/// parameter computed from Tables 7.2.2-1A and 7.2.2-1C
|
||||
uint16_t Npd;
|
||||
/// parameter computed from Tables 7.2.2-1A and 7.2.2-1C
|
||||
uint16_t N_OFFSET_CQI;
|
||||
} CQI_REPORTPERIODIC_NB_IoT;
|
||||
|
||||
/// Enumeration for parameter reporting mode \ref CQI_REPORT_CONFIG::cqi_ReportModeAperiodic.
|
||||
typedef enum {
|
||||
//rm12=0,
|
||||
//rm20=1,
|
||||
//rm22=2,
|
||||
rm30_N=3,
|
||||
rm31_N=4
|
||||
} CQI_REPORTMODEAPERIODIC_NB_IoT;
|
||||
|
||||
/// CQI-ReportConfig Information Element from 36.331 RRC spec
|
||||
typedef struct {
|
||||
/// Parameter: reporting mode. Value rm12 corresponds to Mode 1-2, rm20 corresponds to Mode 2-0, rm22 corresponds to Mode 2-2 etc. PUSCH reporting modes are described in TS 36.213 [23, 7.2.1].
|
||||
CQI_REPORTMODEAPERIODIC_NB_IoT cqi_ReportModeAperiodic;
|
||||
/// Parameter: \f$\Delta_\text{offset}\f$, see TS 36.213 (7.2.3). \vr{[-1..6]}\n Actual value = IE value * 2 [dB].
|
||||
int8_t nomPDSCH_RS_EPRE_Offset;
|
||||
CQI_REPORTPERIODIC_NB_IoT CQI_ReportPeriodic;
|
||||
} CQI_REPORT_CONFIG_NB_IoT;
|
||||
|
||||
/// SoundingRS-UL-ConfigDedicated Information Element from 36.331 RRC spec
|
||||
typedef struct {
|
||||
/// Parameter: \f$B_\text{SRS}\f$, see TS 36.211 (table 5.5.3.2-1, 5.5.3.2-2, 5.5.3.2-3 and 5.5.3.2-4). \vr{[0..3]} \note the specification sais it is an enumerated value.
|
||||
uint8_t srs_Bandwidth;
|
||||
/// Parameter: SRS hopping bandwidth \f$b_\text{hop}\in\{0,1,2,3\}\f$, see TS 36.211 (5.5.3.2) \vr{[0..3]} \note the specification sais it is an enumerated value.
|
||||
uint8_t srs_HoppingBandwidth;
|
||||
/// Parameter: \f$n_\text{RRC}\f$, see TS 36.211 (5.5.3.2). \vr{[0..23]}
|
||||
uint8_t freqDomainPosition;
|
||||
/// Parameter: Duration, see TS 36.213 (8.2). \vr{[0..1]} 0 corresponds to "single" and 1 to "indefinite".
|
||||
uint8_t duration;
|
||||
/// Parameter: \f$k_\text{TC}\in\{0,1\}\f$, see TS 36.211 (5.5.3.2). \vr{[0..1]}
|
||||
uint8_t transmissionComb;
|
||||
/// Parameter: \f$I_\text{SRS}\f$, see TS 36.213 (table 8.2-1). \vr{[0..1023]}
|
||||
uint16_t srs_ConfigIndex;
|
||||
/// Parameter: \f$n^\text{CS}_\text{SRS}\f$. See TS 36.211 (5.5.3.1). \vr{[0..7]} \note the specification sais it is an enumerated value.
|
||||
uint8_t cyclicShift;
|
||||
// Parameter: internal implementation: UE SRS configured
|
||||
uint8_t srsConfigDedicatedSetup;
|
||||
// Parameter: cell srs subframe for internal implementation
|
||||
uint8_t srsCellSubframe;
|
||||
// Parameter: ue srs subframe for internal implementation
|
||||
uint8_t srsUeSubframe;
|
||||
} SOUNDINGRS_UL_CONFIG_DEDICATED_NB_IoT;
|
||||
|
||||
|
||||
/// Enumeration for parameter SR transmission \ref SCHEDULING_REQUEST_CONFIG::dsr_TransMax.
|
||||
typedef enum {
|
||||
//sr_n4=0,
|
||||
// sr_n8=1,
|
||||
// sr_n16=2,
|
||||
sr_n32_N=3,
|
||||
sr_n64_N=4
|
||||
} DSR_TRANSMAX_NB_IoT_t;
|
||||
|
||||
/// SchedulingRequestConfig Information Element from 36.331 RRC spec
|
||||
typedef struct {
|
||||
/// Parameter: \f$n^{(1)}_\text{PUCCH,SRI}\f$, see TS 36.213 (10.1). \vr{[0..2047]}
|
||||
uint16_t sr_PUCCH_ResourceIndex;
|
||||
/// Parameter: \f$I_\text{SR}\f$, see TS 36.213 (10.1). \vr{[0..155]}
|
||||
uint8_t sr_ConfigIndex;
|
||||
/// Parameter for SR transmission in TS 36.321 (5.4.4). \details The value n4 corresponds to 4 transmissions, n8 corresponds to 8 transmissions and so on.
|
||||
DSR_TRANSMAX_NB_IoT_t dsr_TransMax;
|
||||
} SCHEDULING_REQUEST_CONFIG_NB_IoT;
|
||||
|
||||
typedef struct {
|
||||
/// Downlink Power offset field
|
||||
uint8_t dl_pow_off;
|
||||
///Subband resource allocation field
|
||||
uint8_t rballoc_sub[50];
|
||||
///Total number of PRBs indicator
|
||||
uint8_t pre_nb_available_rbs;
|
||||
} MU_MIMO_mode_NB_IoT;
|
||||
////////////////////////
|
||||
|
||||
typedef struct {
|
||||
|
||||
/// \brief Holds the received data in the frequency domain.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: symbol [0..28*ofdm_symbol_size[
|
||||
int32_t **rxdataF;
|
||||
|
||||
/// \brief Hold the channel estimates in frequency domain.
|
||||
/// - first index: eNB id [0..6] (hard coded)
|
||||
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - third index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
||||
int32_t **dl_ch_estimates[7];
|
||||
|
||||
/// \brief Hold the channel estimates in time domain (used for tracking).
|
||||
/// - first index: eNB id [0..6] (hard coded)
|
||||
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - third index: samples? [0..2*ofdm_symbol_size[
|
||||
int32_t **dl_ch_estimates_time[7];
|
||||
}NB_IoT_UE_COMMON_PER_THREAD;
|
||||
|
||||
typedef struct {
|
||||
/// \brief Holds the transmit data in time domain.
|
||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->tx_vars[a].TX_DMA_BUFFER.
|
||||
/// - first index: tx antenna [0..nb_antennas_tx[
|
||||
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES[
|
||||
int32_t **txdata;
|
||||
/// \brief Holds the transmit data in the frequency domain.
|
||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
|
||||
/// - first index: tx antenna [0..nb_antennas_tx[
|
||||
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX[
|
||||
int32_t **txdataF;
|
||||
|
||||
/// \brief Holds the received data in time domain.
|
||||
/// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES+2048[
|
||||
int32_t **rxdata;
|
||||
|
||||
NB_IoT_UE_COMMON_PER_THREAD common_vars_rx_data_per_thread[2];
|
||||
|
||||
/// holds output of the sync correlator
|
||||
int32_t *sync_corr;
|
||||
/// estimated frequency offset (in radians) for all subcarriers
|
||||
int32_t freq_offset;
|
||||
/// eNb_id user is synched to
|
||||
int32_t eNb_id;
|
||||
} NB_IoT_UE_COMMON;
|
||||
|
||||
typedef struct {
|
||||
/// \brief Received frequency-domain signal after extraction.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **rxdataF_ext;
|
||||
/// \brief Received frequency-domain ue specific pilots.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..12*N_RB_DL[
|
||||
int32_t **rxdataF_uespec_pilots;
|
||||
/// \brief Received frequency-domain signal after extraction and channel compensation.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **rxdataF_comp0;
|
||||
/// \brief Received frequency-domain signal after extraction and channel compensation for the second stream. For the SIC receiver we need to store the history of this for each harq process and round
|
||||
/// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
|
||||
/// - second index: ? [0..7] (hard coded) accessed via \c round
|
||||
/// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - fourth index: ? [0..168*N_RB_DL[
|
||||
int32_t **rxdataF_comp1[8][8];
|
||||
/// \brief Downlink channel estimates extracted in PRBS.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_estimates_ext;
|
||||
/// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. For the SIC receiver we need to store the history of this for each harq process and round
|
||||
/// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
|
||||
/// - second index: ? [0..7] (hard coded) accessed via \c round
|
||||
/// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - fourth index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_rho_ext[8][8];
|
||||
/// \brief Downlink beamforming channel estimates in frequency domain.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
||||
int32_t **dl_bf_ch_estimates;
|
||||
/// \brief Downlink beamforming channel estimates.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_bf_ch_estimates_ext;
|
||||
/// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_rho2_ext;
|
||||
/// \brief Downlink PMIs extracted in PRBS and grouped in subbands.
|
||||
/// - first index: ressource block [0..N_RB_DL[
|
||||
uint8_t *pmi_ext;
|
||||
/// \brief Magnitude of Downlink Channel first layer (16QAM level/First 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_mag0;
|
||||
/// \brief Magnitude of Downlink Channel second layer (16QAM level/First 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_mag1[8][8];
|
||||
/// \brief Magnitude of Downlink Channel, first layer (2nd 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_magb0;
|
||||
/// \brief Magnitude of Downlink Channel second layer (2nd 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_magb1[8][8];
|
||||
/// \brief Cross-correlation of two eNB signals.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: symbol [0..]
|
||||
int32_t **rho;
|
||||
/// never used... always send dl_ch_rho_ext instead...
|
||||
int32_t **rho_i;
|
||||
/// \brief Pointers to llr vectors (2 TBs).
|
||||
/// - first index: ? [0..1] (hard coded)
|
||||
/// - second index: ? [0..1179743] (hard coded)
|
||||
int16_t *llr[2];
|
||||
/// \f$\log_2(\max|H_i|^2)\f$
|
||||
int16_t log2_maxh;
|
||||
/// \f$\log_2(\max|H_i|^2)\f$ //this is for TM3-4 layer1 channel compensation
|
||||
int16_t log2_maxh0;
|
||||
/// \f$\log_2(\max|H_i|^2)\f$ //this is for TM3-4 layer2 channel commpensation
|
||||
int16_t log2_maxh1;
|
||||
/// \brief LLR shifts for subband scaling.
|
||||
/// - first index: ? [0..168*N_RB_DL[
|
||||
uint8_t *llr_shifts;
|
||||
/// \brief Pointer to LLR shifts.
|
||||
/// - first index: ? [0..168*N_RB_DL[
|
||||
uint8_t *llr_shifts_p;
|
||||
/// \brief Pointers to llr vectors (128-bit alignment).
|
||||
/// - first index: ? [0..0] (hard coded)
|
||||
/// - second index: ? [0..]
|
||||
int16_t **llr128;
|
||||
/// \brief Pointers to llr vectors (128-bit alignment).
|
||||
/// - first index: ? [0..0] (hard coded)
|
||||
/// - second index: ? [0..]
|
||||
int16_t **llr128_2ndstream;
|
||||
//uint32_t *rb_alloc;
|
||||
//uint8_t Qm[2];
|
||||
//MIMO_mode_t mimo_mode;
|
||||
} NB_IoT_UE_PDSCH;
|
||||
|
||||
/// NPRACH-ParametersList-NB-r13 from 36.331 RRC spec
|
||||
typedef struct NPRACH_Parameters_NB_IoT{
|
||||
/// the period time for nprach
|
||||
uint16_t nprach_Periodicity;
|
||||
/// for the start time for the NPRACH resource from 40ms-2560ms
|
||||
uint16_t nprach_StartTime;
|
||||
/// for the subcarrier of set to the NPRACH preamble from n0 - n34
|
||||
uint16_t nprach_SubcarrierOffset;
|
||||
///number of subcarriers in a NPRACH resource allowed values (n12,n24,n36,n48)
|
||||
uint16_t nprach_NumSubcarriers;
|
||||
/// where is the region that in NPRACH resource to indicate if this UE support MSG3 for multi-tone or not. from 0 - 1
|
||||
uint16_t nprach_SubcarrierMSG3_RangeStart;
|
||||
/// The max preamble transmission attempt for the CE level from 1 - 128
|
||||
uint16_t maxNumPreambleAttemptCE;
|
||||
/// Number of NPRACH repetitions per attempt for each NPRACH resource
|
||||
uint16_t numRepetitionsPerPreambleAttempt;
|
||||
/// The number of the repetition for DCI use in RAR/MSG3/MSG4 from 1 - 2048 (Rmax)
|
||||
uint16_t npdcch_NumRepetitions_RA;
|
||||
/// Starting subframe for NPDCCH Common searching space for (RAR/MSG3/MSG4)
|
||||
uint16_t npdcch_StartSF_CSS_RA;
|
||||
/// Fractional period offset of starting subframe for NPDCCH common search space
|
||||
uint16_t npdcch_Offset_RA;
|
||||
} nprach_parameters_NB_IoT_t;
|
||||
|
||||
typedef struct{
|
||||
nprach_parameters_NB_IoT_t list[3];
|
||||
}NPRACH_List_NB_IoT_t;
|
||||
|
||||
typedef long RSRP_Range_t;
|
||||
|
||||
typedef struct {
|
||||
A_SEQUENCE_OF(RSRP_Range_t) list;
|
||||
}rsrp_ThresholdsNPrachInfoList;
|
||||
|
||||
|
||||
/// NPRACH_ConfigSIB-NB from 36.331 RRC spec
|
||||
typedef struct {
|
||||
/// nprach_CP_Length_r13, for the CP length(unit us) only 66.7 and 266.7 is implemented
|
||||
uint16_t nprach_CP_Length;
|
||||
/// The criterion for UEs to select a NPRACH resource. Up to 2 RSRP threshold values can be signalled. \vr{[1..2]}
|
||||
struct rsrp_ThresholdsNPrachInfoList *rsrp_ThresholdsPrachInfoList;
|
||||
/// NPRACH Parameters List
|
||||
NPRACH_List_NB_IoT_t nprach_ParametersList;
|
||||
|
||||
} NPRACH_CONFIG_COMMON;
|
||||
|
||||
/// NPDSCH-ConfigCommon from 36.331 RRC spec
|
||||
typedef struct {
|
||||
///see TS 36.213 (16.2). \vr{[-60..50]}\n Provides the downlink reference-signal EPRE. The actual value in dBm.
|
||||
uint16_t nrs_Power;
|
||||
} NPDSCH_CONFIG_COMMON;
|
||||
|
||||
typedef struct{
|
||||
/// The base sequence of DMRS sequence in a cell for 3 tones transmission; see TS 36.211 [21, 10.1.4.1.2]. If absent, it is given by NB-IoT CellID mod 12. Value 12 is not used.
|
||||
uint16_t threeTone_BaseSequence;
|
||||
/// Define 3 cyclic shifts for the 3-tone case, see TS 36.211 [21, 10.1.4.1.2].
|
||||
uint16_t threeTone_CyclicShift;
|
||||
/// The base sequence of DMRS sequence in a cell for 6 tones transmission; see TS 36.211 [21, 10.1.4.1.2]. If absent, it is given by NB-IoT CellID mod 14. Value 14 is not used.
|
||||
uint16_t sixTone_BaseSequence;
|
||||
/// Define 4 cyclic shifts for the 6-tone case, see TS 36.211 [21, 10.1.4.1.2].
|
||||
uint16_t sixTone_CyclicShift;
|
||||
/// The base sequence of DMRS sequence in a cell for 12 tones transmission; see TS 36.211 [21, 10.1.4.1.2]. If absent, it is given by NB-IoT CellID mod 30. Value 30 is not used.
|
||||
uint16_t twelveTone_BaseSequence;
|
||||
|
||||
}DMRS_CONFIG_t;
|
||||
|
||||
/// UL-ReferenceSignalsNPUSCH from 36.331 RRC spec
|
||||
typedef struct {
|
||||
/// Parameter: Group-hopping-enabled, see TS 36.211 (5.5.1.3). \vr{[0..1]}
|
||||
uint8_t groupHoppingEnabled;
|
||||
/// , see TS 36.211 (5.5.1.3). \vr{[0..29]}
|
||||
uint8_t groupAssignmentNPUSCH;
|
||||
/// Parameter: cyclicShift, see TS 36.211 (Table 5.5.2.1.1-2). \vr{[0..7]}
|
||||
uint8_t cyclicShift;
|
||||
/// nPRS for cyclic shift of DRS \note not part of offical UL-ReferenceSignalsPUSCH ASN1 specification.
|
||||
uint8_t nPRS[20];
|
||||
/// group hopping sequence for DMRS, 36.211, Section 10.1.4.1.3. Second index corresponds to the four possible subcarrier configurations
|
||||
uint8_t grouphop[20][4];
|
||||
/// sequence hopping sequence for DRS \note not part of offical UL-ReferenceSignalsPUSCH ASN1 specification.
|
||||
uint8_t seqhop[20];
|
||||
} UL_REFERENCE_SIGNALS_NPUSCH_t;
|
||||
|
||||
|
||||
/// PUSCH-ConfigCommon from 36.331 RRC spec.
|
||||
typedef struct {
|
||||
/// Number of repetitions for ACK/NACK HARQ response to NPDSCH containing Msg4 per NPRACH resource, see TS 36.213 [23, 16.4.2].
|
||||
uint8_t ack_NACK_NumRepetitions_Msg4[3];
|
||||
/// SRS SubframeConfiguration. See TS 36.211 [21, table 5.5.3.3-1]. Value sc0 corresponds to value 0, sc1 to value 1 and so on.
|
||||
uint8_t srs_SubframeConfig;
|
||||
/// Parameter: \f$N^{HO}_{RB}\f$, see TS 36.211 (5.3.4). \vr{[0..98]}
|
||||
DMRS_CONFIG_t dmrs_Config;
|
||||
/// Ref signals configuration
|
||||
UL_REFERENCE_SIGNALS_NPUSCH_t ul_ReferenceSignalsNPUSCH;
|
||||
|
||||
} NPUSCH_CONFIG_COMMON;
|
||||
|
||||
|
||||
typedef struct{
|
||||
/// See TS 36.213 [23, 16.2.1.1], unit dBm.
|
||||
uint8_t p0_NominalNPUSCH;
|
||||
/// See TS 36.213 [23, 16.2.1.1] where al0 corresponds to 0, al04 corresponds to value 0.4, al05 to 0.5, al06 to 0.6, al07 to 0.7, al08 to 0.8, al09 to 0.9 and al1 corresponds to 1.
|
||||
uint8_t alpha;
|
||||
/// See TS 36.213 [23, 16.2.1.1]. Actual value = IE value * 2 [dB].
|
||||
uint8_t deltaPreambleMsg3;
|
||||
}UplinkPowerControlCommon_NB_IoT;
|
||||
|
||||
|
||||
/* DL-GapConfig-NB-r13 */
|
||||
typedef struct {
|
||||
uint16_t dl_GapThreshold;
|
||||
uint16_t dl_GapPeriodicity;
|
||||
uint16_t dl_GapDurationCoeff;
|
||||
} DL_GapConfig_NB_IoT;
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
||||
/// Frame type (0 FDD, 1 TDD)
|
||||
NB_IoT_frame_type_t frame_type;
|
||||
/// Number of resource blocks (RB) in DL of the LTE (for knowing the bandwidth)
|
||||
uint8_t N_RB_DL;
|
||||
/// Number of resource blocks (RB) in UL of the LTE ((for knowing the bandwidth)
|
||||
uint8_t N_RB_UL;
|
||||
/// TDD subframe assignment (0-7) (default = 3) (254=RX only, 255=TX only)
|
||||
uint8_t tdd_config;
|
||||
/// Cell ID
|
||||
uint16_t Nid_cell;
|
||||
/// Cyclic Prefix for DL (0=Normal CP, 1=Extended CP)
|
||||
NB_IoT_prefix_type_t Ncp;
|
||||
/// Cyclic Prefix for UL (0=Normal CP, 1=Extended CP)
|
||||
NB_IoT_prefix_type_t Ncp_UL;
|
||||
/// shift of pilot position in one RB
|
||||
uint8_t nushift;
|
||||
/// indicates if node is a UE (NODE=2) or eNB (PRIMARY_CH=0).
|
||||
uint8_t node_id;
|
||||
/// Frequency index of CBMIMO1 card
|
||||
uint8_t freq_idx;
|
||||
/// RX Frequency for ExpressMIMO/LIME
|
||||
uint32_t carrier_freq[4];
|
||||
/// TX Frequency for ExpressMIMO/LIME
|
||||
uint32_t carrier_freqtx[4];
|
||||
/// RX gain for ExpressMIMO/LIME
|
||||
uint32_t rxgain[4];
|
||||
/// TX gain for ExpressMIMO/LIME
|
||||
uint32_t txgain[4];
|
||||
/// RF mode for ExpressMIMO/LIME
|
||||
uint32_t rfmode[4];
|
||||
/// RF RX DC Calibration for ExpressMIMO/LIME
|
||||
uint32_t rxdc[4];
|
||||
/// RF TX DC Calibration for ExpressMIMO/LIME
|
||||
uint32_t rflocal[4];
|
||||
/// RF VCO calibration for ExpressMIMO/LIME
|
||||
uint32_t rfvcolocal[4];
|
||||
/// Turns on second TX of CBMIMO1 card
|
||||
uint8_t dual_tx;
|
||||
/// flag to indicate SISO transmission
|
||||
uint8_t mode1_flag;
|
||||
/// Indicator that 20 MHz channel uses 3/4 sampling frequency
|
||||
uint8_t threequarter_fs;
|
||||
/// Size of FFT
|
||||
uint16_t ofdm_symbol_size;
|
||||
/// Number of prefix samples in all but first symbol of slot
|
||||
uint16_t nb_prefix_samples;
|
||||
/// Number of prefix samples in first symbol of slot
|
||||
uint16_t nb_prefix_samples0;
|
||||
/// Carrier offset in FFT buffer for first RE in PRB0
|
||||
uint16_t first_carrier_offset;
|
||||
/// Number of samples in a subframe
|
||||
uint32_t samples_per_tti;
|
||||
/// Number of OFDM/SC-FDMA symbols in one subframe (to be modified to account for potential different in UL/DL)
|
||||
uint16_t symbols_per_tti;
|
||||
/// Number of Physical transmit antennas in node
|
||||
uint8_t nb_antennas_tx;
|
||||
/// Number of Receive antennas in node
|
||||
uint8_t nb_antennas_rx;
|
||||
/// Number of common transmit antenna ports in eNodeB (1 or 2)
|
||||
uint8_t nb_antenna_ports_eNB;
|
||||
/// Number of common receiving antenna ports in eNodeB (1 or 2)
|
||||
uint8_t nb_antenna_ports_rx_eNB;
|
||||
/// NPRACH Config Common (from 36-331 RRC spec)
|
||||
NPRACH_CONFIG_COMMON nprach_config_common;
|
||||
/// NPDSCH Config Common (from 36-331 RRC spec)
|
||||
NPDSCH_CONFIG_COMMON npdsch_config_common;
|
||||
/// PUSCH Config Common (from 36-331 RRC spec)
|
||||
NPUSCH_CONFIG_COMMON npusch_config_common;
|
||||
/// UL Power Control (from 36-331 RRC spec)
|
||||
UplinkPowerControlCommon_NB_IoT ul_power_control_config_common;
|
||||
/// DL Gap
|
||||
DL_GapConfig_NB_IoT DL_gap_config;
|
||||
/// Size of SI windows used for repetition of one SI message (in frames)
|
||||
uint8_t SIwindowsize;
|
||||
/// Period of SI windows used for repetition of one SI message (in frames)
|
||||
uint16_t SIPeriod;
|
||||
int eutra_band;
|
||||
uint32_t dl_CarrierFreq;
|
||||
uint32_t ul_CarrierFreq;
|
||||
// CE level to determine the NPRACH Configuration (one CE for each NPRACH config.)
|
||||
uint8_t CE;
|
||||
|
||||
/*
|
||||
* index of the PRB assigned to NB-IoT carrier in in-band/guard-band operating mode
|
||||
*/
|
||||
unsigned short NB_IoT_RB_ID;
|
||||
|
||||
|
||||
/*Following FAPI approach:
|
||||
* 0 = in-band with same PCI
|
||||
* 1 = in-band with diff PCI
|
||||
* 2 = guard band
|
||||
* 3 =stand alone
|
||||
*/
|
||||
uint16_t operating_mode;
|
||||
|
||||
/*
|
||||
* Only for In-band operating mode with same PCI
|
||||
* its measured in number of OFDM symbols
|
||||
* allowed values:
|
||||
* 1, 2, 3, 4(this value is written in FAPI specs but not exist in TS 36.331 v14.2.1 pag 587)
|
||||
* -1 (we put this value when is not defined - other operating mode)
|
||||
*/
|
||||
uint16_t control_region_size;
|
||||
|
||||
/*Number of EUTRA CRS antenna ports (AP)
|
||||
* valid only for in-band different PCI mode
|
||||
* value 0 = indicates the same number of AP as NRS APs
|
||||
* value 1 = four CRS APs
|
||||
*/
|
||||
uint16_t eutra_NumCRS_ports;
|
||||
|
||||
/* Subcarrier bandwidth
|
||||
0 -> 3.75 kHz
|
||||
1 -> 15 kHz
|
||||
*/
|
||||
uint8_t subcarrier_spacing;
|
||||
|
||||
} NB_IoT_DL_FRAME_PARMS;
|
||||
|
||||
typedef struct {
|
||||
/// \brief Holds the transmit data in time domain.
|
||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: tx antenna [0..nb_antennas_tx[
|
||||
/// - third index:
|
||||
int32_t **txdata[3];
|
||||
/// \brief holds the transmit data in the frequency domain.
|
||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. //?
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: tx antenna [0..14[ where 14 is the total supported antenna ports.
|
||||
/// - third index: sample [0..]
|
||||
int32_t **txdataF[3];
|
||||
/// \brief holds the transmit data after beamforming in the frequency domain.
|
||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. //?
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: tx antenna [0..nb_antennas_tx[
|
||||
/// - third index: sample [0..]
|
||||
int32_t **txdataF_BF[3];
|
||||
/// \brief Holds the received data in time domain.
|
||||
/// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna [0..nb_antennas_rx[
|
||||
/// - third index: sample [0..]
|
||||
int32_t **rxdata[3];
|
||||
/// \brief Holds the last subframe of received data in time domain after removal of 7.5kHz frequency offset.
|
||||
/// - first index: secotr id [0..2] (hard coded)
|
||||
/// - second index: rx antenna [0..nb_antennas_rx[
|
||||
/// - third index: sample [0..samples_per_tti[
|
||||
int32_t **rxdata_7_5kHz[3];
|
||||
/// \brief Holds the received data in the frequency domain.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..2*ofdm_symbol_size*frame_parms->symbols_per_tti[
|
||||
int32_t **rxdataF[3];
|
||||
/// \brief Holds output of the sync correlator.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: sample [0..samples_per_tti*10[
|
||||
uint32_t *sync_corr[3];
|
||||
/// \brief Holds the beamforming weights
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: eNB antenna port index (hard coded)
|
||||
/// - third index: tx antenna [0..nb_antennas_tx[
|
||||
/// - fourth index: sample [0..]
|
||||
int32_t **beam_weights[3][15];
|
||||
/// \brief Holds the tdd reciprocity calibration coefficients
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: tx antenna [0..nb_antennas_tx[
|
||||
/// - third index: frequency [0..]
|
||||
int32_t **tdd_calib_coeffs[3];
|
||||
} NB_IoT_eNB_COMMON;
|
||||
|
||||
typedef struct {
|
||||
/// \brief Hold the channel estimates in frequency domain based on SRS.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..ofdm_symbol_size[
|
||||
int32_t **srs_ch_estimates[3];
|
||||
/// \brief Hold the channel estimates in time domain based on SRS.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..2*ofdm_symbol_size[
|
||||
int32_t **srs_ch_estimates_time[3];
|
||||
/// \brief Holds the SRS for channel estimation at the RX.
|
||||
/// - first index: ? [0..ofdm_symbol_size[
|
||||
int32_t *srs;
|
||||
} NB_IoT_eNB_SRS;
|
||||
|
||||
typedef struct {
|
||||
/// \brief Holds the received data in the frequency domain for the allocated RBs in repeated format.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..2*ofdm_symbol_size[
|
||||
/// - third index (definition from phy_init_lte_eNB()): ? [0..24*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
/// \warning inconsistent third index definition
|
||||
int32_t **rxdataF_ext[3];
|
||||
/// \brief Holds the received data in the frequency domain for the allocated RBs in normal format.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index (definition from phy_init_lte_eNB()): ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **rxdataF_ext2[3];
|
||||
/// \brief Hold the channel estimates in time domain based on DRS.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..4*ofdm_symbol_size[
|
||||
int32_t **drs_ch_estimates_time[3];
|
||||
/// \brief Hold the channel estimates in frequency domain based on DRS.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **drs_ch_estimates[3];
|
||||
/// \brief Hold the channel estimates for UE0 in case of Distributed Alamouti Scheme.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **drs_ch_estimates_0[3];
|
||||
/// \brief Hold the channel estimates for UE1 in case of Distributed Almouti Scheme.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **drs_ch_estimates_1[3];
|
||||
/// \brief Holds the compensated signal.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **rxdataF_comp[3];
|
||||
/// \brief Hold the compensated data (y)*(h0*) in case of Distributed Alamouti Scheme.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **rxdataF_comp_0[3];
|
||||
/// \brief Hold the compensated data (y*)*(h1) in case of Distributed Alamouti Scheme.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **rxdataF_comp_1[3];
|
||||
/// \brief ?.
|
||||
/// - first index: sector id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **ul_ch_mag[3];
|
||||
/// \brief ?.
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **ul_ch_magb[3];
|
||||
/// \brief Hold the channel mag for UE0 in case of Distributed Alamouti Scheme.
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **ul_ch_mag_0[3];
|
||||
/// \brief Hold the channel magb for UE0 in case of Distributed Alamouti Scheme.
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **ul_ch_magb_0[3];
|
||||
/// \brief Hold the channel mag for UE1 in case of Distributed Alamouti Scheme.
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **ul_ch_mag_1[3];
|
||||
/// \brief Hold the channel magb for UE1 in case of Distributed Alamouti Scheme.
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
int32_t **ul_ch_magb_1[3];
|
||||
/// measured RX power based on DRS
|
||||
int ulsch_power[2];
|
||||
/// measured RX power based on DRS for UE0 in case of Distributed Alamouti Scheme
|
||||
int ulsch_power_0[2];
|
||||
/// measured RX power based on DRS for UE0 in case of Distributed Alamouti Scheme
|
||||
int ulsch_power_1[2];
|
||||
/// \brief llr values.
|
||||
/// - first index: ? [0..1179743] (hard coded)
|
||||
int16_t *llr;
|
||||
#ifdef LOCALIZATION
|
||||
/// number of active subcarrier for a specific UE
|
||||
int32_t active_subcarrier;
|
||||
/// subcarrier power in dBm
|
||||
int32_t *subcarrier_power;
|
||||
#endif
|
||||
} NB_IoT_eNB_PUSCH;
|
||||
|
||||
#define PBCH_A_NB_IoT 24
|
||||
typedef struct {
|
||||
uint8_t pbch_d[96+(3*(16+PBCH_A_NB_IoT))];
|
||||
uint8_t pbch_w[3*3*(16+PBCH_A_NB_IoT)];
|
||||
uint8_t pbch_e[1920];
|
||||
} NB_IoT_eNB_PBCH;
|
||||
|
||||
|
||||
typedef enum {
|
||||
/// TM1
|
||||
SISO_NB_IoT=0,
|
||||
/// TM2
|
||||
ALAMOUTI_NB_IoT=1,
|
||||
/// TM3
|
||||
LARGE_CDD_NB_IoT=2,
|
||||
/// the next 6 entries are for TM5
|
||||
UNIFORM_PRECODING11_NB_IoT=3,
|
||||
UNIFORM_PRECODING1m1_NB_IoT=4,
|
||||
UNIFORM_PRECODING1j_NB_IoT=5,
|
||||
UNIFORM_PRECODING1mj_NB_IoT=6,
|
||||
PUSCH_PRECODING0_NB_IoT=7,
|
||||
PUSCH_PRECODING1_NB_IoT=8,
|
||||
/// the next 3 entries are for TM4
|
||||
DUALSTREAM_UNIFORM_PRECODING1_NB_IoT=9,
|
||||
DUALSTREAM_UNIFORM_PRECODINGj_NB_IoT=10,
|
||||
DUALSTREAM_PUSCH_PRECODING_NB_IoT=11,
|
||||
TM7_NB_IoT=12,
|
||||
TM8_NB_IoT=13,
|
||||
TM9_10_NB_IoT=14
|
||||
} MIMO_mode_NB_IoT_t;
|
||||
|
||||
typedef struct {
|
||||
/// \brief ?.
|
||||
/// first index: ? [0..1023] (hard coded)
|
||||
int16_t *prachF;
|
||||
/// \brief ?.
|
||||
/// first index: rx antenna [0..63] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx.
|
||||
/// second index: ? [0..ofdm_symbol_size*12[
|
||||
int16_t *rxsigF[64];
|
||||
/// \brief local buffer to compute prach_ifft (necessary in case of multiple CCs)
|
||||
/// first index: rx antenna [0..63] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx.
|
||||
/// second index: ? [0..2047] (hard coded)
|
||||
int16_t *prach_ifft[64];
|
||||
} NB_IoT_eNB_PRACH;
|
||||
|
||||
typedef enum {
|
||||
NOT_SYNCHED_NB_IoT=0,
|
||||
PRACH_NB_IoT=1,
|
||||
RA_RESPONSE_NB_IoT=2,
|
||||
PUSCH_NB_IoT=3,
|
||||
RESYNCH_NB_IoT=4
|
||||
} UE_MODE_NB_IoT_t;
|
||||
|
||||
|
||||
#endif
|
||||
541
openair1/PHY/impl_defs_top_NB_IoT.h
Normal file
541
openair1/PHY/impl_defs_top_NB_IoT.h
Normal file
@@ -0,0 +1,541 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/impl_defs_top.h
|
||||
* \brief More defines and structure definitions
|
||||
* \author R. Knopp, F. Kaltenberger
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __PHY_IMPLEMENTATION_DEFS_NB_IOT_H__
|
||||
#define __PHY_IMPLEMENTATION_DEFS_NB_IOT_H__
|
||||
|
||||
|
||||
#include "openairinterface5g_limits.h"
|
||||
/** @defgroup _ref_implementation_ OpenAirInterface LTE Implementation
|
||||
* @{
|
||||
|
||||
* @defgroup _PHY_RF_INTERFACE_ PHY - RF Interface
|
||||
* @ingroup _PHY_RF_INTERFACE_
|
||||
* @{
|
||||
* @defgroup _GENERIC_PHY_RF_INTERFACE_ Generic PHY - RF Interface
|
||||
* @defgroup _USRP_PHY_RF_INTERFACE_ PHY - USRP RF Interface
|
||||
* @defgroup _BLADERF_PHY_RF_INTERFACE_ PHY - BLADERF RF Interface
|
||||
* @defgroup _LMSSDR_PHY_RF_INTERFACE_ PHY - LMSSDR RF Interface
|
||||
* @}
|
||||
*
|
||||
* @ingroup _ref_implementation_
|
||||
* @{
|
||||
* This module is responsible for defining the generic interface between PHY and RF Target
|
||||
* @}
|
||||
|
||||
* @defgroup _openair1_ openair1 Reference Implementation
|
||||
* @ingroup _ref_implementation_
|
||||
* @{
|
||||
|
||||
|
||||
* @defgroup _physical_layer_ref_implementation_ Physical Layer Reference Implementation
|
||||
* @ingroup _openair1_
|
||||
* @{
|
||||
|
||||
|
||||
* @defgroup _PHY_STRUCTURES_ Basic Structures and Memory Initialization
|
||||
* @ingroup _physical_layer_ref_implementation_
|
||||
* @{
|
||||
* This module is responsible for defining and initializing the PHY variables during static configuration of OpenAirInterface.
|
||||
* @}
|
||||
|
||||
* @defgroup _PHY_DSP_TOOLS_ DSP Tools
|
||||
* @ingroup _physical_layer_ref_implementation_
|
||||
* @{
|
||||
* This module is responsible for basic signal processing related to inner-MODEM processing.
|
||||
* @}
|
||||
|
||||
* @defgroup _PHY_MODULATION_ Modulation and Demodulation
|
||||
* @ingroup _physical_layer_ref_implementation_
|
||||
* @{
|
||||
* This module is responsible for procedures related to OFDMA modulation and demodulation.
|
||||
* @}
|
||||
|
||||
* @defgroup _PHY_PARAMETER_ESTIMATION_BLOCKS_ Parameter Estimation
|
||||
* @ingroup _physical_layer_ref_implementation_
|
||||
* @{
|
||||
* This module is responsible for procedures related to OFDMA frequency-domain channel estimation for LTE Downlink Channels.
|
||||
* @}
|
||||
|
||||
* @defgroup _PHY_CODING_BLOCKS_ Channel Coding/Decoding Functions
|
||||
* @ingroup _physical_layer_ref_implementation_
|
||||
* @{
|
||||
* This module is responsible for procedures related to channel coding/decoding, rate-matching, segementation and interleaving.
|
||||
* @}
|
||||
|
||||
* @defgroup _PHY_TRANSPORT_ Transport/Physical Channel Processing
|
||||
* @ingroup _physical_layer_ref_implementation_
|
||||
* @{
|
||||
* This module is responsible for defining and processing the PHY procedures (TX/RX) related to transport and physical channels.
|
||||
* @}
|
||||
|
||||
* @defgroup _PHY_PROCEDURES_ Physical Layer Procedures
|
||||
* @ingroup _physical_layer_ref_implementation_
|
||||
* @{
|
||||
* This module is responsible for defining and processing the PHY procedures (TX/RX) related to transport and physical channels.
|
||||
* @}
|
||||
|
||||
* @}
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
|
||||
//#include "types.h"
|
||||
|
||||
/*
|
||||
|
||||
|
||||
#define NUMBER_OF_OFDM_CARRIERS (frame_parms->ofdm_symbol_size)
|
||||
#define NUMBER_OF_SYMBOLS_PER_FRAME (frame_parms->symbols_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)
|
||||
#define NUMBER_OF_USEFUL_CARRIERS (12*frame_parms->N_RB_DL)
|
||||
#define NUMBER_OF_ZERO_CARRIERS (NUMBER_OF_OFDM_CARRIERS-NUMBER_OF_USEFUL_CARRIERS)
|
||||
#define NUMBER_OF_USEFUL_CARRIERS_BYTES (NUMBER_OF_USEFUL_CARRIERS>>2)
|
||||
#define HALF_NUMBER_OF_USEFUL_CARRIERS (NUMBER_OF_USEFUL_CARRIERS>>1)
|
||||
#define HALF_NUMBER_OF_USEFUL_CARRIERS_BYTES (HALF_NUMBER_OF_USEFUL_CARRIERS>>2)
|
||||
#define FIRST_CARRIER_OFFSET (HALF_NUMBER_OF_USEFUL_CARRIERS+NUMBER_OF_ZERO_CARRIERS)
|
||||
#define NUMBER_OF_OFDM_SYMBOLS_PER_SLOT (NUMBER_OF_SYMBOLS_PER_FRAME/LTE_SLOTS_PER_FRAME)
|
||||
|
||||
#ifdef EMOS
|
||||
#define EMOS_SCH_INDEX 1
|
||||
#endif //EMOS
|
||||
|
||||
#define EXTENSION_TYPE (PHY_config->PHY_framing.Extension_type)
|
||||
|
||||
#define NUMBER_OF_OFDM_CARRIERS_BYTES NUMBER_OF_OFDM_CARRIERS*4
|
||||
//#define NUMBER_OF_USEFUL_CARRIERS_BYTES NUMBER_OF_USEFUL_CARRIERS*4
|
||||
#define HALF_NUMBER_OF_USER_CARRIERS_BYTES NUMBER_OF_USEFUL_CARRIERS/2
|
||||
|
||||
#define CYCLIC_PREFIX_LENGTH (frame_parms->nb_prefix_samples)
|
||||
#define CYCLIC_PREFIX_LENGTH_SAMPLES (CYCLIC_PREFIX_LENGTH*2)
|
||||
#define CYCLIC_PREFIX_LENGTH_BYTES (CYCLIC_PREFIX_LENGTH*4)
|
||||
#define CYCLIC_PREFIX_LENGTH0 (frame_parms->nb_prefix_samples0)
|
||||
#define CYCLIC_PREFIX_LENGTH_SAMPLES0 (CYCLIC_PREFIX_LENGTH0*2)
|
||||
#define CYCLIC_PREFIX_LENGTH_BYTES0 (CYCLIC_PREFIX_LENGTH0*4)
|
||||
|
||||
#define OFDM_SYMBOL_SIZE_SAMPLES ((NUMBER_OF_OFDM_CARRIERS + CYCLIC_PREFIX_LENGTH)*2) // 16-bit units (i.e. real samples)
|
||||
#define OFDM_SYMBOL_SIZE_SAMPLES0 ((NUMBER_OF_OFDM_CARRIERS + CYCLIC_PREFIX_LENGTH0)*2) // 16-bit units (i.e. real samples)
|
||||
#define OFDM_SYMBOL_SIZE_SAMPLES_MAX 4096 // 16-bit units (i.e. real samples)
|
||||
#define OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES (OFDM_SYMBOL_SIZE_SAMPLES/2) // 32-bit units (i.e. complex samples)
|
||||
#define OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0 (OFDM_SYMBOL_SIZE_SAMPLES0/2) // 32-bit units (i.e. complex samples)
|
||||
#define OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX ((NUMBER_OF_OFDM_CARRIERS)*2)
|
||||
#define OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX (OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX/2)
|
||||
#define OFDM_SYMBOL_SIZE_BYTES (OFDM_SYMBOL_SIZE_SAMPLES*2)
|
||||
#define OFDM_SYMBOL_SIZE_BYTES0 (OFDM_SYMBOL_SIZE_SAMPLES0*2)
|
||||
#define OFDM_SYMBOL_SIZE_BYTES_NO_PREFIX (OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX*2)
|
||||
|
||||
#define SLOT_LENGTH_BYTES (frame_parms->samples_per_tti<<1) // 4 bytes * samples_per_tti/2
|
||||
#define SLOT_LENGTH_BYTES_NO_PREFIX (OFDM_SYMBOL_SIZE_BYTES_NO_PREFIX * NUMBER_OF_OFDM_SYMBOLS_PER_SLOT)
|
||||
|
||||
#define FRAME_LENGTH_COMPLEX_SAMPLES (frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)
|
||||
#define FRAME_LENGTH_SAMPLES (FRAME_LENGTH_COMPLEX_SAMPLES*2)
|
||||
#define FRAME_LENGTH_SAMPLES_NO_PREFIX (NUMBER_OF_SYMBOLS_PER_FRAME*OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX)
|
||||
#define FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX (FRAME_LENGTH_SAMPLES_NO_PREFIX/2)
|
||||
|
||||
#define NUMBER_OF_CARRIERS_PER_GROUP (NUMBER_OF_USEFUL_CARRIERS/NUMBER_OF_FREQUENCY_GROUPS)
|
||||
|
||||
#define RX_PRECISION (16)
|
||||
#define LOG2_RX_PRECISION (4)
|
||||
#define RX_OUTPUT_SHIFT (4)
|
||||
|
||||
|
||||
#define SAMPLE_SIZE_BYTES 2 // 2 bytes/real sample
|
||||
|
||||
#define FRAME_LENGTH_BYTES (FRAME_LENGTH_SAMPLES * SAMPLE_SIZE_BYTES) // frame size in bytes
|
||||
#define FRAME_LENGTH_BYTES_NO_PREFIX (FRAME_LENGTH_SAMPLES_NO_PREFIX * SAMPLE_SIZE_BYTES) // frame size in bytes
|
||||
|
||||
|
||||
#define FFT_SCALE_FACTOR 8 // Internal Scaling for FFT
|
||||
#define DMA_BLKS_PER_SLOT (SLOT_LENGTH_BYTES/2048) // Number of DMA blocks per slot
|
||||
#define SLOT_TIME_NS (SLOT_LENGTH_SAMPLES*(1e3)/7.68) // slot time in ns
|
||||
|
||||
#define NB_ANTENNA_PORTS_ENB 6 // total number of eNB antenna ports
|
||||
|
||||
#ifdef EXMIMO
|
||||
#define TARGET_RX_POWER 55 // Target digital power for the AGC
|
||||
#define TARGET_RX_POWER_MAX 55 // Maximum digital power, such that signal does not saturate (value found by simulation)
|
||||
#define TARGET_RX_POWER_MIN 50 // Minimum digital power, anything below will be discarded (value found by simulation)
|
||||
#else
|
||||
#define TARGET_RX_POWER 50 // Target digital power for the AGC
|
||||
#define TARGET_RX_POWER_MAX 65 // Maximum digital power, such that signal does not saturate (value found by simulation)
|
||||
#define TARGET_RX_POWER_MIN 35 // Minimum digital power, anything below will be discarded (value found by simulation)
|
||||
#endif
|
||||
|
||||
//the min and max gains have to match the calibrated gain table
|
||||
//#define MAX_RF_GAIN 160
|
||||
//#define MIN_RF_GAIN 96
|
||||
#define MAX_RF_GAIN 200
|
||||
#define MIN_RF_GAIN 80
|
||||
|
||||
#define PHY_SYNCH_OFFSET ((OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES)-1) // OFFSET of BEACON SYNCH
|
||||
#define PHY_SYNCH_MIN_POWER 1000
|
||||
#define PHY_SYNCH_THRESHOLD 100
|
||||
|
||||
*/
|
||||
|
||||
#define ONE_OVER_SQRT2_Q15_NB_IoT 23170
|
||||
|
||||
/*
|
||||
#define ONE_OVER_2_Q15 16384
|
||||
|
||||
// QAM amplitude definitions
|
||||
|
||||
/// First Amplitude for QAM16 (\f$ 2^{15} \times 2/\sqrt{10}\f$)
|
||||
#define QAM16_n1 20724
|
||||
/// Second Amplitude for QAM16 (\f$ 2^{15} \times 1/\sqrt{10}\f$)
|
||||
#define QAM16_n2 10362
|
||||
|
||||
///First Amplitude for QAM64 (\f$ 2^{15} \times 4/\sqrt{42}\f$)
|
||||
#define QAM64_n1 20225
|
||||
///Second Amplitude for QAM64 (\f$ 2^{15} \times 2/\sqrt{42}\f$)
|
||||
#define QAM64_n2 10112
|
||||
///Third Amplitude for QAM64 (\f$ 2^{15} \times 1/\sqrt{42}\f$)
|
||||
#define QAM64_n3 5056
|
||||
|
||||
/// First Amplitude for QAM16 for TM5 (\f$ 2^{15} \times 2/sqrt(20)\f$)
|
||||
#define QAM16_TM5_n1 14654
|
||||
/// Second Amplitude for QAM16 for TM5 Receiver (\f$ 2^{15} \times 1/\sqrt{20}\f$)
|
||||
#define QAM16_TM5_n2 7327
|
||||
|
||||
///First Amplitude for QAM64 (\f$ 2^{15} \times 4/\sqrt{84}\f$)
|
||||
#define QAM64_TM5_n1 14301
|
||||
///Second Amplitude for QAM64 (\f$ 2^{15} \times 2/\sqrt{84}\f$)
|
||||
#define QAM64_TM5_n2 7150
|
||||
///Third Amplitude for QAM64 for TM5 Receiver (\f$ 2^{15} \times 1/\sqrt{84}\f$)
|
||||
#define QAM64_TM5_n3 3575
|
||||
|
||||
|
||||
#ifdef BIT8_RXMUX
|
||||
#define PERROR_SHIFT 0
|
||||
#else
|
||||
#define PERROR_SHIFT 10
|
||||
#endif
|
||||
|
||||
#define BIT8_TX_SHIFT 2
|
||||
#define BIT8_TX_SHIFT_DB 12
|
||||
|
||||
//#define CHBCH_RSSI_MIN -75
|
||||
|
||||
#ifdef BIT8_TX
|
||||
#define AMP 128
|
||||
#else
|
||||
#define AMP 512//1024 //4096
|
||||
#endif
|
||||
|
||||
#define AMP_OVER_SQRT2 ((AMP*ONE_OVER_SQRT2_Q15)>>15)
|
||||
#define AMP_OVER_2 (AMP>>1)
|
||||
|
||||
/// Threshold for PUCCH Format 1 detection
|
||||
#define PUCCH1_THRES 0
|
||||
/// Threshold for PUCCH Format 1a/1b detection
|
||||
#define PUCCH1a_THRES 4
|
||||
|
||||
/// Data structure for transmission.
|
||||
typedef struct {
|
||||
/// RAW TX sample buffer
|
||||
char *TX_DMA_BUFFER[2];
|
||||
} TX_VARS ;
|
||||
|
||||
/// Data structure for reception.
|
||||
typedef struct {
|
||||
/// RAW TX sample buffer
|
||||
char *TX_DMA_BUFFER[2];
|
||||
/// RAW RX sample buffer
|
||||
int *RX_DMA_BUFFER[2];
|
||||
} TX_RX_VARS;
|
||||
|
||||
//! \brief Extension Type /
|
||||
typedef enum {
|
||||
CYCLIC_PREFIX,
|
||||
CYCLIC_SUFFIX,
|
||||
ZEROS,
|
||||
NONE
|
||||
} Extension_t;
|
||||
|
||||
/// Measurement Variables
|
||||
*/
|
||||
#define NUMBER_OF_SUBBANDS_MAX_NB_IoT 13
|
||||
/*
|
||||
#define NUMBER_OF_HARQ_PID_MAX 8
|
||||
|
||||
#define MAX_FRAME_NUMBER 0x400
|
||||
#include "openairinterface5g_limits.h"
|
||||
|
||||
#define NUMBER_OF_RN_MAX 3
|
||||
typedef enum {no_relay=1,unicast_relay_type1,unicast_relay_type2, multicast_relay} relaying_type_t;
|
||||
|
||||
typedef struct {
|
||||
//unsigned int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (linear)
|
||||
//unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (dB)
|
||||
//unsigned short rx_avg_power_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //! estimated avg received signal power (dB)
|
||||
|
||||
// RRC measurements
|
||||
uint32_t rssi;
|
||||
int n_adj_cells;
|
||||
unsigned int adj_cell_id[6];
|
||||
uint32_t rsrq[7];
|
||||
uint32_t rsrp[7];
|
||||
float rsrp_filtered[7]; // after layer 3 filtering
|
||||
float rsrq_filtered[7];
|
||||
// common measurements
|
||||
//! estimated noise power (linear)
|
||||
unsigned int n0_power[NB_ANTENNAS_RX];
|
||||
//! estimated noise power (dB)
|
||||
unsigned short n0_power_dB[NB_ANTENNAS_RX];
|
||||
//! total estimated noise power (linear)
|
||||
unsigned int n0_power_tot;
|
||||
//! total estimated noise power (dB)
|
||||
unsigned short n0_power_tot_dB;
|
||||
//! average estimated noise power (linear)
|
||||
unsigned int n0_power_avg;
|
||||
//! average estimated noise power (dB)
|
||||
unsigned short n0_power_avg_dB;
|
||||
//! total estimated noise power (dBm)
|
||||
short n0_power_tot_dBm;
|
||||
|
||||
// UE measurements
|
||||
//! estimated received spatial signal power (linear)
|
||||
int rx_spatial_power[NUMBER_OF_CONNECTED_eNB_MAX][2][2];
|
||||
//! estimated received spatial signal power (dB)
|
||||
unsigned short rx_spatial_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][2][2];
|
||||
|
||||
/// estimated received signal power (sum over all TX antennas)
|
||||
//int wideband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
/// estimated received signal power (sum over all TX antennas)
|
||||
//int wideband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
|
||||
/// estimated received signal power (sum over all TX/RX antennas)
|
||||
int rx_power_tot[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW
|
||||
/// estimated received signal power (sum over all TX/RX antennas)
|
||||
unsigned short rx_power_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW
|
||||
|
||||
//! estimated received signal power (sum of all TX/RX antennas, time average)
|
||||
int rx_power_avg[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
//! estimated received signal power (sum of all TX/RX antennas, time average, in dB)
|
||||
unsigned short rx_power_avg_dB[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
|
||||
/// SINR (sum of all TX/RX antennas, in dB)
|
||||
int wideband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
/// SINR (sum of all TX/RX antennas, time average, in dB)
|
||||
int wideband_cqi_avg[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
|
||||
//! estimated rssi (dBm)
|
||||
short rx_rssi_dBm[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation[NUMBER_OF_CONNECTED_eNB_MAX][2];
|
||||
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation_dB[NUMBER_OF_CONNECTED_eNB_MAX][2];
|
||||
|
||||
/// Wideband CQI (sum of all RX antennas, in dB, for precoded transmission modes (3,4,5,6), up to 4 spatial streams)
|
||||
int precoded_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX+1][4];
|
||||
/// Subband CQI per RX antenna (= SINR)
|
||||
int subband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS_MAX];
|
||||
/// Total Subband CQI (= SINR)
|
||||
int subband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX];
|
||||
/// Subband CQI in dB (= SINR dB)
|
||||
int subband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS_MAX];
|
||||
/// Total Subband CQI
|
||||
int subband_cqi_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX];
|
||||
/// Wideband PMI for each RX antenna
|
||||
int wideband_pmi_re[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
/// Wideband PMI for each RX antenna
|
||||
int wideband_pmi_im[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
///Subband PMI for each RX antenna
|
||||
int subband_pmi_re[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX][NB_ANTENNAS_RX];
|
||||
///Subband PMI for each RX antenna
|
||||
int subband_pmi_im[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX][NB_ANTENNAS_RX];
|
||||
/// chosen RX antennas (1=Rx antenna 1, 2=Rx antenna 2, 3=both Rx antennas)
|
||||
unsigned char selected_rx_antennas[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX];
|
||||
/// Wideband Rank indication
|
||||
unsigned char rank[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
/// Number of RX Antennas
|
||||
unsigned char nb_antennas_rx;
|
||||
/// DLSCH error counter
|
||||
// short dlsch_errors;
|
||||
|
||||
} PHY_MEASUREMENTS;
|
||||
*/
|
||||
typedef enum {no_relay_NB_IoT=1,unicast_relay_type1_NB_IoT,unicast_relay_type2_NB_IoT, multicast_relay_NB_IoT} relaying_type_t_NB_IoT;
|
||||
typedef struct {
|
||||
//unsigned int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (linear)
|
||||
//unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (dB)
|
||||
//unsigned short rx_avg_power_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //! estimated avg received signal power (dB)
|
||||
|
||||
// RRC measurements
|
||||
uint32_t rssi;
|
||||
int n_adj_cells;
|
||||
unsigned int adj_cell_id[6];
|
||||
uint32_t rsrq[7];
|
||||
uint32_t rsrp[7];
|
||||
float rsrp_filtered[7]; // after layer 3 filtering
|
||||
float rsrq_filtered[7];
|
||||
// common measurements
|
||||
//! estimated noise power (linear)
|
||||
unsigned int n0_power[NB_ANTENNAS_RX];
|
||||
//! estimated noise power (dB)
|
||||
unsigned short n0_power_dB[NB_ANTENNAS_RX];
|
||||
//! total estimated noise power (linear)
|
||||
unsigned int n0_power_tot;
|
||||
//! total estimated noise power (dB)
|
||||
unsigned short n0_power_tot_dB;
|
||||
//! average estimated noise power (linear)
|
||||
unsigned int n0_power_avg;
|
||||
//! average estimated noise power (dB)
|
||||
unsigned short n0_power_avg_dB;
|
||||
//! total estimated noise power (dBm)
|
||||
short n0_power_tot_dBm;
|
||||
|
||||
// UE measurements
|
||||
//! estimated received spatial signal power (linear)
|
||||
int rx_spatial_power[NUMBER_OF_CONNECTED_eNB_MAX][2][2];
|
||||
//! estimated received spatial signal power (dB)
|
||||
unsigned short rx_spatial_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][2][2];
|
||||
|
||||
/// estimated received signal power (sum over all TX antennas)
|
||||
//int wideband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
/// estimated received signal power (sum over all TX antennas)
|
||||
//int wideband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
|
||||
/// estimated received signal power (sum over all TX/RX antennas)
|
||||
int rx_power_tot[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW
|
||||
/// estimated received signal power (sum over all TX/RX antennas)
|
||||
unsigned short rx_power_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW
|
||||
|
||||
//! estimated received signal power (sum of all TX/RX antennas, time average)
|
||||
int rx_power_avg[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
//! estimated received signal power (sum of all TX/RX antennas, time average, in dB)
|
||||
unsigned short rx_power_avg_dB[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
|
||||
/// SINR (sum of all TX/RX antennas, in dB)
|
||||
int wideband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
/// SINR (sum of all TX/RX antennas, time average, in dB)
|
||||
int wideband_cqi_avg[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
|
||||
//! estimated rssi (dBm)
|
||||
short rx_rssi_dBm[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation[NUMBER_OF_CONNECTED_eNB_MAX][2];
|
||||
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation_dB[NUMBER_OF_CONNECTED_eNB_MAX][2];
|
||||
|
||||
/// Wideband CQI (sum of all RX antennas, in dB, for precoded transmission modes (3,4,5,6), up to 4 spatial streams)
|
||||
int precoded_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX+1][4];
|
||||
/// Subband CQI per RX antenna (= SINR)
|
||||
int subband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS_MAX_NB_IoT];
|
||||
/// Total Subband CQI (= SINR)
|
||||
int subband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX_NB_IoT];
|
||||
/// Subband CQI in dB (= SINR dB)
|
||||
int subband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS_MAX_NB_IoT];
|
||||
/// Total Subband CQI
|
||||
int subband_cqi_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX_NB_IoT];
|
||||
/// Wideband PMI for each RX antenna
|
||||
int wideband_pmi_re[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
/// Wideband PMI for each RX antenna
|
||||
int wideband_pmi_im[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
|
||||
///Subband PMI for each RX antenna
|
||||
int subband_pmi_re[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX_NB_IoT][NB_ANTENNAS_RX];
|
||||
///Subband PMI for each RX antenna
|
||||
int subband_pmi_im[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX_NB_IoT][NB_ANTENNAS_RX];
|
||||
/// chosen RX antennas (1=Rx antenna 1, 2=Rx antenna 2, 3=both Rx antennas)
|
||||
unsigned char selected_rx_antennas[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX_NB_IoT];
|
||||
/// Wideband Rank indication
|
||||
unsigned char rank[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
/// Number of RX Antennas
|
||||
unsigned char nb_antennas_rx;
|
||||
/// DLSCH error counter
|
||||
// short dlsch_errors;
|
||||
|
||||
} PHY_MEASUREMENTS_NB_IoT;
|
||||
|
||||
|
||||
typedef struct {
|
||||
//unsigned int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (linear)
|
||||
//unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (dB)
|
||||
//unsigned short rx_avg_power_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //! estimated avg received signal power (dB)
|
||||
|
||||
// common measurements
|
||||
//! estimated noise power (linear)
|
||||
unsigned int n0_power[NB_ANTENNAS_RX];
|
||||
//! estimated noise power (dB)
|
||||
unsigned short n0_power_dB[NB_ANTENNAS_RX];
|
||||
//! total estimated noise power (linear)
|
||||
unsigned int n0_power_tot;
|
||||
//! estimated avg noise power (dB)
|
||||
unsigned short n0_power_tot_dB;
|
||||
//! estimated avg noise power (dB)
|
||||
short n0_power_tot_dBm;
|
||||
//! estimated avg noise power per RB per RX ant (lin)
|
||||
unsigned short n0_subband_power[NB_ANTENNAS_RX][100];
|
||||
//! estimated avg noise power per RB per RX ant (dB)
|
||||
unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][100];
|
||||
//! estimated avg noise power per RB (dB)
|
||||
short n0_subband_power_tot_dB[100];
|
||||
//! estimated avg noise power per RB (dBm)
|
||||
short n0_subband_power_tot_dBm[100];
|
||||
// eNB measurements (per user)
|
||||
//! estimated received spatial signal power (linear)
|
||||
unsigned int rx_spatial_power[NUMBER_OF_UE_MAX_NB_IoT][2][2];
|
||||
//! estimated received spatial signal power (dB)
|
||||
unsigned short rx_spatial_power_dB[NUMBER_OF_UE_MAX_NB_IoT][2][2];
|
||||
//! estimated rssi (dBm)
|
||||
short rx_rssi_dBm[NUMBER_OF_UE_MAX_NB_IoT];
|
||||
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation[NUMBER_OF_UE_MAX_NB_IoT][2];
|
||||
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation_dB[NUMBER_OF_UE_MAX_NB_IoT][2];
|
||||
|
||||
/// Wideband CQI (= SINR)
|
||||
int wideband_cqi[NUMBER_OF_UE_MAX_NB_IoT][NB_ANTENNAS_RX];
|
||||
/// Wideband CQI in dB (= SINR dB)
|
||||
int wideband_cqi_dB[NUMBER_OF_UE_MAX_NB_IoT][NB_ANTENNAS_RX];
|
||||
/// Wideband CQI (sum of all RX antennas, in dB)
|
||||
char wideband_cqi_tot[NUMBER_OF_UE_MAX_NB_IoT];
|
||||
/// Subband CQI per RX antenna and RB (= SINR)
|
||||
int subband_cqi[NUMBER_OF_UE_MAX_NB_IoT][NB_ANTENNAS_RX][100];
|
||||
/// Total Subband CQI and RB (= SINR)
|
||||
int subband_cqi_tot[NUMBER_OF_UE_MAX_NB_IoT][100];
|
||||
/// Subband CQI in dB and RB (= SINR dB)
|
||||
int subband_cqi_dB[NUMBER_OF_UE_MAX_NB_IoT][NB_ANTENNAS_RX][100];
|
||||
/// Total Subband CQI and RB
|
||||
int subband_cqi_tot_dB[NUMBER_OF_UE_MAX_NB_IoT][100];
|
||||
|
||||
} PHY_MEASUREMENTS_eNB_NB_IoT;
|
||||
/*
|
||||
#define MCS_COUNT 28
|
||||
#define MCS_TABLE_LENGTH_MAX 64
|
||||
*/
|
||||
#endif //__PHY_IMPLEMENTATION_DEFS_H__
|
||||
/**@}
|
||||
*/
|
||||
32
openair1/PHY/types_NB_IoT.h
Normal file
32
openair1/PHY/types_NB_IoT.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef __openair_TYPES_NB_IOT_H__
|
||||
#define __openair_TYPES_NB_IOT_H__
|
||||
|
||||
#ifdef USER_MODE
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#include <linux/types.h>
|
||||
#endif
|
||||
|
||||
|
||||
#endif /*__openair_TYPES_NB_IOT_H__ */
|
||||
@@ -150,4 +150,7 @@ int16_t unscrambling_lut[65536*16] __attribute__((aligned(32)));
|
||||
uint8_t scrambling_lut[65536*16] __attribute__((aligned(32)));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /*__PHY_VARS_H__ */
|
||||
|
||||
162
openair1/PHY/vars_NB_IoT.h
Normal file
162
openair1/PHY/vars_NB_IoT.h
Normal file
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef __PHY_VARS_NB_IOT_H__
|
||||
#define __PHY_VARS_NB_IOT_H__
|
||||
|
||||
#include "PHY/types_NB_IoT.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
|
||||
/*
|
||||
#ifndef USER_MODE
|
||||
unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX];
|
||||
unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
|
||||
unsigned int DAQ_MBOX;
|
||||
#endif
|
||||
char* namepointer_chMag ;
|
||||
char fmageren_name2[512];
|
||||
char* namepointer_log2;
|
||||
//PHY_CONFIG *PHY_config;
|
||||
*/
|
||||
|
||||
/*
|
||||
#include "PHY/LTE_REFSIG/primary_synch.h"
|
||||
int16_t *primary_synch0_time;
|
||||
int16_t *primary_synch1_time;
|
||||
int16_t *primary_synch2_time;
|
||||
*/
|
||||
|
||||
//#include "PHY/CODING/vars.h"
|
||||
|
||||
//PHY_VARS *PHY_vars;
|
||||
#ifndef OCP_FRAMEWORK
|
||||
PHY_VARS_UE_NB_IoT ***PHY_vars_UE_NB_IoT_g;
|
||||
PHY_VARS_eNB_NB_IoT ***PHY_vars_eNB_NB_IoT_g;
|
||||
PHY_VARS_RN_NB_IoT **PHY_vars_RN_NB_IoT_g;
|
||||
//NB_IoT_DL_FRAME_PARMS *lte_frame_parms_g;
|
||||
#else
|
||||
PHY_VARS_UE_NB_IoT * PHY_vars_UE_NB_IoT_g[MAX_UE][MAX_NUM_CCs]={NULL};
|
||||
PHY_vars_eNB_NB_IoT * PHY_vars_eNB_NB_IoT_g[MAX_eNB_NB_IoT][MAX_NUM_CCs]={NULL};
|
||||
#endif
|
||||
|
||||
///*
|
||||
//unsigned short rev[2048],rev_times4[8192],rev_half[1024];
|
||||
//unsigned short rev256[256],rev512[512],rev1024[1024],rev4096[4096],rev2048[2048],rev8192[8192];
|
||||
//*/
|
||||
/*
|
||||
char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
|
||||
#include "PHY/LTE_TRANSPORT/vars.h"
|
||||
|
||||
|
||||
|
||||
#include "SIMULATION/ETH_TRANSPORT/vars.h"
|
||||
|
||||
|
||||
#ifndef OPENAIR2
|
||||
unsigned char NB_eNB_INST=0;
|
||||
unsigned char NB_UE_INST=0;
|
||||
unsigned char NB_RN_INST=0;
|
||||
unsigned char NB_INST=0;
|
||||
#endif
|
||||
*/
|
||||
|
||||
/*
|
||||
unsigned int ULSCH_max_consecutive_errors = 20;
|
||||
|
||||
int number_of_cards;
|
||||
|
||||
int flag_LA=0;
|
||||
int flagMag;
|
||||
//extern channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX];
|
||||
//extern double ABS_SINR_eff_BLER_table[MCS_COUNT][9][9];
|
||||
//extern double ABS_beta[MCS_COUNT];odi
|
||||
double sinr_bler_map[MCS_COUNT][2][MCS_TABLE_LENGTH_MAX];
|
||||
int table_length[MCS_COUNT];
|
||||
//double sinr_bler_map_up[MCS_COUNT][2][16];
|
||||
|
||||
//for MU-MIMO abstraction using MIESM
|
||||
//this 2D arrarays contains SINR, MI and RBIR in rows 1, 2, and 3 respectively
|
||||
double MI_map_4qam[3][162];
|
||||
double MI_map_16qam[3][197];
|
||||
double MI_map_64qam[3][227];
|
||||
|
||||
// here the first index is for transmission mode 1, 2, 5 and 6 whereas the second index is for the 16 sinr vaues corresponding to 16 CQIs
|
||||
double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812, 2.4012, 3.6849, 6.6754, 8.3885, 8.7970, 12.0437, 14.4709, 15.7281, 17.2424, 17.2424, 17.2424},
|
||||
{-2.2360, -2.2360, -1.3919, -0.0218, 1.5319, 2.9574, 4.3234, 6.3387, 8.9879, 9.5096, 12.6609, 14.0116, 16.4984, 18.1572, 18.1572, 18.1572},
|
||||
{-1, -1.0000, -0.4198, -0.0140, 1.0362, 2.3520, 3.5793, 6.1136, 8.4836, 9.0858, 12.4723, 13.9128, 16.2054, 17.7392, 17.7392, 17.7392},
|
||||
{ -4.1057, -4.1057, -3.3768, -2.2916, -1.1392, 0.1236, 1.2849, 3.1933, 5.9298, 6.4052, 9.6245, 10.9414, 13.5166, 14.9545, 14.9545, 14.9545}
|
||||
};
|
||||
|
||||
//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27};
|
||||
int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28};
|
||||
|
||||
//for SNR to MI conversion 7 th order Polynomial coeff
|
||||
double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639};
|
||||
double q_qpsk[8]= {1.94491167814437e-09,8.40494123817774e-08,4.75527131198034e-07,-2.48946285301621e-05,-0.000347614016158364,0.00209252225437100,0.0742986115462510,0.488297879889425};
|
||||
double q_qam64[8]= {2.25934026232206e-11,-1.45992206328306e-10,-3.70861183071900e-08,-1.22206071019319e-06,6.49115500399637e-06,0.00129828997837433,0.0259669554914859,0.166602901214898};
|
||||
|
||||
//for MI to SNR conversion 7 th order Polynomial coeff
|
||||
double p_qpsk[8]= {5982.42405670359,-21568.1135917693,31293.9987036905,-23394.6795043871,9608.34750585489,-2158.15802349899,267.731968719036,-20.6145324295965};
|
||||
double p_qam16[8]= {7862.12690694170,-28510.3207048338,41542.2150287122,-31088.3036957379,12690.1982361016,-2785.66604739984,326.595462489375,-18.9911849872089};
|
||||
double p_qam64[8]= {8832.57933013696,-32119.1802555952,46914.2578990397,-35163.8150557183,14343.7419388853,-3126.61025510092,360.954930562237,-18.0358548533343};
|
||||
|
||||
// ideal CE MIESM
|
||||
|
||||
double beta1_dlsch_MI[6][MCS_COUNT] = { {1.1188, 0.3720, 0.3755, 0.9453, 0.5799, 0.5256, 0.5485, 0.5340, 0.5165, 0.5300, 0.6594, 0.5962, 0.4884, 0.4927, 0.3687, 0.4614, 0.4081, 0.2639,0.2935,0.2520,0.3709,0.2906,0.2612,0.2390}, {0.7138, 0.5533, 0.5533, 0.4828, 0.4998, 0.4843, 0.4942, 0.5323, 0.5142, 0.4756, 0.5792, 0.4167, 0.4445, 0.3942, 0.3789, 0.2756, 0.4456, 0.1650, 0.2254, 0.2353, 0.2097,0.2517,0.3242,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1},{1.808065416202085, 1.754544945430673,1.902272019362616, 1.790054645392961, 1.563204092967629, 1.585258289348813, 1.579349443720310, 1.570650121437345, 1.545055626608596, 1.362229442426877, 1.85, 1.79, 1.65, 1.54, 1.46, 1.39, 1.33, 1,1,1,1,1,1,1},{0.7146, 0.4789, 0.5392, 0.5556, 0.4975, 0.4847, 0.4691, 0.5261, 0.5278, 0.4962, 0.4468, 0.4113, 0.4622, 0.4609, 0.3946, 0.3991, 0.3532, 0.2439, 0.1898, 0.2929, 0.2712, 0.3367, 0.3591, 0.2571}};
|
||||
double beta2_dlsch_MI[6][MCS_COUNT] = { {1.1293, 0.3707, 0.3722, 0.9310, 0.5808, 0.5265, 0.5404, 0.5279, 0.5210, 0.5226, 0.6438, 0.5827, 0.4804, 0.4830, 0.3638, 0.4506, 0.4107, 0.2547, 0.2797, 0.2413, 0.3351, 0.2750, 0.2568, 0.2273}, {0.7028, 0.5503, 0.5503, 0.4815, 0.5006, 0.4764, 0.4810, 0.5124, 0.4964, 0.4485, 0.5497, 0.3971, 0.4239, 0.3701, 0.3494, 0.2630, 0.4053, 0.1505, 0.2001,0.2024,0.1788,0.2124,0.2668,1}, {1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1},{1.079518113138858, 1.105622953570353, 1.031337449900606, 1.073342032668810, 1.242636589110353, 1.255054927783647, 1.291463834317768, 1.317048698347491, 1.354485054187984, 0.338534029291017, 1.85, 1.79, 1.65, 1.54, 1.46, 1.39, 1.33,1, 1,1,1,1,1,1},{0.6980, 0.4694, 0.5379, 0.5483, 0.4982, 0.4737, 0.4611, 0.5051, 0.5020, 0.4672, 0.4357, 0.3957, 0.4389, 0.4344, 0.3645, 0.3661, 0.3301, 0.2179, 0.1730, 0.2536, 0.2389,0.2884,0.2936,0.2226}};
|
||||
|
||||
//real CE MIESM
|
||||
////////
|
||||
double beta1_dlsch_MI[6][MCS_COUNT] = { {1.32955, 0.59522, 0.54024, 0.98698, 0.81305, 0.76976, 0.69258, 0.69713, 0.70546, 0.69111, 0.81904, 0.72664, 0.79491, 0.72562, 0.53980, 0.33134, 0.50550, 0.40602,0.40281,0.47012,0.50510,0.23540,0.32045,1}, {0.59632, 1.08475, 1.02431, 1.07020, 0.90170, 0.97719, 0.95464, 0.92764, 0.86721, 0.85986, 0.64558, 0.80631, 0.82673, 0.82888, 0.87122, 0.77245, 0.29771, 0.43477, 0.55321, 0.61027, 0.56111, 0.57292, 0.39737,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1},{1.808065416202085, 1.754544945430673,1.902272019362616, 1.790054645392961, 1.563204092967629, 1.585258289348813, 1.579349443720310, 1.570650121437345, 1.545055626608596, 1.362229442426877, 1.85, 1.79, 1.65, 1.54, 1.46, 1.39, 1.33, 1,1,1,1,1,1,1},{0.77532, 1.07544, 1.10571, 1.04099, 0.91638, 0.88644, 0.96405, 0.86709, 0.94066, 0.84430, 1.24478, 1.09665, 1.42604, 0.79541, 0.71847, 0.71604, 0.74561, 0.36431, 0.41536, 0.52175, 0.47096, 0.49977, 0.59728,1}};
|
||||
double beta2_dlsch_MI[6][MCS_COUNT] = { {1.36875, 0.59304, 0.53870, 0.98239, 0.81637, 0.76847, 0.69842, 0.69885, 0.69967, 0.69826, 0.82660, 0.70559, 0.78404, 0.70670, 0.55393, 0.36893, 0.52225, 0.39752, 0.40494, 0.46239, 0.49247,0.26900,0.34504,1}, {0.43775, 0.78208, 0.72875, 0.77458, 0.64485, 0.69174, 0.66097, 0.63289, 0.59652, 0.61175, 0.44551, 0.56047, 0.57314, 0.57553, 0.58849, 0.52159, 0.21241, 0.30139, 0.37373, 0.32029, 0.37067, 0.36706, 0.27118,1}, {1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1},{1.079518113138858, 1.105622953570353, 1.031337449900606, 1.073342032668810, 1.242636589110353, 1.255054927783647, 1.291463834317768, 1.317048698347491, 1.354485054187984, 0.338534029291017, 1.85, 1.79, 1.65, 1.54, 1.46, 1.39, 1.33,1, 1,1,1,1,1,1},{0.54448, 0.73731, 0.79165, 0.74407, 0.68042, 0.64906, 0.71349, 0.62109, 0.65815, 0.60940, 0.90549, 0.78708, 1.03176, 0.58431, 0.53379, 0.51224, 0.52767, 0.26848, 0.29642, 0.36879, 0.34148, 0.35279,0.40633,1}};
|
||||
////////
|
||||
//ideal channel estimation values
|
||||
//double beta1_dlsch[6][MCS_COUNT] = { {2.3814, 0.4956, 0.5273, 1.1708, 0.8014, 0.7889, 0.8111, 0.8139, 0.8124, 0.8479, 1.9280, 1.9664, 2.3857, 2.5147, 2.4511, 3.0158, 2.8643, 5.3013, 5.8594, 6.5372, 7.8073, 7.8030, 7.5295, 7.1320}, {0.5146, 0.5549, 0.7405, 0.6913, 0.7349, 0.7000, 0.7539, 0.7955, 0.8074, 0.7760, 1.8150, 1.6561, 1.9280, 2.3563, 2.6699, 2.3086, 3.1601, 4.5316, 5.2870, 6.0983, 6.5635, 7.7024, 9.9592, 6.6173}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {1.79358, 1.17908, 2.02600, 1.72040, 1.58618, 1.59039, 1.68111, 1.67062, 1.64911, 1.33274, 4.87800, 3.58797, 3.72338, 5.35700, 2.81752, 1.93472, 2.23259, 1,1,1,1,1,1,1}, {0.4445, 0.5918, 0.7118, 0.7115, 0.7284, 0.7202, 0.7117, 0.8111, 0.8239, 0.7907, 1.8456, 1.8144, 2.3830, 2.6634, 2.6129, 2.8127, 2.7372, 4.9424, 4.8763, 6.8413, 7.1493, 9.4180, 10.1230, 8.9613}};
|
||||
//double beta2_dlsch[6][MCS_COUNT] = { {2.3639, 0.4952, 0.5207, 1.1572, 0.8026, 0.7864, 0.7996, 0.8034, 0.8200, 0.8367, 1.8701, 1.9212, 2.2947, 2.4472, 2.4091, 2.9479, 2.8973, 5.0591, 5.5134, 6.1483, 7.2166, 7.5177, 7.5704, 7.2248}, {0.5113, 0.5600, 0.7359, 0.6860, 0.7344, 0.6902, 0.7315, 0.7660, 0.7817, 0.7315, 1.7268, 1.5912, 1.8519, 2.2115, 2.4580, 2.1879, 2.9015, 4.1543, 4.6986, 5.3193, 5.6319, 6.5640, 8.2421, 5.6393}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {0.79479, 0.52872, 0.90005, 0.77170, 0.73220, 0.72060, 0.75433, 0.75451, 0.75989, 0.67655, 1.68525, 1.31100, 1.46573, 1.99843, 1.57293, 1.62852, 2.10636, 1,1,1,1,1,1,1}, {0.4398, 0.5823, 0.7094, 0.7043, 0.7282, 0.7041, 0.6979, 0.7762, 0.7871, 0.7469, 1.7752, 1.7443, 2.2266, 2.4767, 2.4146, 2.6040, 2.5708, 4.4488, 4.4944, 5.9630, 6.3740, 8.1097, 8.4210, 7.8027}};
|
||||
/////////double beta1_dlsch[6][MCS_COUNT] = { {1.199175, 1.085656, 0.983872, 0.843789, 0.816093, 0.853078, 0.899236, 0.919665, 0.888673, 0.924181, 0.814176, 0.794108, 0.770653, 0.826266, 0.982043, 0.979621, 0.985176, 0.901741, 0.870311, 0.911303, 0.898923, 1.003359, 0.988535, 1.030639, 1.151038, 1.116939, 1.214118, 1.219148}, {0.5146, 0.5549, 0.7405, 0.6913, 0.7349, 0.7000, 0.7539, 0.7955, 0.8074, 0.7760, 1.8150, 1.6561, 1.9280, 2.3563, 2.6699, 2.3086, 3.1601, 4.5316, 5.2870, 6.0983, 6.5635, 7.7024, 9.9592, 6.6173}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {1.79358, 1.17908, 2.02600, 1.72040, 1.58618, 1.59039, 1.68111, 1.67062, 1.64911, 1.33274, 4.87800, 3.58797, 3.72338, 5.35700, 2.81752, 1.93472, 2.23259, 1,1,1,1,1,1,1}, {0.4445, 0.5918, 0.7118, 0.7115, 0.7284, 0.7202, 0.7117, 0.8111, 0.8239, 0.7907, 1.8456, 1.8144, 2.3830, 2.6634, 2.6129, 2.8127, 2.7372, 4.9424, 4.8763, 6.8413, 7.1493, 9.4180, 10.1230, 8.9613}};
|
||||
/////////double beta2_dlsch[6][MCS_COUNT] = { {0.534622, 0.596561, 0.500838, 0.471721, 0.548218, 0.547974, 0.924245, 0.836484, 0.776917, 0.879691, 0.875722, 0.666933, 0.666393, 0.755377, 1.074985, 1.080290, 1.010914, 0.790892, 0.793435, 0.860249, 0.901508, 0.967060, 0.951372, 1.011493, 1.106151, 1.117076, 1.209397, 1.227790}, {0.5113, 0.5600, 0.7359, 0.6860, 0.7344, 0.6902, 0.7315, 0.7660, 0.7817, 0.7315, 1.7268, 1.5912, 1.8519, 2.2115, 2.4580, 2.1879, 2.9015, 4.1543, 4.6986, 5.3193, 5.6319, 6.5640, 8.2421, 5.6393}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {0.79479, 0.52872, 0.90005, 0.77170, 0.73220, 0.72060, 0.75433, 0.75451, 0.75989, 0.67655, 1.68525, 1.31100, 1.46573, 1.99843, 1.57293, 1.62852, 2.10636, 1,1,1,1,1,1,1}, {0.4398, 0.5823, 0.7094, 0.7043, 0.7282, 0.7041, 0.6979, 0.7762, 0.7871, 0.7469, 1.7752, 1.7443, 2.2266, 2.4767, 2.4146, 2.6040, 2.5708, 4.4488, 4.4944, 5.9630, 6.3740, 8.1097, 8.4210, 7.8027}};
|
||||
|
||||
//real channel estimation valus
|
||||
///
|
||||
double beta1_dlsch[6][MCS_COUNT] = { {2.50200, 0.84047, 0.78195, 1.37929, 1.16871, 1.11906, 1.06303, 1.07447, 1.11403, 1.09223, 2.82502, 2.87556, 3.51254, 3.62920, 3.53638, 2.35980, 3.74126, 8.66532, 7.31772, 9.86882, 10.64939, 6.75208, 9.50664, 13.63057}, {0.92257, 1, 1.80445, 1.43175, 1.42093, 1.37381, 1.45392, 1.47255, 1.47451, 1.41235, 3.9079, 3.38557, 4.13059, 4.93355, 4.97277, 6.04951, 5.88896, 8.68076, 10.23746, 12.37069, 5.50538, 17.29612, 17.95050, 13.27095}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {1.79255, 1.88213, 4.44226, 2.25150, 1.93710, 2.18504, 2.57389, 1.94322, 1.78515, 2.09265, 2.37459, 1.74442, 1.74346, 1.19705, 1.56149, 1.59604, 1.6, 1,1,1,1,1,1,1}, {0.93374, 1.40389, 1.36670, 1.38679, 1.35707, 1.26353, 1.32360, 1.40164, 1.51843, 1.34863, 3.45839, 3.13726, 3.94768, 4.21966, 4.60750, 4.97894, 5.40755, 8.12814, 10.59221, 12.96427, 13.37323, 14.27206, 16.61779, 17.19656}};
|
||||
double beta2_dlsch[6][MCS_COUNT] = { {2.52163, 0.83231, 0.77472, 1.36536, 1.16829, 1.11186, 1.06287, 1.07292, 1.09946, 1.10650, 2.79174, 2.75655, 3.36651, 3.49011, 3.60903, 2.73517, 3.84009, 8.20312, 7.41739, 9.64081, 10.40911, 8.11765, 10.41923, 9.34300}, {0.67252, 0.8600, 1.28633, 1.01624, 1.03066, 0.97590, 1.02560, 1.01840, 1.00547, 0.97093, 2.72573, 2.33283, 2.86181, 3.40452, 3.47957, 4.08916, 3.97628, 6.14541, 7.11017, 8.42369, 4.04812, 11.42082, 11.57171, 9.28462}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {0.85784, 0.90361, 2.09766, 1.08385, 0.96300, 1.04432, 1.22763, 0.99249, 0.95544, 1.12333, 1.37924, 1.12913, 1.30644, 1.19253, 1.75488, 2.13813, 2.10636, 1,1,1,1,1,1,1}, {0.66288, 0.96402, 0.98545, 0.99386, 0.99981, 0.92678, 0.98978, 0.99600, 1.05538, 0.97777, 2.52504, 2.29338, 2.89631, 3.10812, 3.41916, 3.58671, 3.84166, 6.05254, 7.45821, 9.15812, 9.66330, 10.17852, 11.50519, 11.16299}};
|
||||
|
||||
///
|
||||
|
||||
#ifdef OCP_FRAMEWORK
|
||||
#include <enums.h>
|
||||
#else
|
||||
char eNB_functions[6][20]={"eNodeB_3GPP","eNodeB_3GPP_BBU","NGFI_RCC_IF4p5","NGFI_RAI_IF4p5","NGFI_RRU_IF5","NGFI_RRU_IF4p5",};
|
||||
char eNB_timing[2][20]={"synch_to_ext_device","synch_to_other"};
|
||||
#endif
|
||||
*/
|
||||
/// lookup table for unscrambling in RX
|
||||
int16_t unscrambling_lut_NB_IoT[65536*16] __attribute__((aligned(32)));
|
||||
|
||||
/*
|
||||
/// lookup table for scrambling in TX
|
||||
uint8_t scrambling_lut[65536*16] __attribute__((aligned(32)));
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#endif /*__PHY_VARS_H__ */
|
||||
573
openair1/SCHED/IF_Module_L1_primitives_NB_IoT.c
Normal file
573
openair1/SCHED/IF_Module_L1_primitives_NB_IoT.c
Normal file
@@ -0,0 +1,573 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file IF_Module_L1_primitives_NB_IoT.c
|
||||
* \brief handling nfapi
|
||||
* \author NTUST BMW Lab./
|
||||
* \date 2017
|
||||
* \email:
|
||||
* \version 1.0
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
//#include "PHY/LTE_TRANSPORT/dlsch_tbs_full_NB_IoT.h"
|
||||
|
||||
#include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h"
|
||||
#include "../SCHED/IF_Module_L1_primitives_NB_IoT.h"
|
||||
//#include "../SCHED/defs.h"
|
||||
#include "../SCHED/defs_NB_IoT.h"
|
||||
#include "assertions.h"
|
||||
//#include "PHY/defs.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
//#include "PHY/extern.h"
|
||||
#include "PHY/extern_NB_IoT.h"
|
||||
#include "PHY/extern.h"
|
||||
|
||||
//#include "PHY/vars.h"
|
||||
|
||||
#include "PHY/INIT/defs_NB_IoT.h"
|
||||
|
||||
int Irep_to_Nrep_x[16] = {1,2,4,8,16,32,64,128,192,256,384,512,768,1024,1536,2048};
|
||||
|
||||
|
||||
void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
eNB_rxtx_proc_t *proc,
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu,
|
||||
uint8_t *sdu)
|
||||
{
|
||||
|
||||
NB_IoT_eNB_NDLSCH_t *ndlsch;
|
||||
NB_IoT_eNB_NDLSCH_t *ndlsch23;
|
||||
|
||||
NB_IoT_DL_eNB_HARQ_t *ndlsch_harq;
|
||||
NB_IoT_DL_eNB_HARQ_t *ndlsch_harq23;
|
||||
nfapi_dl_config_ndlsch_pdu_rel13_t *rel13 = &dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13;
|
||||
int UE_id= -1;
|
||||
ndlsch= eNB->ndlsch_SIB1;
|
||||
ndlsch23= eNB->ndlsch_SIB23;
|
||||
|
||||
|
||||
//Check for SI PDU since in NB-IoT there is no DCI for that
|
||||
//SIB1 (type 0), other DLSCH data (type 1) (include the SI messages) based on our ASSUMPTIONs
|
||||
|
||||
//is SIB1-NB
|
||||
if(rel13->rnti_type == 0 && rel13->rnti == 65535)
|
||||
{
|
||||
|
||||
/*
|
||||
* the configuration of the NDLSCH PDU for the SIB1-NB shoudl be the following:
|
||||
* -RNTI type = 0; (BCCH)
|
||||
* -RNTI = OxFFFF (65535)
|
||||
* -Repetition number = 0-15 and should be mapped to 4,8,16 as reported in Table 16.4.1.3-3 TS 36.213 (is the schedulingInoSIB1 of the MIB)
|
||||
* -Number of subframe for resource assignment = may is not neded to know since the scheduling is fixed
|
||||
* (Spec TS 36.331 "SIB1-NB transmission occur in subframe #4 of every other frame in 16 continuous frame"
|
||||
* meaning that from the starting point we should transmit the SIB1-NB in 8 subframes among the 16 available (every other))
|
||||
*
|
||||
* From spec. TS 36.321 v14.2.o pag 31 --> there is an HARQ process for all the broadcast (so we consider it also for SIB1-NB)
|
||||
*
|
||||
*/
|
||||
//LOG_I(PHY,"B NB-handle_nfapi_dlsch_pdu_NB_IoT SIB1\n");
|
||||
ndlsch->active = 1;
|
||||
|
||||
ndlsch->rnti = 65535;
|
||||
|
||||
ndlsch_harq = ndlsch->harq_process;
|
||||
|
||||
ndlsch->ndlsch_type = SIB1;
|
||||
|
||||
ndlsch->npdsch_start_symbol = rel13->start_symbol; //start symbol for the ndlsch transmission
|
||||
|
||||
|
||||
//ndlsch_harq->pdu = sdu;
|
||||
//LOG_I(PHY,"B content_sib1:%d\n",sdu);
|
||||
/////ndlsch->content_sib1.pdu = sdu;
|
||||
ndlsch_harq->pdu = sdu;
|
||||
|
||||
ndlsch->resource_assignment_SIB1 = rel13->number_of_subframes_for_resource_assignment;//maybe we don't care about it since a fixed schedule
|
||||
ndlsch->repetition_number_SIB1 = rel13->repetition_number; //is the schedulingInfoSIB1 (value 1-15) of MIB that is mapped into value 4-8-16 (see NDLSCH fapi specs Table 4-47)
|
||||
ndlsch->modulation = rel13->modulation;
|
||||
ndlsch->status = ACTIVE_NB_IoT;
|
||||
|
||||
ndlsch->nrs_antenna_ports = rel13->nrs_antenna_ports_assumed_by_the_ue;
|
||||
ndlsch->scrambling_sequence_intialization = rel13->scrambling_sequence_initialization_cinit;
|
||||
|
||||
//LOG_I(PHY,"A NB-handle_nfapi_dlsch_pdu_NB_IoT SIB1\n");
|
||||
ndlsch_harq->TBS = TBStable_NB_IoT_SIB1[rel13->repetition_number];
|
||||
|
||||
|
||||
|
||||
}
|
||||
//is SI message (this is an NDLSCH that will be transmitted very frequently)
|
||||
else if(rel13->rnti_type == 1 && rel13->rnti == 65535)
|
||||
{
|
||||
/*
|
||||
*
|
||||
* the configuration of the NDLSCH PDU for the SIB1-NB should be the following:
|
||||
* RNTI type = 1;
|
||||
* RNTI = OxFFFF (65535)
|
||||
* Repetition number = 0 and should be mapped to 1 through Table 16.4.1.3-2 TS 36.213
|
||||
* Number of subframe for resource assignment = will be evaluated by the MAC based on the value of the "si-TB" field inside the SIB1-NB (value 2 or 8)
|
||||
*
|
||||
* From spec. TS 36.321 v14.2.o pag 31 --> there is an HARQ process for all the broadcast
|
||||
*
|
||||
* XXX for the moment we are not able to prevent the problem of Error: first transmission but sdu = NULL.
|
||||
* anyway, the PHY layer if have finished the transmission it will not transmit anything and will generate the error
|
||||
*
|
||||
*/
|
||||
//LOG_I(PHY,"B NB-handle_nfapi_dlsch_pdu_NB_IoT SIB23\n");
|
||||
ndlsch_harq23 = ndlsch23->harq_process;
|
||||
|
||||
//new SI starting transmission (should enter here only the first time for a new transmission)
|
||||
if(sdu != NULL)
|
||||
{
|
||||
|
||||
ndlsch23->active = 1;
|
||||
ndlsch23->ndlsch_type = SI_Message;
|
||||
ndlsch23->rnti = 65535;
|
||||
ndlsch23->npdsch_start_symbol = rel13->start_symbol; //start OFDM symbol for the ndlsch transmission
|
||||
//ndlsch_harq->pdu = sdu;
|
||||
//LOG_I(PHY,"B content_sib23:%d\n",sdu);
|
||||
ndlsch_harq23->pdu = sdu;
|
||||
|
||||
ndlsch_harq23->repetition_number = rel13->repetition_number;//should be always fix to 0 to be mapped in 1
|
||||
ndlsch_harq23->modulation = rel13->modulation;
|
||||
ndlsch_harq23->TBS = rel13->length;
|
||||
//LOG_I(PHY,"A content_sib23:%d\n",sdu);
|
||||
ndlsch23->resource_assignment = rel13->number_of_subframes_for_resource_assignment;//value 2 or 8
|
||||
ndlsch23->counter_repetition_number = rel13->number_of_subframes_for_resource_assignment;
|
||||
ndlsch23->counter_current_sf_repetition = 0;
|
||||
ndlsch23->pointer_to_subframe = 0;
|
||||
//SI information in reality have no feedback (so there is no retransmission from the HARQ view point since no sck and nack)
|
||||
// ndlsch_harq->frame = frame;
|
||||
// ndlsch_harq->subframe = subframe;
|
||||
|
||||
ndlsch23->nrs_antenna_ports = rel13->nrs_antenna_ports_assumed_by_the_ue;
|
||||
ndlsch23->scrambling_sequence_intialization = rel13->scrambling_sequence_initialization_cinit;
|
||||
}
|
||||
else
|
||||
{
|
||||
//continue the remaining transmission of the previous SI at PHY if any (otherwise nothing)
|
||||
//there is no need of repeating the configuration on the ndlsch
|
||||
//ndlsch_harq->pdu = NULL;
|
||||
//LOG_I(PHY,"sib23=NULL\n");
|
||||
ndlsch_harq23->pdu = NULL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Independently if we have the PDU or not (first transmission or repetition) the process is activated for triggering the ndlsch_procedure
|
||||
//LOG_I(PHY,"ACTIVE_NB_IoT\n");
|
||||
ndlsch_harq23->status = ACTIVE_NB_IoT;
|
||||
//LOG_D(PHY,"A NB-handle_nfapi_dlsch_pdu_NB_IoT SIB23\n");
|
||||
|
||||
}
|
||||
//ue specific data or RAR (we already have received the DCI for this)
|
||||
else if(rel13->rnti != 65535 && rel13->rnti_type == 1)
|
||||
{
|
||||
//printf("rel13->rnti: %d, eNB->ndlsch_RAR->rnti: %d\n",rel13->rnti,eNB->ndlsch_RAR->rnti);
|
||||
//eNB->ndlsch_RAR->rnti = rel13->rnti;
|
||||
//check if the PDU is for RAR
|
||||
//if(eNB->ndlsch_RAR != NULL && eNB->ndlsch_RAR->ndlsch_type == RAR) //rnti for the RAR should have been set priviously by the DCI
|
||||
if(eNB->ndlsch_RAR != NULL && rel13->rnti == eNB->ndlsch_RAR->rnti) //rnti for the RAR should have been set priviously by the DCI
|
||||
{
|
||||
|
||||
eNB->ndlsch_RAR->active = 1;
|
||||
eNB->ndlsch_RAR->active_msg2 = 1; /// activated only when NPDSCH is transmitting msg2
|
||||
|
||||
eNB->ndlsch_RAR->rnti = rel13->rnti;
|
||||
eNB->ndlsch_RAR->npdsch_start_symbol = rel13->start_symbol;
|
||||
|
||||
eNB->ndlsch_RAR->rnti_type = rel13->rnti_type;
|
||||
eNB->ndlsch_RAR->resource_assignment = rel13->resource_assignment; // for NDLSCH // this value point to --> number of subframes needed
|
||||
eNB->ndlsch_RAR->repetition_number = Irep_to_Nrep_x[rel13->repetition_number];
|
||||
eNB->ndlsch_RAR->modulation = rel13->modulation;
|
||||
|
||||
eNB->ndlsch_RAR->number_of_subframes_for_resource_assignment = rel13->number_of_subframes_for_resource_assignment; // for NDLSCH //table 16.4.1.3-1 // TS 36.213
|
||||
|
||||
eNB->ndlsch_RAR->counter_repetition_number = Irep_to_Nrep_x[rel13->repetition_number];
|
||||
eNB->ndlsch_RAR->counter_current_sf_repetition = 0;
|
||||
eNB->ndlsch_RAR->pointer_to_subframe = 0;
|
||||
//printf("number of subframe : %d, Rep of subframe : %d\n",eNB->ndlsch_RAR->number_of_subframes_for_resource_assignment,eNB->ndlsch_RAR->counter_repetition_number);
|
||||
eNB->ndlsch_RAR->harq_process->TBS = rel13->length;
|
||||
eNB->ndlsch_RAR->harq_process->pdu = sdu;
|
||||
}
|
||||
else
|
||||
{ //this for ue data
|
||||
//TODO
|
||||
LOG_I(PHY,"handling MSG4 or ue-spec data\n");
|
||||
//program addition DLSCH parameters not from DCI (for the moment we only pass the pdu)
|
||||
//int UE_id = find_dlsch(rel13->rnti,eNB,SEARCH_EXIST);
|
||||
|
||||
UE_id = 0;
|
||||
//UE_id = find_ue_NB_IoT(rel13->rnti,eNB);
|
||||
//AssertFatal(UE_id==-1,"no existing ue specific dlsch_context\n");
|
||||
|
||||
ndlsch = eNB->ndlsch[(uint8_t)UE_id];
|
||||
ndlsch_harq = eNB->ndlsch[(uint8_t)UE_id]->harq_process;
|
||||
AssertFatal(ndlsch_harq!=NULL,"dlsch_harq for ue specific is null\n");
|
||||
|
||||
ndlsch->active = 1;
|
||||
|
||||
ndlsch->rnti = rel13->rnti; // how this value is tested in line 177 ???? i am missing something ????
|
||||
ndlsch->npdsch_start_symbol = rel13->start_symbol;
|
||||
|
||||
ndlsch->rnti_type = rel13->rnti_type;
|
||||
ndlsch->resource_assignment = rel13->resource_assignment ; // for NDLSCH // this value point to --> number of subframes needed
|
||||
ndlsch->repetition_number = Irep_to_Nrep_x[rel13->repetition_number];
|
||||
ndlsch->modulation = rel13->modulation;
|
||||
|
||||
ndlsch->number_of_subframes_for_resource_assignment = rel13->number_of_subframes_for_resource_assignment; // for NDLSCH //table 16.4.1.3-1 // TS 36.213
|
||||
|
||||
ndlsch->counter_repetition_number = Irep_to_Nrep_x[rel13->repetition_number];
|
||||
ndlsch->counter_current_sf_repetition = 0;
|
||||
ndlsch->pointer_to_subframe = 0;
|
||||
|
||||
ndlsch_harq->TBS = rel13->length;
|
||||
ndlsch_harq->pdu = sdu;
|
||||
}
|
||||
|
||||
}
|
||||
//I don't know which kind of data is
|
||||
else
|
||||
{
|
||||
LOG_E(PHY, "handle_nfapi_dlsch_pdu_NB_IoT: Unknown type of data (rnti type %d, rnti %d)\n", rel13->rnti_type, rel13->rnti);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Memo for initialization TODO: target/SIMU/USER/init_lte.c/init_lte_eNB --> new_eNB_dlsch(..) //
|
||||
//this is where the allocation of PHy_vars_eNB_NB_IoT and all the ndlsch structures happen //
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// do the schedule response and trigger the TX
|
||||
void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO)
|
||||
{
|
||||
//LOG_I(PHY,"schedule_response_NB_IoT\n");
|
||||
//XXX check if correct to take eNB like this
|
||||
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][Sched_INFO->CC_id];
|
||||
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
|
||||
NB_IoT_eNB_NPBCH_t *npbch;
|
||||
///
|
||||
int i;
|
||||
//module_id_t Mod_id = Sched_INFO->module_id;
|
||||
//uint8_t CC_id = Sched_INFO->CC_id;
|
||||
nfapi_dl_config_request_t *DL_req = Sched_INFO->DL_req;
|
||||
nfapi_ul_config_request_t *UL_req = Sched_INFO->UL_req;
|
||||
nfapi_hi_dci0_request_t *HI_DCI0_req = Sched_INFO->HI_DCI0_req;
|
||||
nfapi_tx_request_t *TX_req = Sched_INFO->TX_req;
|
||||
|
||||
//uint32_t hypersfn = Sched_INFO->hypersfn;
|
||||
//frame_t frame = Sched_INFO->frame; // unused for instance
|
||||
sub_frame_t subframe = Sched_INFO->subframe;
|
||||
|
||||
|
||||
// implicite declaration of AssertFatal
|
||||
//AsserFatal(proc->subframe_tx != subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe);
|
||||
//AsserFatal(proc->frame_tx != frame, "Current sframe %d != NFAPI frame %d\n", proc->frame_tx,frame );
|
||||
|
||||
|
||||
uint8_t number_dl_pdu = DL_req->dl_config_request_body.number_pdu;
|
||||
uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus;
|
||||
uint8_t number_ul_dci = HI_DCI0_req->hi_dci0_request_body.number_of_dci;
|
||||
|
||||
/*
|
||||
if(number_dl_pdu>=5) number_dl_pdu=0;
|
||||
if(number_ul_dci>=5) number_ul_dci=0;
|
||||
*/
|
||||
//uint8_t number_pdsch_rnti = DL_req->number_pdsch_rnti; // for the moment not used
|
||||
// at most 2 pdus (DCI) in the case of NPDCCH
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu;
|
||||
nfapi_ul_config_request_pdu_t *ul_config_pdu;
|
||||
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
|
||||
|
||||
//clear previous possible allocation (maybe something else should be added)
|
||||
for(int i = 0; i < NUMBER_OF_UE_MAX_NB_IoT; i++)
|
||||
{
|
||||
if(eNB->ndlsch[i])
|
||||
{
|
||||
eNB->ndlsch[i]->harq_process->round=0; // may not needed
|
||||
/*clear previous allocation information for all UEs*/
|
||||
eNB->ndlsch[i]->subframe_tx[subframe] = 0;
|
||||
}
|
||||
|
||||
/*clear the DCI allocation maps for new subframe*/
|
||||
if(eNB->nulsch[i])
|
||||
{
|
||||
eNB->nulsch[i]->harq_process->dci_alloc = 0; //flag for indicating that a DCI has been allocated for UL
|
||||
eNB->nulsch[i]->harq_process->rar_alloc = 0; //Flag indicating that this ULSCH has been allocated by a RAR (for Msg3)
|
||||
//no phich for NB-IoT so no DMRS should be utilized
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (i=0;i<number_dl_pdu;i++) //in principle this should be at most 2 (in case of DCI)
|
||||
{
|
||||
dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i];
|
||||
//LOG_I(PHY, "number_dl_pdu: %d ,dl_config_pdu type: %d\n",number_dl_pdu,dl_config_pdu->pdu_type);
|
||||
switch (dl_config_pdu->pdu_type)
|
||||
{
|
||||
//printf("In case schedule_response_NB_IoT****************************************in schedule_response_NB_IoT\n");
|
||||
case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE:
|
||||
//printf("NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE***********************\n");
|
||||
//Remember: there is no DCI for SI information
|
||||
//LOG_D(PHY,"Generate DL DCI PDU information from scheduler\n");
|
||||
//TODO: separate the ndlsch structure configuration from the DCI (here we will encode only the DCI)
|
||||
generate_eNB_dlsch_params_NB_IoT(eNB,proc,dl_config_pdu);
|
||||
break;
|
||||
case NFAPI_DL_CONFIG_NBCH_PDU_TYPE:
|
||||
//printf("NFAPI_DL_CONFIG_NBCH_PDU_TYPE***********************\n");
|
||||
|
||||
// for the moment we don't care about the n-bch pdu content since we need only the sdu if tx.request
|
||||
npbch = &eNB->npbch; //in the main of the lte-softmodem they should allocate this memory of PHY_vars
|
||||
npbch->h_sfn_lsb = dl_config_pdu->nbch_pdu.nbch_pdu_rel13.hyper_sfn_2_lsbs;
|
||||
//LOG_I(PHY,"npbch->pdu\n");
|
||||
dl_config_pdu->nbch_pdu.nbch_pdu_rel13.pdu_index = 1;
|
||||
|
||||
|
||||
if(TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->nbch_pdu.nbch_pdu_rel13.pdu_index].segments[0].segment_data != NULL)
|
||||
npbch->pdu = TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->nbch_pdu.nbch_pdu_rel13.pdu_index].segments[0].segment_data;
|
||||
else
|
||||
LOG_E(PHY, "Received a schedule_response with N-BCH but no SDU!!\n");
|
||||
|
||||
break;
|
||||
case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE:
|
||||
//printf("NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE***********************\n");
|
||||
//we can have three types of NDLSCH based on our assumptions: SIB1, SI, Data, RAR
|
||||
//remember that SI messages have no DCI in NB-IoT therefore this is the only way to configure the ndlsch_SI/ndlsch_SIB1 structures ndlsch->active = 1;
|
||||
|
||||
/*
|
||||
* OBSERVATION:
|
||||
* Although 2 DCI may be received over a schedule_response the transmission of the NDLSCH data foresees only 1 NDLSCH PDU at time.
|
||||
* Therefore is the MAC scheduler that knowing the different timing delay will send the corresponding schedule_response containing the NDLSCH PDU and the MAC PDU
|
||||
* at the proper DL subframe
|
||||
* -for this reason the activation of the ndslch structure is done only when we receive the NDLSCH pdu (here) such the in the TX procedure only 1 ue-specific pdu
|
||||
* result active from the loop before calling the ndlsch_procedure
|
||||
*/
|
||||
//if(TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->nbch_pdu.nbch_pdu_rel13.pdu_index].segments[0].segment_data != NULL){
|
||||
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.pdu_index = 1;
|
||||
handle_nfapi_dlsch_pdu_NB_IoT(eNB, proc,dl_config_pdu,TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.pdu_index].segments[0].segment_data);
|
||||
//}
|
||||
|
||||
break;
|
||||
default:
|
||||
//printf("default***********************\n");
|
||||
LOG_D(PHY, "dl_config_pdu type not for NB_IoT\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i=0;i<number_ul_dci;i++)
|
||||
{
|
||||
hi_dci0_pdu = &HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list[i];
|
||||
LOG_D(PHY, "number_ul_dci:%d ,hi_dci0_pdu->pdu_type: %d\n",number_ul_dci,hi_dci0_pdu->pdu_type);
|
||||
switch (hi_dci0_pdu->pdu_type)
|
||||
{
|
||||
case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE:
|
||||
LOG_I(PHY, "hi_dci0_pdu type for NB_IoT\n");
|
||||
generate_eNB_ulsch_params_NB_IoT(eNB,proc,hi_dci0_pdu);
|
||||
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY, "hi_dci0_pdu type not for NB_IoT\n");
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(i = 0; i< number_ul_pdu; i++)
|
||||
{
|
||||
ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i];
|
||||
|
||||
NB_IoT_eNB_NULSCH_t *nulsch;
|
||||
NB_IoT_UL_eNB_HARQ_t *nulsch_harq;
|
||||
nfapi_ul_config_nulsch_pdu_rel13_t *nfapi_parameters_rel13 = &ul_config_pdu->nulsch_pdu.nulsch_pdu_rel13;
|
||||
|
||||
switch(ul_config_pdu->pdu_type)
|
||||
{
|
||||
case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE:
|
||||
if(nfapi_parameters_rel13->nulsch_format==0)
|
||||
{
|
||||
// new condition should be added to identify if this is msg3 3 since the TBS_table is not the same.
|
||||
|
||||
// the type of subcarrier spacing should be specified before the call of rx_ulsch since the parameter does not exist in nfapi parameters.
|
||||
|
||||
//TODO should distinguish between data and between data (npusch format)
|
||||
/*NB: for reception of Msg3 generally not exist a DCI (because scheduling information are implicitly given by the RAR)
|
||||
* but in case of FAPI specs we should receive an UL_config (containing the NULSCH pdu) for configuring the PHY for Msg3 reception from the MAC
|
||||
* (this UL_config most probably will be created by the MAC when fill the RAR)
|
||||
* (most probably we don't have the DL_config (for the RAR transmission) and the UL_CONFIG (for the Msg3 reception) at the same time (same subrame)
|
||||
* since we are working in HD-FDD mode so for sure the UE will transmit the Msg3 in another subframe so make sense to have a UL_CONFIG in subframe
|
||||
* diferent from the DL_CONFIG one)
|
||||
*
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
//maybe this condition should be replaced by another test ?!
|
||||
if((nfapi_parameters_rel13->size == 11)) // msg3 data
|
||||
{
|
||||
LOG_I(PHY,"MSG3 process at PHY\n");
|
||||
nulsch = eNB->ulsch_NB_IoT[0];
|
||||
nulsch_harq = nulsch->harq_process;
|
||||
|
||||
nulsch->Msg3_active = 1;
|
||||
nulsch->Msg3_flag = 1;
|
||||
nulsch->flag_vars = 1;
|
||||
nulsch->rnti = nfapi_parameters_rel13->rnti;
|
||||
nulsch->npusch_format = nfapi_parameters_rel13->nulsch_format;
|
||||
nulsch->N_srs = nfapi_parameters_rel13->n_srs;
|
||||
nulsch->C_init = nfapi_parameters_rel13->scrambling_sequence_initialization_cinit;
|
||||
nulsch->SF_idx = nfapi_parameters_rel13->sf_idx;
|
||||
nulsch->HARQ_ACK_resource = nfapi_parameters_rel13->nb_harq_information.nb_harq_information_rel13_fdd.harq_ack_resource;
|
||||
|
||||
//nulsch_harq->subcarrier_spacing = nfapi_parameters_rel13->handle; // get from the UL_grant of MSG3
|
||||
nulsch_harq->subcarrier_indication = nfapi_parameters_rel13->subcarrier_indication; // Isc =0->18 , or 0->47 // format 2, 0->3 or 0->7
|
||||
nulsch_harq->resource_assignment = nfapi_parameters_rel13->resource_assignment; // valid for format 1 // this should be set by DCI N0 // not used for msg3 // I_RU --> helps to get N_RU
|
||||
nulsch_harq->mcs = nfapi_parameters_rel13->mcs; // I_mcs = 0->10 (single tone) and 0->12 (multi-tone)
|
||||
nulsch_harq->rvidx = nfapi_parameters_rel13->redudancy_version; // values = 0 or 1
|
||||
nulsch_harq->repetition_number = nfapi_parameters_rel13->repetition_number; // // N_rep values = 0->7 // new funciton to be created to compute the nb_slots = f(N_rep)
|
||||
nulsch_harq->new_data_indication = nfapi_parameters_rel13->new_data_indication; // valid only for DCI N0
|
||||
nulsch_harq->TBS = nfapi_parameters_rel13->size; /// check if needed *8 or /8 or nothing to do
|
||||
} else{ // other npusch data
|
||||
LOG_I(PHY,"UL data process at PHY\n");
|
||||
|
||||
nulsch = eNB->ulsch_NB_IoT[0];
|
||||
nulsch_harq = nulsch->harq_process;
|
||||
|
||||
nulsch->Msg3_active = 1;
|
||||
nulsch->Msg3_flag = 0;
|
||||
nulsch->flag_vars = 1;
|
||||
nulsch->rnti = nfapi_parameters_rel13->rnti;
|
||||
nulsch->npusch_format = nfapi_parameters_rel13->nulsch_format;
|
||||
nulsch->N_srs = nfapi_parameters_rel13->n_srs;
|
||||
nulsch->C_init = nfapi_parameters_rel13->scrambling_sequence_initialization_cinit;
|
||||
nulsch->SF_idx = nfapi_parameters_rel13->sf_idx;
|
||||
nulsch->HARQ_ACK_resource = nfapi_parameters_rel13->nb_harq_information.nb_harq_information_rel13_fdd.harq_ack_resource;
|
||||
|
||||
//nulsch_harq->subcarrier_spacing = nfapi_parameters_rel13->handle; // get from the UL_grant of MSG3
|
||||
nulsch_harq->subcarrier_indication = nfapi_parameters_rel13->subcarrier_indication; // Isc =0->18 , or 0->47 // format 2, 0->3 or 0->7
|
||||
nulsch_harq->resource_assignment = nfapi_parameters_rel13->resource_assignment; // valid for format 1 // this should be set by DCI N0 // not used for msg3 // I_RU --> helps to get N_RU
|
||||
nulsch_harq->mcs = nfapi_parameters_rel13->mcs; // I_mcs = 0->10 (single tone) and 0->12 (multi-tone)
|
||||
nulsch_harq->rvidx = nfapi_parameters_rel13->redudancy_version; // values = 0 or 1
|
||||
nulsch_harq->repetition_number = nfapi_parameters_rel13->repetition_number; // // N_rep values = 0->7 // new funciton to be created to compute the nb_slots = f(N_rep)
|
||||
nulsch_harq->new_data_indication = nfapi_parameters_rel13->new_data_indication; // valid only for DCI N0
|
||||
nulsch_harq->TBS = nfapi_parameters_rel13->size; /// check if needed *8 or /8 or nothing to do
|
||||
}
|
||||
//nulsch_harq->rep_tmp = ;
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
LOG_I(PHY,"subframe = %d (TX timing), IF module proceed UL config NULSCH data pdu, will trigger npusch in next subframe\n",subframe);
|
||||
}else
|
||||
{
|
||||
nulsch = eNB->ulsch_NB_IoT[0];
|
||||
nulsch_harq = nulsch->harq_process;
|
||||
|
||||
nulsch->Msg3_active = 1;
|
||||
nulsch->Msg3_flag = 0;
|
||||
nulsch->flag_vars = 1;
|
||||
nulsch->rnti = nfapi_parameters_rel13->rnti;
|
||||
nulsch->npusch_format = nfapi_parameters_rel13->nulsch_format;
|
||||
nulsch->N_srs = nfapi_parameters_rel13->n_srs;
|
||||
nulsch->C_init = nfapi_parameters_rel13->scrambling_sequence_initialization_cinit;
|
||||
nulsch->SF_idx = nfapi_parameters_rel13->sf_idx;
|
||||
nulsch->HARQ_ACK_resource = nfapi_parameters_rel13->nb_harq_information.nb_harq_information_rel13_fdd.harq_ack_resource;
|
||||
|
||||
//nulsch_harq->subcarrier_spacing = nfapi_parameters_rel13->handle; // get from the UL_grant of MSG3
|
||||
nulsch_harq->subcarrier_indication = nfapi_parameters_rel13->nb_harq_information.nb_harq_information_rel13_fdd.harq_ack_resource; // Isc =0->18 , or 0->47 // format 2, 0->3 or 0->7
|
||||
nulsch_harq->resource_assignment = nfapi_parameters_rel13->resource_assignment; // valid for format 1 // this should be set by DCI N0 // not used for msg3 // I_RU --> helps to get N_RU
|
||||
nulsch_harq->mcs = nfapi_parameters_rel13->mcs; // I_mcs = 0->10 (single tone) and 0->12 (multi-tone)
|
||||
nulsch_harq->rvidx = nfapi_parameters_rel13->redudancy_version; // values = 0 or 1
|
||||
nulsch_harq->repetition_number = nfapi_parameters_rel13->ue_information.ue_information_rel13.total_number_of_repetitions; // // N_rep values = 0->7 // new funciton to be created to compute the nb_slots = f(N_rep)
|
||||
nulsch_harq->new_data_indication = nfapi_parameters_rel13->new_data_indication; // valid only for DCI N0
|
||||
nulsch_harq->TBS = nfapi_parameters_rel13->size; /// check if needed *8 or /8 or nothing to do
|
||||
|
||||
|
||||
LOG_I(PHY,"subframe = %d (TX timing), IF module proceed UL config NULSCH ack pdu, will trigger npusch in next subframe\n",subframe);
|
||||
}
|
||||
break;
|
||||
case NFAPI_UL_CONFIG_NRACH_PDU_TYPE:
|
||||
//TODO just for update the nprach configuration (given at the beginning through phy_config_sib2)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//XXX problem: although we may have nothing to transmit this function should be always triggered in order to allow the PHY layer to complete the repetitions
|
||||
//of previous Transport Blocks
|
||||
|
||||
LOG_D(PHY,"Schedule response has been done\n");
|
||||
}
|
||||
|
||||
void PHY_config_req_NB_IoT(PHY_Config_NB_IoT_t* config_INFO){
|
||||
LOG_D(PHY,"[NB-IoT] PHY CONFIG REQ NB-IoT In\n");
|
||||
|
||||
|
||||
if(config_INFO->get_MIB != 0){
|
||||
|
||||
//MIB-NB configuration
|
||||
phy_config_mib_eNB_NB_IoT(config_INFO->mod_id,
|
||||
config_INFO->CC_id,
|
||||
config_INFO->cfg->nfapi_config.rf_bands.rf_band[0],//eutraband
|
||||
config_INFO->cfg->sch_config.physical_cell_id.value,
|
||||
config_INFO->cfg->subframe_config.dl_cyclic_prefix_type.value,
|
||||
config_INFO->cfg->subframe_config.ul_cyclic_prefix_type.value,
|
||||
config_INFO->cfg->rf_config.tx_antenna_ports.value,
|
||||
config_INFO->cfg->nfapi_config.earfcn.value,
|
||||
config_INFO->cfg->nb_iot_config.prb_index.value,
|
||||
config_INFO->cfg->nb_iot_config.operating_mode.value,
|
||||
config_INFO->cfg->nb_iot_config.control_region_size.value,
|
||||
config_INFO->cfg->nb_iot_config.assumed_crs_aps.value); //defined only in in-band different PCI
|
||||
|
||||
}
|
||||
|
||||
if(config_INFO->get_COMMON != 0)
|
||||
{
|
||||
//Common Configuration included in SIB2-NB
|
||||
phy_config_sib2_eNB_NB_IoT(config_INFO->mod_id,
|
||||
config_INFO->CC_id,
|
||||
&config_INFO->cfg->nb_iot_config, // FIXME to be evaluated is should be passed a pointer
|
||||
&config_INFO->cfg->rf_config,
|
||||
&config_INFO->cfg->uplink_reference_signal_config,
|
||||
&config_INFO->extra_phy_parms);
|
||||
}
|
||||
|
||||
///FOR FAPI is not specified
|
||||
if(config_INFO->get_DEDICATED!= 0)
|
||||
{
|
||||
//Dedicated Configuration
|
||||
|
||||
/*phy_config_dedicated_eNB_NB_IoT(config_INFO->mod_id,
|
||||
config_INFO->CC_id,
|
||||
config_INFO->rnti,
|
||||
&config_INFO->extra_phy_parms);*/
|
||||
|
||||
}
|
||||
|
||||
LOG_D(PHY,"IF Module for PHY Configuration has been done\n");
|
||||
}
|
||||
|
||||
21
openair1/SCHED/IF_Module_L1_primitives_NB_IoT.h
Normal file
21
openair1/SCHED/IF_Module_L1_primitives_NB_IoT.h
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef __IF_MODULE_L1_PRIMITIVES_NB_IOT_H__
|
||||
#define __IF_MODULE_L1_PRIMITIVES_NB_IOT_H__
|
||||
|
||||
#include "openair1/PHY/defs_NB_IoT.h"
|
||||
//#include "LAYER2/MAC/extern.h"
|
||||
//#include "LAYER2/MAC/proto_NB_IoT.h"
|
||||
//#include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h"
|
||||
|
||||
|
||||
void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
|
||||
eNB_rxtx_proc_t *proc,
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu,
|
||||
uint8_t *sdu);
|
||||
|
||||
#endif
|
||||
@@ -203,6 +203,11 @@ void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,re
|
||||
*/
|
||||
void prach_procedures(PHY_VARS_eNB *eNB);
|
||||
|
||||
|
||||
///////// NB_IoT testing ///////////////////////////
|
||||
void prach_procedures_NB_IoT(PHY_VARS_eNB *eNB);
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index.
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@param subframe Subframe index
|
||||
@@ -374,6 +379,7 @@ uint16_t get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1);
|
||||
|
||||
|
||||
int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
|
||||
|
||||
int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
|
||||
int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rnti);
|
||||
|
||||
@@ -521,6 +527,7 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf
|
||||
|
||||
void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
|
||||
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
||||
59
openair1/SCHED/defs_NB_IoT.h
Normal file
59
openair1/SCHED/defs_NB_IoT.h
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
|
||||
#ifndef __openair_SCHED_NB_IOT_H__
|
||||
#define __openair_SCHED_NB_IOT_H__
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
//#include "openair2/PHY_INTERFACE/IF_Module_nb_iot.h"
|
||||
#include "openair2/PHY_INTERFACE/nfapi_interface.h"
|
||||
|
||||
|
||||
|
||||
enum openair_HARQ_TYPE_NB_IoT {
|
||||
openair_harq_DL_NB_IoT = 0,
|
||||
openair_harq_UL_NB_IoT,
|
||||
openair_harq_RA_NB_IoT
|
||||
};
|
||||
|
||||
|
||||
void process_schedule_rsp_NB_IoT(Sched_Rsp_NB_IoT_t *sched_rsp,
|
||||
PHY_VARS_eNB_NB_IoT *eNB,
|
||||
eNB_rxtx_proc_t *proc);
|
||||
|
||||
/*Processing the ue-specific resources for uplink in NB-IoT*/
|
||||
void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc); // UL_IND_NB_IoT_t *UL_INFO);
|
||||
|
||||
/* For NB-IoT, we put NPBCH in later part, since it would be scheduled by MAC scheduler,this generates all the Downlink message*/
|
||||
void NB_IoT_TX_procedure(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
|
||||
|
||||
/*Generate the ulsch params and do the mapping for the FAPI style parameters to OAI, and then do the packing*/
|
||||
void generate_eNB_ulsch_params_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu);
|
||||
|
||||
/*Generate the dlsch params and do the mapping for the FAPI style parameters to OAI, and then do the packing*/
|
||||
void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,nfapi_dl_config_request_pdu_t *dl_config_pdu);
|
||||
|
||||
int8_t find_ue_NB_IoT(uint16_t rnti, PHY_VARS_eNB *eNB);
|
||||
|
||||
NB_IoT_DL_FRAME_PARMS *get_NB_IoT_frame_parms(module_id_t Mod_id, uint8_t CC_id);
|
||||
|
||||
int16_t get_hundred_times_delta_IF_eNB_NB_IoT(PHY_VARS_eNB_NB_IoT *phy_vars_eNB,uint8_t UE_id,uint8_t harq_pid, uint8_t bw_factor);
|
||||
|
||||
uint32_t is_SIB1_NB_IoT(const frame_t frameP,
|
||||
long schedulingInfoSIB1, //from the mib
|
||||
int physCellId, //by configuration
|
||||
NB_IoT_eNB_NDLSCH_t *ndlsch_SIB1
|
||||
);
|
||||
|
||||
uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB,int frame, uint8_t subframe, uint16_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance);
|
||||
|
||||
void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
|
||||
|
||||
////////////////// NB-IoT testing ////////////////////
|
||||
void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control, uint8_t decode_flag);
|
||||
|
||||
void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t decode_flag);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
#include <asm/page.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef RTAI_ENABLED
|
||||
#include <rtai.h>
|
||||
//#include <rtai_posix.h>
|
||||
@@ -78,4 +76,5 @@ extern fifo_dump_emos_eNB emos_dump_eNB;
|
||||
#endif
|
||||
*/
|
||||
|
||||
|
||||
#endif /*__SCHED_EXTERN_H__ */
|
||||
|
||||
69
openair1/SCHED/extern_NB_IoT.h
Normal file
69
openair1/SCHED/extern_NB_IoT.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*!\brief SCHED external variables */
|
||||
|
||||
#ifndef __SCHED_EXTERN_NB_IOT_H__
|
||||
#define __SCHED_EXTERN_NB_IOT_H__
|
||||
|
||||
#ifndef USER_MODE
|
||||
#define __NO_VERSION__
|
||||
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/bitops.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/segment.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
|
||||
#ifdef RTAI_ENABLED
|
||||
#include <rtai.h>
|
||||
//#include <rtai_posix.h>
|
||||
#include <rtai_fifos.h>
|
||||
#include <rtai_sched.h>
|
||||
#include <rtai_sem.h>
|
||||
//#include "rt_compat.h"
|
||||
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#endif /* USER_MODE */
|
||||
|
||||
|
||||
|
||||
|
||||
#include "defs_NB_IoT.h"
|
||||
|
||||
|
||||
|
||||
extern uint16_t hundred_times_log10_NPRB_NB_IoT[100];
|
||||
|
||||
|
||||
#endif /*__SCHED_EXTERN_H__ */
|
||||
@@ -1086,6 +1086,7 @@ LTE_eNB_UE_stats* get_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti)
|
||||
|
||||
int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *eNB)
|
||||
{
|
||||
|
||||
uint8_t i;
|
||||
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
@@ -1110,6 +1111,7 @@ int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *eNB)
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
LTE_DL_FRAME_PARMS* get_lte_frame_parms(module_id_t Mod_id, uint8_t CC_id)
|
||||
{
|
||||
|
||||
|
||||
1282
openair1/SCHED/phy_procedures_lte_common_NB_IoT.c
Normal file
1282
openair1/SCHED/phy_procedures_lte_common_NB_IoT.c
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
772
openair1/SCHED/phy_procedures_lte_eNb_NB_IoT.c
Normal file
772
openair1/SCHED/phy_procedures_lte_eNb_NB_IoT.c
Normal file
@@ -0,0 +1,772 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file phy_procedures_lte_eNB.c
|
||||
* \brief Implementation of eNB procedures from 36.213 LTE specifications
|
||||
* \author R. Knopp, F. Kaltenberger, N. Nikaein, X. Foukas, Michele Paffetti, Nick Ho
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr,navid.nikaein@eurecom.fr, x.foukas@sms.ed.ac.uk, michele.paffetti@studio.unibo.it, nick133371@gmail.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "PHY/LTE_ESTIMATION/defs_NB_IoT.h"
|
||||
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
|
||||
#include "PHY/LTE_TRANSPORT/proto_NB_IoT.h"
|
||||
//#include "PHY/extern_NB_IoT.h" //where we get the global Sched_Rsp_t structure filled
|
||||
//#include "SCHED/defs.h"
|
||||
#include "SCHED/extern_NB_IoT.h"
|
||||
//#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
//#include "PHY/LTE_TRANSPORT/if5_tools.h"
|
||||
#include "RRC/LITE/proto_NB_IoT.h"
|
||||
#include "SIMULATION/TOOLS/defs.h" // purpose: included for taus() function
|
||||
//#ifdef EMOS
|
||||
//#include "SCHED/phy_procedures_emos.h"
|
||||
//#endif
|
||||
|
||||
// for NB-IoT
|
||||
#include "SCHED/defs_NB_IoT.h"
|
||||
#include "openair2/RRC/LITE/proto_NB_IoT.h"
|
||||
#include "openair2/RRC/LITE/extern_NB_IoT.h"
|
||||
#include "RRC/LITE/MESSAGES/asn1_msg_NB_IoT.h"
|
||||
//#define DEBUG_PHY_PROC (Already defined in cmake)
|
||||
//#define DEBUG_ULSCH
|
||||
|
||||
//#include "LAYER2/MAC/extern.h"
|
||||
//#include "LAYER2/MAC/defs.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
#include "assertions.h"
|
||||
#include "msc.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
#if defined(FLEXRAN_AGENT_SB_IF)
|
||||
//Agent-related headers
|
||||
#include "ENB_APP/flexran_agent_extern.h"
|
||||
#include "ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.h"
|
||||
#include "LAYER2/MAC/flexran_agent_mac_proto.h"
|
||||
#endif
|
||||
*/
|
||||
|
||||
//#define DIAG_PHY
|
||||
|
||||
///#define NS_PER_SLOT 500000
|
||||
|
||||
///#define PUCCH 1
|
||||
|
||||
//DCI_ALLOC_t dci_alloc[8];
|
||||
|
||||
///#ifdef EMOS
|
||||
///fifo_dump_emos_eNB emos_dump_eNB;
|
||||
///#endif
|
||||
|
||||
int npdsch_rep_to_array[3] = {4,8,16}; //TS 36.213 Table 16.4.1.3-3
|
||||
int sib1_startFrame_to_array[4] = {0,16,32,48};//TS 36.213 Table 16.4.1.3-4
|
||||
|
||||
//New----------------------------------------------------
|
||||
//return -1 whenever no SIB1-NB transmission occur.
|
||||
//return sib1_startFrame when transmission occur in the current frame
|
||||
uint32_t is_SIB1_NB_IoT(const frame_t frameP,
|
||||
long schedulingInfoSIB1, //from the mib
|
||||
int physCellId, //by configuration
|
||||
NB_IoT_eNB_NDLSCH_t *ndlsch_SIB1
|
||||
)
|
||||
{
|
||||
uint8_t nb_rep=0; // number of sib1-nb repetitions within the 256 radio frames
|
||||
uint32_t sib1_startFrame;
|
||||
uint32_t sib1_period_NB_IoT = 256;//from specs TS 36.331 (rf)
|
||||
uint8_t index;
|
||||
int offset;
|
||||
int period_nb; // the number of the actual period over the 1024 frames
|
||||
|
||||
if(schedulingInfoSIB1 > 11 || schedulingInfoSIB1 < 0){
|
||||
LOG_E(RRC, "is_SIB1_NB_IoT: schedulingInfoSIB1 value not allowed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//SIB1-NB period number
|
||||
period_nb = (int) frameP/sib1_period_NB_IoT;
|
||||
|
||||
|
||||
//number of repetitions
|
||||
nb_rep = npdsch_rep_to_array[schedulingInfoSIB1%3];
|
||||
|
||||
//based on number of rep. and the physical cell id we derive the starting radio frame (TS 36.213 Table 16.4.1.3-3/4)
|
||||
switch(nb_rep)
|
||||
{
|
||||
case 4:
|
||||
//physCellId%4 possible value are 0,1,2,3
|
||||
sib1_startFrame = sib1_startFrame_to_array[physCellId%4];
|
||||
break;
|
||||
case 8:
|
||||
//physCellId%2possible value are 0,1
|
||||
sib1_startFrame = sib1_startFrame_to_array[physCellId%2];
|
||||
break;
|
||||
case 16:
|
||||
//physCellId%2 possible value are 0,1
|
||||
if(physCellId%2 == 0)
|
||||
sib1_startFrame = 0;
|
||||
else
|
||||
sib1_startFrame = 1; // the only case in which the starting frame is odd
|
||||
break;
|
||||
default:
|
||||
LOG_E(RRC, "Number of repetitions %d not allowed", nb_rep);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//check the actual frame w.r.t SIB1-NB starting frame
|
||||
if(frameP < sib1_startFrame + period_nb*256){
|
||||
LOG_T(RRC, "the actual frame %d is before the SIB1-NB starting frame %d of the period--> bcch_sdu_legnth = 0", frameP, sib1_startFrame + period_nb*256);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//calculate offset between SIB1-NB repetitions (repetitions are equally spaced)
|
||||
offset = (sib1_period_NB_IoT-(16*nb_rep))/nb_rep;
|
||||
|
||||
//loop over the SIB1-NB period
|
||||
for( int i = 0; i < nb_rep; i++)
|
||||
{
|
||||
//find the correct sib1-nb repetition interval in which the actual frame is
|
||||
|
||||
//this is the start frame of a repetition
|
||||
index = sib1_startFrame+ i*(16+offset) + period_nb*256;
|
||||
|
||||
//the actual frame is in a gap between two consecutive repetitions
|
||||
if(frameP < index)
|
||||
{
|
||||
ndlsch_SIB1->sib1_rep_start = 0;
|
||||
ndlsch_SIB1->relative_sib1_frame = 0;
|
||||
return -1;
|
||||
}
|
||||
//this is needed for ndlsch_procedure
|
||||
else if(frameP == index)
|
||||
{
|
||||
//the actual frame is the start of a new repetition (SIB1-NB should be retransmitted)
|
||||
ndlsch_SIB1->sib1_rep_start = 1;
|
||||
ndlsch_SIB1->relative_sib1_frame = 1;
|
||||
return sib1_startFrame;
|
||||
}
|
||||
else
|
||||
ndlsch_SIB1->sib1_rep_start = 0;
|
||||
|
||||
//check in the current SIB1_NB repetition
|
||||
if(frameP>= index && frameP <= (index+15))
|
||||
{
|
||||
//find if the actual frame is one of the "every other frame in 16 continuous frame" in which SIB1-NB is transmitted
|
||||
|
||||
for(int y = 0; y < 16; y += 2) //every other frame (increment by 2)
|
||||
{
|
||||
if(frameP == index + y)
|
||||
{
|
||||
//this flag tell which is the number of the current frame w.r.t the 8th (over the continuous 16) in a repetition
|
||||
ndlsch_SIB1->relative_sib1_frame = y/2 + 1; //1st, 2nd, 3rd,...
|
||||
return sib1_startFrame;
|
||||
}
|
||||
}
|
||||
|
||||
//if we are here means that the frame was inside the repetition interval but not considered for SIB1-NB transmission
|
||||
ndlsch_SIB1->relative_sib1_frame = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* For NB-IoT, we put NPBCH in later part, since it would be scheduled by MAC scheduler
|
||||
* It generates all the downlink message : NPBCH, NSSS, NPSS, NRS, NPDCCH and NPDSCH
|
||||
*
|
||||
*/
|
||||
void NB_IoT_TX_procedure(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
{
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
NB_IoT_eNB_NPBCH_t *broadcast_str = &eNB->npbch;
|
||||
NB_IoT_eNB_NDLSCH_t *sib1 = eNB->ndlsch_SIB1;
|
||||
NB_IoT_eNB_NDLSCH_t *sib23 = eNB->ndlsch_SIB23;
|
||||
|
||||
uint8_t *npbch_pdu = broadcast_str->pdu;
|
||||
|
||||
int **txdataF = eNB->common_vars.txdataF[0];
|
||||
uint32_t subframe = proc->subframe_tx;
|
||||
uint32_t frame = proc->frame_tx;
|
||||
//uint16_t Ntti = 10; //ntti = 10
|
||||
int RB_IoT_ID=22; // XXX should be initialized (RB reserved for NB-IoT, PRB index)
|
||||
int With_NSSS=0; // With_NSSS = 1; if the frame include a sub-Frame with NSSS signal
|
||||
uint8_t release_v13_5_0 = 0;
|
||||
|
||||
uint32_t hyper_frame=proc->HFN;
|
||||
|
||||
fp->flag_free_sf =0;
|
||||
|
||||
//NSSS only happened in the even frame
|
||||
int nsss_state = 0;
|
||||
|
||||
if(frame%2==0)
|
||||
{
|
||||
With_NSSS = 1;
|
||||
} else {
|
||||
With_NSSS = 0;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////// NPSS && NSSS //////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
if(subframe == 5)
|
||||
{
|
||||
|
||||
generate_npss_NB_IoT(txdataF,
|
||||
AMP,
|
||||
fp,
|
||||
3,
|
||||
10,
|
||||
RB_IoT_ID);
|
||||
}
|
||||
else if((subframe == 9) && (With_NSSS == 1))
|
||||
{
|
||||
|
||||
generate_sss_NB_IoT(txdataF,
|
||||
AMP,
|
||||
fp,
|
||||
3,
|
||||
18,
|
||||
frame,
|
||||
RB_IoT_ID);
|
||||
nsss_state = 1;
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////// MIB //////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if(subframe == 0)
|
||||
{
|
||||
generate_npbch(broadcast_str,
|
||||
txdataF,
|
||||
AMP,
|
||||
fp,
|
||||
npbch_pdu,
|
||||
frame%64,
|
||||
RB_IoT_ID,
|
||||
release_v13_5_0);
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////// SIB1 ////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
int sib1_state = 0;
|
||||
if(subframe == 4)
|
||||
{
|
||||
sib1_state = generate_SIB1(sib1,
|
||||
txdataF,
|
||||
AMP,
|
||||
fp,
|
||||
frame,
|
||||
subframe,
|
||||
RB_IoT_ID,
|
||||
0,
|
||||
release_v13_5_0);
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////// SIB23 ////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
if( (subframe != 0) && (subframe != 5) && (sib1_state != 1) && (nsss_state != 1))
|
||||
{
|
||||
generate_SIB23(sib23,
|
||||
txdataF,
|
||||
AMP,
|
||||
fp,
|
||||
frame,
|
||||
subframe,
|
||||
RB_IoT_ID,
|
||||
release_v13_5_0);
|
||||
}
|
||||
|
||||
if( (subframe != 0) && (subframe != 5) && (nsss_state != 1) && (fp->flag_free_sf == 0) )
|
||||
{
|
||||
NB_IoT_eNB_NPDCCH_t *npdcch_str = eNB->npdcch_DCI;
|
||||
NB_IoT_eNB_NDLSCH_t *RAR = eNB->ndlsch_RAR;
|
||||
NB_IoT_eNB_NDLSCH_t *data = eNB->ndlsch[0];
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////// NPDCCH ////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
generate_NPDCCH_NB_IoT(npdcch_str,
|
||||
txdataF,
|
||||
AMP,
|
||||
fp,
|
||||
frame,
|
||||
subframe,
|
||||
RB_IoT_ID);
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////// NPDSCH ////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
if(eNB->ndlsch_RAR != NULL && RAR->active_msg2 == 1)
|
||||
{
|
||||
generate_NDLSCH_NB_IoT(eNB,
|
||||
RAR,
|
||||
txdataF,
|
||||
AMP,
|
||||
fp,
|
||||
frame,
|
||||
subframe,
|
||||
RB_IoT_ID,
|
||||
release_v13_5_0);
|
||||
|
||||
} else if(eNB->ndlsch[0] != NULL) {
|
||||
//printf("Going to generate_NDLSCH_NB_IoT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
|
||||
generate_NDLSCH_NB_IoT(eNB,
|
||||
data,
|
||||
txdataF,
|
||||
AMP,
|
||||
fp,
|
||||
frame,
|
||||
subframe,
|
||||
RB_IoT_ID,
|
||||
release_v13_5_0);
|
||||
//printf("Finish doing generate_NDLSCH_NB_IoT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
generate_pilots_NB_IoT(eNB,
|
||||
txdataF,
|
||||
AMP,
|
||||
subframe,
|
||||
RB_IoT_ID,
|
||||
With_NSSS);
|
||||
|
||||
if(proc->frame_rx==1023 && proc->subframe_rx==9)
|
||||
{
|
||||
LOG_D(PHY,"Hyper_frame is %d",hyper_frame);
|
||||
if(proc->HFN==1023)
|
||||
{
|
||||
proc->HFN=0;
|
||||
}else{
|
||||
proc->HFN++;
|
||||
LOG_D(PHY,"Update HFN:%d when frame:%d subframe:%d\n",proc->HFN,proc->frame_rx,proc->subframe_rx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) //UL_IND_NB_IoT_t *UL_INFO)
|
||||
{
|
||||
//RX processing for ue-specific resources (i
|
||||
npusch_procedures(eNB,proc);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/////Generate eNB ndlsch params for NB-IoT from the NPDCCH PDU of the DCI, modify the input to the Sched Rsp variable////
|
||||
void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,nfapi_dl_config_request_pdu_t *dl_config_pdu)
|
||||
{
|
||||
int UE_id = -1;
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
int frame = proc->frame_tx;
|
||||
int subframe = proc->subframe_tx;
|
||||
DCI_CONTENT *DCI_Content;
|
||||
DCI_format_NB_IoT_t DCI_format;
|
||||
NB_IoT_eNB_NDLSCH_t *ndlsch;
|
||||
NB_IoT_eNB_NPDCCH_t *npdcch;
|
||||
|
||||
eNB->DCI_pdu = (DCI_PDU_NB_IoT*)malloc(sizeof(DCI_PDU_NB_IoT));
|
||||
|
||||
DCI_Content = (DCI_CONTENT*) malloc(sizeof(DCI_CONTENT));
|
||||
|
||||
// check DCI format is N1 (format 0)
|
||||
if(dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.dci_format == 0)
|
||||
{
|
||||
//check DCI format N1 is for RAR rnti_type in FAPI specs table 4-45
|
||||
if(dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti_type == 1)
|
||||
{
|
||||
|
||||
//mapping the fapi parameters to the oai parameters
|
||||
|
||||
DCI_format = DCIFormatN1_RAR;
|
||||
|
||||
//DCI format N1 to RAR
|
||||
DCI_Content->DCIN1_RAR.type = 1;
|
||||
DCI_Content->DCIN1_RAR.orderIndicator = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.npdcch_order_indication;
|
||||
DCI_Content->DCIN1_RAR.Scheddly = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.scheduling_delay;
|
||||
DCI_Content->DCIN1_RAR.ResAssign = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.resource_assignment;
|
||||
DCI_Content->DCIN1_RAR.mcs = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.mcs;
|
||||
DCI_Content->DCIN1_RAR.RepNum = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.repetition_number;
|
||||
DCI_Content->DCIN1_RAR.ndi = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.new_data_indicator;
|
||||
DCI_Content->DCIN1_RAR.HARQackRes = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource;
|
||||
DCI_Content->DCIN1_RAR.DCIRep = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number;
|
||||
|
||||
|
||||
//TODO calculate the number of common repetitions
|
||||
//fp->nprach_config_common.number_repetition_RA = see TS 36.213 Table 16.1-3
|
||||
|
||||
// fill the dlsch_ra_NB structure for RAR, and packed the DCI PDU
|
||||
|
||||
ndlsch = eNB->ndlsch_RAR;
|
||||
ndlsch->ndlsch_type = RAR;
|
||||
|
||||
ndlsch->rnti = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti;
|
||||
|
||||
npdcch = eNB->npdcch_DCI;
|
||||
|
||||
LOG_I(PHY,"Generating pdcch params for DCIN1 RAR and packing DCI\n");
|
||||
//LOG_I(PHY,"Rep of DCI is : %d\n",DCI_Content->DCIN1_RAR.RepNum);
|
||||
|
||||
//LOG_I(PHY,"Generating dlsch params for RA_RNTI and packing DCI\n");
|
||||
generate_eNB_dlsch_params_from_dci_NB_IoT(eNB,
|
||||
frame,
|
||||
subframe,
|
||||
DCI_Content,
|
||||
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti,
|
||||
DCI_format,
|
||||
npdcch,
|
||||
fp,
|
||||
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.aggregation_level,
|
||||
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.start_symbol,
|
||||
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.ncce_index);
|
||||
|
||||
//printf("PHY_vars_eNB_g[0][0]->ndlsch_RAR->rnti = %d\n",PHY_vars_eNB_g[0][0]->ndlsch_RAR->rnti);
|
||||
//eNB->dlsch_ra_NB->nCCE[subframe] = eNB->DCI_pdu->dci_alloc.firstCCE;
|
||||
}
|
||||
else
|
||||
{ //managing data
|
||||
LOG_I(PHY,"Handling the DCI for ue-spec data or MSG4!\n");
|
||||
// Temp: Add UE id when Msg4 trigger
|
||||
eNB->ndlsch[0]= (NB_IoT_eNB_NDLSCH_t*) malloc(sizeof(NB_IoT_eNB_NDLSCH_t));
|
||||
eNB->ndlsch[0]->harq_process = (NB_IoT_DL_eNB_HARQ_t*)malloc(sizeof(NB_IoT_DL_eNB_HARQ_t));
|
||||
eNB->ndlsch[0]->rnti=dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti;
|
||||
//TODO target/SIMU/USER?init_lte/init_lte_eNB we should allocate the ndlsch structures
|
||||
UE_id = find_ue_NB_IoT(dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti, eNB);
|
||||
AssertFatal(UE_id != -1, "no ndlsch context available or no ndlsch context corresponding to that rnti\n");
|
||||
|
||||
|
||||
//mapping the fapi parameters to the oai parameters
|
||||
|
||||
DCI_format = DCIFormatN1;
|
||||
|
||||
//DCI format N1 to DLSCH
|
||||
DCI_Content->DCIN1.type = 1;
|
||||
DCI_Content->DCIN1.orderIndicator = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.npdcch_order_indication;
|
||||
DCI_Content->DCIN1.Scheddly = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.scheduling_delay;
|
||||
DCI_Content->DCIN1.ResAssign = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.resource_assignment;
|
||||
DCI_Content->DCIN1.mcs = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.mcs;
|
||||
DCI_Content->DCIN1.RepNum = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.repetition_number;
|
||||
DCI_Content->DCIN1.ndi = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.new_data_indicator;
|
||||
DCI_Content->DCIN1.HARQackRes = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource;
|
||||
DCI_Content->DCIN1.DCIRep = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number;
|
||||
npdcch = eNB->npdcch_DCI;
|
||||
|
||||
//eNB->npdcch[(uint8_t)UE_id] = (NB_IoT_eNB_NPDCCH_t *) malloc(sizeof(NB_IoT_eNB_NPDCCH_t));
|
||||
//set the NPDCCH UE-specific structure (calculate R)
|
||||
//npdcch=eNB->npdcch[(uint8_t)UE_id];
|
||||
//AssertFatal(npdcch != NULL, "NPDCCH structure for UE specific is not exist\n");
|
||||
//npdcch->repetition_idx[(uint8_t)UE_id] = 0; //this is used for the encoding mechanism to understand that is the first transmission
|
||||
|
||||
//if(dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.aggregation_level) //whenever aggregation level is =1 we have only 1 repetition for USS
|
||||
// npdcch->repetition_number[(uint8_t)UE_id] = 1;
|
||||
//else
|
||||
//{
|
||||
//see TS 36.213 Table 16.1-1
|
||||
//}
|
||||
|
||||
|
||||
//fill the ndlsch structure for UE and packed the DCI PD
|
||||
|
||||
ndlsch = eNB->ndlsch[(uint8_t)UE_id]; //in the old implementation they also consider UE_id = 1;
|
||||
ndlsch->ndlsch_type = UE_Data;
|
||||
|
||||
//parameters we don't consider pdsch config dedicated since not calling the phy config dedicated step2
|
||||
|
||||
LOG_I(PHY,"Generating dlsch params for DCIN1 data and packing DCI, res: %d\n",DCI_Content->DCIN1.ResAssign);
|
||||
generate_eNB_dlsch_params_from_dci_NB_IoT(eNB,
|
||||
frame,
|
||||
subframe,
|
||||
DCI_Content,
|
||||
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti,
|
||||
DCI_format,
|
||||
npdcch,
|
||||
fp,
|
||||
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.aggregation_level,
|
||||
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.start_symbol,
|
||||
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.ncce_index);
|
||||
|
||||
//eNB->ndlsch[(uint8_t)UE_id]->nCCE[subframe] = eNB->DCI_pdu->dci_alloc[i].firstCCE;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if(dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.dci_format == 1)
|
||||
{
|
||||
DCI_format = DCIFormatN2;
|
||||
LOG_D(PHY,"Paging procedure not implemented\n");
|
||||
}
|
||||
else
|
||||
LOG_E(PHY,"unknown DCI format for NB-IoT DL\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void generate_eNB_ulsch_params_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu) {
|
||||
|
||||
//int UE_id = -1;
|
||||
//int harq_pid = 0;
|
||||
int frame = proc->frame_tx;
|
||||
int subframe = proc->subframe_tx;
|
||||
DCI_CONTENT *DCI_Content;
|
||||
DCI_Content = (DCI_CONTENT*) malloc(sizeof(DCI_CONTENT));
|
||||
NB_IoT_eNB_NPDCCH_t *npdcch;
|
||||
|
||||
//mapping the fapi parameters to the OAI parameters
|
||||
DCI_Content->DCIN0.type = 0;
|
||||
DCI_Content->DCIN0.scind = hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.subcarrier_indication;
|
||||
DCI_Content->DCIN0.ResAssign = hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.resource_assignment;
|
||||
DCI_Content->DCIN0.mcs = hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.mcs;
|
||||
DCI_Content->DCIN0.ndi = hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.new_data_indicator;
|
||||
DCI_Content->DCIN0.Scheddly = hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.scheduling_delay;
|
||||
DCI_Content->DCIN0.RepNum = hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.repetition_number;
|
||||
DCI_Content->DCIN0.rv = hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.redudancy_version;
|
||||
DCI_Content->DCIN0.DCIRep = hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.dci_subframe_repetition_number;
|
||||
|
||||
npdcch = eNB->npdcch_DCI;
|
||||
|
||||
/*Log for generate ULSCH DCI*/
|
||||
LOG_I(PHY,"packing DCI N0\n");
|
||||
|
||||
LOG_I(PHY,"Dump DCI N0 : scind: %d, ResAssign: %d, mcs: %d, ndi: %d, Scheddly: %d, RepNum: %d, rv: %d, DCIRep: %d\n",DCI_Content->DCIN0.scind,DCI_Content->DCIN0.ResAssign,DCI_Content->DCIN0.mcs,DCI_Content->DCIN0.ndi,DCI_Content->DCIN0.Scheddly,DCI_Content->DCIN0.RepNum,DCI_Content->DCIN0.rv,DCI_Content->DCIN0.DCIRep);
|
||||
|
||||
generate_eNB_ulsch_params_from_dci_NB_IoT(eNB,
|
||||
frame,
|
||||
subframe,
|
||||
DCI_Content,
|
||||
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.rnti,
|
||||
npdcch,
|
||||
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.aggregation_level,
|
||||
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.start_symbol,
|
||||
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.ncce_index
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern int oai_exit;
|
||||
|
||||
/*
|
||||
* ASSUMPTION
|
||||
*
|
||||
* The MAC schedule the schedule_response in a SUBFRAME BASE (at least because otherwise we have problem with our assumptions on SI transmission)
|
||||
*
|
||||
*Since in FAPI specs seems to not manage the information for the sceduling of system information:
|
||||
* Assume that the MAC layer manage the scheduling for the System information (SI messages) transmission while MIB and SIB1 are done directly at PHY layer
|
||||
* This means that the MAC scheduler will send to the PHY the NDLSCH PDU and MIB PDU (DL_CONFIG.request)each time they should be transmitted. In particular:
|
||||
***MIB-NB
|
||||
*schedule_response containing a n-BCH PDU is transmitted only at the beginning of the MIB period, then repetitions are made directly by the PHY layer (see FAPI specs pag 94 N-BCH 3.2.4.2)
|
||||
*if no new N-BCH PDU is trasmitted at SFN mod 64=0 then stop MIB transmission
|
||||
***SIB1-NB
|
||||
*schedule response containing a NDLSCH pdu (with appropiate configuration) will be transmitted only at the beginning of each SIB1-NB period (256 rf)
|
||||
*then repetitions are managed directly by the PHY layer
|
||||
*if no new NDLSCH pdu (configured for SIB1-NB) at SFN mod 256 = 0 is transmitted. stop SIB1-NB transmission
|
||||
****SI Messages
|
||||
* -schedule_response is transmitted by the MAC in every subframe needed for the SI transmission (NDLSCH should have a proper configuration)
|
||||
* -if the schedule_response carry any SDU for SI-Message (SDU!= NULL)--> put the SDU in the PHY buffer to be encoded ecc... and start the transmission
|
||||
* -if the schedule_response not carry any SDU (SDU == NULL) but NDLSCH is properly set for SI, then PHY continue transmit the remaining part of the previous SDU
|
||||
* (this because the PHY layer have no logic of repetition_pattern, si_window ecc.. so should be continuously instructed the PHY when to transmit.
|
||||
*
|
||||
* Furthermore, SI messages are transmitted in more that 1 subframe (2 or 8) and therefore MAC layer need to count how many subframes are available in the current frame for transmit it
|
||||
* and take in consideration that other frames are needed before starting the transmission of a new one)
|
||||
*
|
||||
*
|
||||
*We assume that whenever the NDLSCH pdu is a BCCH type, we consider as if it's a SIB1 while in other case can be data or SI-message depending on the RNTI
|
||||
*
|
||||
* **relevant aspects for the System information Transmission (Table 4-47 NDLSCH FAPi specs)
|
||||
* 1)RNTI type = 0 (contains a BCCH)
|
||||
* 2)Repetition number == scheduling info SIB1 mapped into 4-8-16
|
||||
* 3)RNTI (0xFFFF = SI-RNTI)
|
||||
* (see schedule_response implementation)
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint16_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance) {
|
||||
|
||||
uint32_t estimated_TA;
|
||||
//int frame,frame_mod; // subframe,
|
||||
// subframe = eNB->proc.subframe_prach;
|
||||
// frame = eNB->proc.frame_prach;
|
||||
estimated_TA = process_nprach_NB_IoT(eNB,frame,subframe,rnti,preamble_index,timing_advance);
|
||||
//printf("estim = %i\n",estimated_TA);
|
||||
// }
|
||||
return estimated_TA;
|
||||
}
|
||||
|
||||
|
||||
void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t decode_flag) {
|
||||
|
||||
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
|
||||
|
||||
nfapi_crc_indication_pdu_t *pdu = &eNB->UL_INFO.crc_ind.crc_pdu_list[0]; //[eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
|
||||
pdu->rx_ue_information.rnti = eNB->ulsch_NB_IoT[0]->rnti; /// OK
|
||||
pdu->crc_indication_rel8.crc_flag = decode_flag;
|
||||
|
||||
if(decode_flag == 1)
|
||||
{
|
||||
eNB->UL_INFO.crc_ind.number_of_crcs++;
|
||||
} else {
|
||||
eNB->UL_INFO.crc_ind.number_of_crcs =0;
|
||||
}
|
||||
|
||||
// nfapi_crc_indication_pdu_t* crc_pdu_list
|
||||
///eNB->UL_INFO.crc_ind.sfn_sf = frame<<4 | subframe;
|
||||
//eNB->UL_INFO.crc_ind.header.message_id = NFAPI_CRC_INDICATION;
|
||||
//eNB->UL_INFO.crc_ind.crc_indication_body.tl.tag = NFAPI_CRC_INDICATION_BODY_TAG;
|
||||
|
||||
//pdu->instance_length = 0; // don't know what to do with this
|
||||
// pdu->rx_ue_information.handle = handle;
|
||||
///////////////////////pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
//////////////////////////pdu->crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
|
||||
|
||||
|
||||
//LOG_D(PHY, "%s() rnti:%04x crcs:%d crc_flag:%d\n", __FUNCTION__, pdu->rx_ue_information.rnti, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, crc_flag);
|
||||
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
}
|
||||
|
||||
void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control, uint8_t decode_flag)
|
||||
{
|
||||
nfapi_rx_indication_pdu_t *pdu;
|
||||
nfapi_nb_harq_indication_pdu_t *ack_ind; // &eNB->UL_INFO.nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list[0] // nb_harq_indication_fdd_rel13->harq_tb1
|
||||
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
|
||||
if (data_or_control == 0) // format 1
|
||||
{
|
||||
|
||||
if(decode_flag == 1)
|
||||
{
|
||||
eNB->UL_INFO.RX_NPUSCH.number_of_pdus = 1;
|
||||
} else {
|
||||
eNB->UL_INFO.RX_NPUSCH.number_of_pdus = 0;
|
||||
}
|
||||
|
||||
pdu = &eNB->UL_INFO.RX_NPUSCH.rx_pdu_list[0];
|
||||
pdu->rx_ue_information.rnti = eNB->ulsch_NB_IoT[0]->rnti;
|
||||
pdu->rx_indication_rel8.length = eNB->ulsch_NB_IoT[0]->harq_process->TBS; //eNB->ulsch_NB_IoT[0]->harq_process->TBS>>3;
|
||||
pdu->data = eNB->ulsch_NB_IoT[0]->harq_process->b;
|
||||
|
||||
} else { // format 2
|
||||
|
||||
if(decode_flag == 1)
|
||||
{
|
||||
eNB->UL_INFO.nb_harq_ind.nb_harq_indication_body.number_of_harqs =1;
|
||||
ack_ind = &eNB->UL_INFO.nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list[0];
|
||||
ack_ind->nb_harq_indication_fdd_rel13.harq_tb1 = 1;
|
||||
ack_ind->rx_ue_information.rnti = eNB->ulsch_NB_IoT[0]->rnti;
|
||||
|
||||
} else {
|
||||
eNB->UL_INFO.nb_harq_ind.nb_harq_indication_body.number_of_harqs =1;
|
||||
ack_ind = &eNB->UL_INFO.nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list[0];
|
||||
ack_ind->nb_harq_indication_fdd_rel13.harq_tb1 = 2;
|
||||
ack_ind->rx_ue_information.rnti = eNB->ulsch_NB_IoT[0]->rnti;
|
||||
}
|
||||
}
|
||||
|
||||
//eNB->UL_INFO.RX_NPUSCH.rx_pdu_list.rx_ue_information.tl.tag = NFAPI_RX_INDICATION_BODY_TAG; // do we need this ??
|
||||
//eNB->UL_INFO.RX_NPUSCH.rx_pdu_list.rx_ue_information.rnti = rnti; // rnti should be got from eNB structure
|
||||
//pdu = &eNB->UL_INFO.RX_NPUSCH.rx_pdu_list[eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
|
||||
// pdu->rx_ue_information.handle = eNB->ulsch[UE_id]->handle;
|
||||
// pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
//pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
|
||||
|
||||
|
||||
|
||||
/*if(msg3_flag == 1)
|
||||
{
|
||||
pdu->rx_indication_rel8.length = 6; //eNB->ulsch_NB_IoT[0]->harq_process->TBS>>3;
|
||||
int m =0;
|
||||
for(m=0; m<6;m++)
|
||||
{
|
||||
pdu->data[m] = eNB->ulsch_NB_IoT[0]->harq_process->b[2+m];
|
||||
printf(" pdu content = %d \n", eNB->ulsch_NB_IoT[0]->harq_process->b[2+m]);
|
||||
}
|
||||
|
||||
} else { */
|
||||
|
||||
//}
|
||||
//pdu->data = eNB->ulsch_NB_IoT[UE_id]->harq_processes[harq_pid]->b;
|
||||
//eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
|
||||
//eNB->UL_INFO.rx_ind.sfn_sf = frame<<4 | subframe;
|
||||
|
||||
// do we need to transmit timing ?? however, the nfapi structure does not include timing paramters !!!!!
|
||||
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
{
|
||||
|
||||
uint32_t i;
|
||||
//NB_IoT_eNB_NULSCH_t *nulsch;
|
||||
//nulsch = eNB->ulsch_NB_IoT[0];
|
||||
|
||||
const int rx_subframe = proc->subframe_rx;
|
||||
const int rx_frame = proc->frame_rx;
|
||||
|
||||
int RB_IoT_ID = 22;
|
||||
for (i=0; i<1; i++)
|
||||
{
|
||||
// if eNB is ready to receive UL data
|
||||
// define a flag to trigger on or off the decoding process
|
||||
rx_ulsch_Gen_NB_IoT(eNB,
|
||||
proc,
|
||||
0, // this is the effective sector id
|
||||
0,
|
||||
RB_IoT_ID, // 22 , to be included in // to be replaced by NB_IoT_start ??
|
||||
rx_subframe, // first received subframe
|
||||
rx_frame); // first received frame
|
||||
} // for UE loop
|
||||
|
||||
}
|
||||
270
openair1/SCHED/pusch_pc_NB_IoT.c
Normal file
270
openair1/SCHED/pusch_pc_NB_IoT.c
Normal file
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file pusch_pc.c
|
||||
* \brief Implementation of UE PUSCH Power Control procedures from 36.213 LTE specifications (Section
|
||||
* \author R. Knopp
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
//#include "defs_nb_iot.h"
|
||||
#include "PHY/defs_NB_IoT.h"
|
||||
#include "PHY/TOOLS/dB_routines.h"
|
||||
//#include "PHY/LTE_TRANSPORT/proto_nb_iot.h"
|
||||
//#include "PHY/extern_NB_IoT.h"
|
||||
|
||||
// This is the formula from Section 5.1.1.1 in 36.213 100*10*log10((2^(MPR*Ks)-1)), where MPR is in the range [0,6] and Ks=1.25
|
||||
int16_t hundred_times_delta_TF_NB_IoT[100] = {-32768,-1268,-956,-768,-631,-523,-431,-352,-282,-219,-161,-107,-57,-9,36,79,120,159,197,234,269,304,337,370,402,434,465,495,525,555,583,612,640,668,696,723,750,777,803,829,856,881,907,933,958,983,1008,1033,1058,1083,1108,1132,1157,1181,1205,1229,1254,1278,1302,1325,1349,1373,1397,1421,1444,1468,1491,1515,1538,1562,1585,1609,1632,1655,1679,1702,1725,1748,1772,1795,1818,1841,1864,1887,1910,1933,1956,1980,2003,2026,2049,2072,2095,2118,2141,2164,2186,2209,2232,2255};
|
||||
uint16_t hundred_times_log10_NPRB_NB_IoT[100] = {0,301,477,602,698,778,845,903,954,1000,1041,1079,1113,1146,1176,1204,1230,1255,1278,1301,1322,1342,1361,1380,1397,1414,1431,1447,1462,1477,1491,1505,1518,1531,1544,1556,1568,1579,1591,1602,1612,1623,1633,1643,1653,1662,1672,1681,1690,1698,1707,1716,1724,1732,1740,1748,1755,1763,1770,1778,1785,1792,1799,1806,1812,1819,1826,1832,1838,1845,1851,1857,1863,1869,1875,1880,1886,1892,1897,1903,1908,1913,1919,1924,1929,1934,1939,1944,1949,1954,1959,1963,1968,1973,1977,1982,1986,1991,1995,2000};
|
||||
|
||||
int16_t get_hundred_times_delta_IF_eNB_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,uint8_t UE_id,uint8_t harq_pid, uint8_t bw_factor)
|
||||
{
|
||||
|
||||
uint32_t Nre,sumKr,MPR_x100,Kr,r;
|
||||
uint16_t beta_offset_pusch;
|
||||
|
||||
DevAssert( UE_id < NUMBER_OF_UE_MAX_NB_IoT+1 );
|
||||
DevAssert( harq_pid < 8 );
|
||||
|
||||
Nre = eNB->nulsch[UE_id]->harq_process->Nsymb_initial *
|
||||
eNB->nulsch[UE_id]->harq_process->nb_rb*12;
|
||||
|
||||
sumKr = 0;
|
||||
|
||||
for (r=0; r<eNB->nulsch[UE_id]->harq_process->C; r++) {
|
||||
if (r<eNB->nulsch[UE_id]->harq_process->Cminus)
|
||||
Kr = eNB->nulsch[UE_id]->harq_process->Kminus;
|
||||
else
|
||||
Kr = eNB->nulsch[UE_id]->harq_process->Kplus;
|
||||
|
||||
sumKr += Kr;
|
||||
}
|
||||
|
||||
if (Nre==0)
|
||||
return(0);
|
||||
|
||||
MPR_x100 = 100*sumKr/Nre;
|
||||
// Note: MPR=is the effective spectral efficiency of the PUSCH
|
||||
// FK 20140908 sumKr is only set after the ulsch_encoding
|
||||
|
||||
beta_offset_pusch = 8;
|
||||
//(eNB->ulsch[UE_id]->harq_processes[harq_pid]->control_only == 1) ? eNB->ulsch[UE_id]->beta_offset_cqi_times8:8;
|
||||
|
||||
DevAssert( UE_id < NUMBER_OF_UE_MAX_NB_IoT );
|
||||
//#warning "This condition happens sometimes. Need more investigation" // navid
|
||||
//DevAssert( MPR_x100/6 < 100 );
|
||||
|
||||
if (eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled == 1) {
|
||||
// This is the formula from Section 5.1.1.1 in 36.213 10*log10(deltaIF_PUSCH = (2^(MPR*Ks)-1)*beta_offset_pusch)
|
||||
if (bw_factor == 1) {
|
||||
uint8_t nb_rb = eNB->nulsch[UE_id]->harq_process->nb_rb;
|
||||
return(hundred_times_delta_TF_NB_IoT[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch)>>3)) + hundred_times_log10_NPRB_NB_IoT[nb_rb-1];
|
||||
} else
|
||||
return(hundred_times_delta_TF_NB_IoT[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch)>>3));
|
||||
} else {
|
||||
return(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid)
|
||||
{
|
||||
int8_t UE_id = find_ue( rnti, PHY_vars_eNB_g[module_idP][CC_id] );
|
||||
|
||||
if (UE_id == -1) {
|
||||
// not found
|
||||
return 0;
|
||||
}
|
||||
|
||||
return get_hundred_times_delta_IF_eNB( PHY_vars_eNB_g[module_idP][CC_id], UE_id, harq_pid, 0 );
|
||||
}
|
||||
|
||||
int16_t get_hundred_times_delta_IF(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t harq_pid)
|
||||
{
|
||||
|
||||
uint32_t Nre = 2*ue->ulsch[eNB_id]->harq_processes[harq_pid]->Nsymb_initial *
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb*12;
|
||||
|
||||
if (Nre==0)
|
||||
return(0);
|
||||
|
||||
uint32_t MPR_x100 = 100*ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS/Nre;
|
||||
// Note: MPR=is the effective spectral efficiency of the PUSCH
|
||||
// FK 20140908 sumKr is only set after the ulsch_encoding
|
||||
|
||||
uint16_t beta_offset_pusch = (ue->ulsch[eNB_id]->harq_processes[harq_pid]->control_only == 1) ?
|
||||
ue->ulsch[eNB_id]->beta_offset_cqi_times8:8;
|
||||
|
||||
if (ue->ul_power_control_dedicated[eNB_id].deltaMCS_Enabled == 1) {
|
||||
// This is the formula from Section 5.1.1.1 in 36.213 10*log10(deltaIF_PUSCH = (2^(MPR*Ks)-1)*beta_offset_pusch)
|
||||
return(hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch)>>3));
|
||||
} else {
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint8_t alpha_lut[8] = {0,40,50,60,70,80,90,100};
|
||||
|
||||
void pusch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t j, uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
|
||||
uint8_t harq_pid = subframe2harq_pid(&ue->frame_parms,
|
||||
proc->frame_tx,
|
||||
proc->subframe_tx);
|
||||
|
||||
uint8_t nb_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb;
|
||||
int16_t PL;
|
||||
|
||||
|
||||
// P_pusch = 10*log10(nb_rb + P_opusch(j)+ alpha(u)*PL + delta_TF(i) + f(i))
|
||||
//
|
||||
// P_opusch(0) = P_oPTR + deltaP_Msg3 if PUSCH is transporting Msg3
|
||||
// else
|
||||
// P_opusch(0) = PO_NOMINAL_PUSCH(j) + P_O_UE_PUSCH(j)
|
||||
PL = get_PL(ue->Mod_id,ue->CC_id,eNB_id);
|
||||
|
||||
ue->ulsch[eNB_id]->Po_PUSCH = (hundred_times_log10_NPRB[nb_rb-1]+
|
||||
get_hundred_times_delta_IF(ue,eNB_id,harq_pid) +
|
||||
100*ue->ulsch[eNB_id]->f_pusch)/100;
|
||||
|
||||
if(ue->ulsch_Msg3_active[eNB_id] == 1) { // Msg3 PUSCH
|
||||
|
||||
ue->ulsch[eNB_id]->Po_PUSCH += (mac_xface->get_Po_NOMINAL_PUSCH(ue->Mod_id,0) + PL);
|
||||
|
||||
LOG_I(PHY,"[UE %d][RAPROC] AbsSubframe %d.%d: Msg3 (%d PRBs) Po_PUSCH %d dBm (%d,%d,100*PL=%d,%d,%d)\n",
|
||||
ue->Mod_id,proc->frame_tx,proc->subframe_tx,nb_rb,ue->ulsch[eNB_id]->Po_PUSCH,
|
||||
100*mac_xface->get_Po_NOMINAL_PUSCH(ue->Mod_id,0),
|
||||
hundred_times_log10_NPRB[nb_rb-1],
|
||||
100*PL,
|
||||
get_hundred_times_delta_IF(ue,eNB_id,harq_pid),
|
||||
100*ue->ulsch[eNB_id]->f_pusch);
|
||||
} else if (j==0) { // SPS PUSCH
|
||||
} else if (j==1) { // Normal PUSCH
|
||||
|
||||
ue->ulsch[eNB_id]->Po_PUSCH += ((alpha_lut[ue->frame_parms.ul_power_control_config_common.alpha]*PL)/100);
|
||||
ue->ulsch[eNB_id]->Po_PUSCH += ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH;
|
||||
ue->ulsch[eNB_id]->PHR = ue->tx_power_max_dBm-ue->ulsch[eNB_id]->Po_PUSCH;
|
||||
|
||||
if (ue->ulsch[eNB_id]->PHR < -23)
|
||||
ue->ulsch[eNB_id]->PHR = -23;
|
||||
else if (ue->ulsch[eNB_id]->PHR > 40)
|
||||
ue->ulsch[eNB_id]->PHR = 40;
|
||||
|
||||
LOG_D(PHY,"[UE %d][PUSCH %d] AbsSubframe %d.%d: nb_rb: %d, Po_PUSCH %d dBm : tx power %d, Po_NOMINAL_PUSCH %d,log10(NPRB) %f,PHR %d, PL %d, alpha*PL %f,delta_IF %f,f_pusch %d\n",
|
||||
ue->Mod_id,harq_pid,proc->frame_tx,proc->subframe_tx,nb_rb,
|
||||
ue->ulsch[eNB_id]->Po_PUSCH,
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
|
||||
hundred_times_log10_NPRB[nb_rb-1]/100.0,
|
||||
ue->ulsch[eNB_id]->PHR,
|
||||
PL,
|
||||
alpha_lut[ue->frame_parms.ul_power_control_config_common.alpha]*PL/100.0,
|
||||
get_hundred_times_delta_IF(ue,eNB_id,harq_pid)/100.0,
|
||||
ue->ulsch[eNB_id]->f_pusch);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int8_t get_PHR(uint8_t Mod_id, uint8_t CC_id,uint8_t eNB_index)
|
||||
{
|
||||
|
||||
return PHY_vars_UE_g[Mod_id][CC_id]->ulsch[eNB_index]->PHR;
|
||||
}
|
||||
|
||||
// uint8_t eNB_id,uint8_t harq_pid, uint8_t UE_id,
|
||||
int16_t estimate_ue_tx_power(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs)
|
||||
{
|
||||
|
||||
/// The payload + CRC size in bits, "B"
|
||||
uint32_t B;
|
||||
/// Number of code segments
|
||||
uint32_t C;
|
||||
/// Number of "small" code segments
|
||||
uint32_t Cminus;
|
||||
/// Number of "large" code segments
|
||||
uint32_t Cplus;
|
||||
/// Number of bits in "small" code segments (<6144)
|
||||
uint32_t Kminus;
|
||||
/// Number of bits in "large" code segments (<6144)
|
||||
uint32_t Kplus;
|
||||
/// Total number of bits across all segments
|
||||
uint32_t sumKr;
|
||||
/// Number of "Filler" bits
|
||||
uint32_t F;
|
||||
// num resource elements
|
||||
uint32_t num_re=0.0;
|
||||
// num symbols
|
||||
uint32_t num_symb=0.0;
|
||||
/// effective spectral efficiency of the PUSCH
|
||||
uint32_t MPR_x100=0;
|
||||
/// beta_offset
|
||||
uint16_t beta_offset_pusch_x8=8;
|
||||
/// delta mcs
|
||||
float delta_mcs=0.0;
|
||||
/// bandwidth factor
|
||||
float bw_factor=0.0;
|
||||
|
||||
B= tbs+24;
|
||||
lte_segmentation(NULL,
|
||||
NULL,
|
||||
B,
|
||||
&C,
|
||||
&Cplus,
|
||||
&Cminus,
|
||||
&Kplus,
|
||||
&Kminus,
|
||||
&F);
|
||||
|
||||
|
||||
sumKr = Cminus*Kminus + Cplus*Kplus;
|
||||
num_symb = 12-(ncp<<1)-(use_srs==0?0:1);
|
||||
num_re = num_symb * nb_rb * 12;
|
||||
|
||||
if (num_re == 0)
|
||||
return(0);
|
||||
|
||||
MPR_x100 = 100*sumKr/num_re;
|
||||
|
||||
if (control_only == 1 )
|
||||
beta_offset_pusch_x8=8; // fixme
|
||||
|
||||
//(beta_offset_pusch_x8=ue->ulsch[eNB_id]->harq_processes[harq_pid]->control_only == 1) ? ue->ulsch[eNB_id]->beta_offset_cqi_times8:8;
|
||||
|
||||
// if deltamcs_enabledm
|
||||
delta_mcs = ((hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch_x8)>>3))/100.0);
|
||||
bw_factor = (hundred_times_log10_NPRB[nb_rb-1]/100.0);
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
printf("estimated ue tx power %d (num_re %d, sumKr %d, mpr_x100 %d, delta_mcs %f, bw_factor %f)\n",
|
||||
(int16_t)ceil(delta_mcs + bw_factor), num_re, sumKr, MPR_x100, delta_mcs, bw_factor);
|
||||
#endif
|
||||
return (int16_t)ceil(delta_mcs + bw_factor);
|
||||
|
||||
}
|
||||
*/
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user