Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %%
- clear; clc;
- n = 7;
- % m = 5;
- ef = n;
- layers = 2;
- % wc = 2;
- % A = zeros(n, m);
- % for col = 1 : m
- % randRows = randperm(n);
- % rowsWithOne = randRows(1:wc);
- % A(rowsWithOne, col) = 1;
- % end
- % A
- H = hammgen(ceil(log2(n)))
- G = gen2par(H)
- % H = transpose(H)
- % TPC = Gen_TPC(A, H)
- % size(TPC)
- Protho_gen = Gen_Protho(n, ef, layers);
- %OfSpecialProtho = Protho_num(v, Protho_gen);
- Protho_matrix = Compute_Protho(n,ef);
- size(Protho_gen)
- gfrank(Protho_gen)
- fid = fopen('Parity_LDPC.txt','wt');
- for ii = 1:size(Protho_gen,1)
- fprintf(fid,'%g\t', Protho_gen(ii,:));
- fprintf(fid,'\n');
- end
- numel(Protho_gen(:,1))
- %%
- clear; clc;
- n = 7;
- ef = n;
- H = hammgen(ceil(log2(n)));
- Prothograph_matrix = [1 4 2 3 0 5 6; 0 0 0 0 0 0 0];
- a=zeros(n);
- a(1,:) = ones(1,n);
- Res = a;
- for i = 2:n
- a = zeros(n);
- a(i,:) = ones(1,n);
- Res = [Res a];
- end
- Res = [Res; repmat(eye(ef),1,n)];
- Inserted = InsertComp(n,ef,2,Res,H);
- fid = fopen('Parity_Unshuffled.txt','wt');
- for ii = 1:size(Inserted,1)
- fprintf(fid,'%g\t', Inserted(ii,:));
- fprintf(fid,'\n');
- end
- reshuf = Prothograph_matrix(1,1:n)
- idx = Gen_Protho_vec(n,ef, reshuf);
- Inserted_Shuffled = Inserted(:,idx);
- fid = fopen('Parity_Shuffled.txt','wt');
- for ii = 1:size(Inserted_Shuffled,1)
- fprintf(fid,'%g\t', Inserted_Shuffled(ii,:));
- fprintf(fid,'\n');
- end
- x = ([1 1 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 1 0 1 0 0 0 1 0 1 1 1 1 1 0 1 0 0 0 0 0 1 1 0 1 0 1 1 0 1 0 0 0]);
- x = x(:,idx);
- size(x);
- Proizv = reshape(mod((x*transpose(Inserted_Shuffled)), 2),[],1)
- %%
- Protho_gen_hammgen = InsertComp(n, ef, layers, Protho_gen, H)
- fid = fopen('Parity.txt','wt');
- for ii = 1:size(Protho_gen_hammgen,1)
- fprintf(fid,'%g\t', Protho_gen_hammgen(ii,:));
- fprintf(fid,'\n');
- end
- size(Protho_gen_hammgen)
- gfrank(Protho_gen_hammgen)
- [L1,u,L2] = lu(Protho_gen_hammgen);
- x = ([1 0 0 0 1 0 0 0 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 1 1 0 1 1 0 1 1 0 0 0 0 1 1 0 0]);
- size(x)
- Proizv = mod((x*transpose(Protho_gen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement