-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmap.m
44 lines (40 loc) · 1.07 KB
/
map.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function pui=map(pvi,symbolmap,flaginterleaving,seed_inter)
% Function: map
%
% pui=map(pvi,symbolmap,flaginterleaving,seed_inter)
%
% Author: Irene Santos Velázquez
%
% Contact: [email protected], [email protected]
%
% Created 16/01/2017
%
% Description: This function maps and interlaves the probability of bits
% (pvi) into the probability of symbols (pui)
%
% Inputs:
% pvi is the probability of bits
% symbolmap is a matrix where column i is the gray representation of symbol A(i)
% flaginterleaving is 1 if interleaving is included after demapping
% seed_inter is the random stream that determines the specific permutation
%
% Output:
% pui is the probability of symbols
[~,N]=size(pvi);
L=size(symbolmap,2);
nbits=log2(L);
Nu=N/nbits;
pui=ones(L,Nu);
% interleaving
if flaginterleaving
pvi(1,:)=randintrlv(pvi(1,:),seed_inter);
pvi(2,:)=randintrlv(pvi(2,:),seed_inter);
end
for kk=1:L
indA=symbolmap(:,kk)+1;
paux=ones(1,Nu);
for k=1:nbits
paux=paux.*pvi(indA(k),k:nbits:N);
end
pui(kk,:)=paux;
end