0% found this document useful (0 votes)
2 views2 pages

DC p7 Channelcoding Linearblockcodes

Uploaded by

aryanbhardwaj268
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

DC p7 Channelcoding Linearblockcodes

Uploaded by

aryanbhardwaj268
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

clc;

clear;
close all;

k = 3;
n = 6;

G = [1 0 0 1 1 1;
0 1 0 0 1 1;
0 0 1 1 1 0];

fprintf('Generator Matrix G =\n');


disp(G);

P = G(:,k+1:n);

fprintf('Parity Matrix P =\n');


disp(P);

H = [P' eye(n-k)];

fprintf('Parity Check Matrix H =\n');


disp(H);

check = mod(G * H',2);

fprintf('G * H'' mod 2 =\n');


disp(check);

d = [1 0 1];
c = mod(d * G,2);

fprintf('Message Bits d =\n');


disp(d);

fprintf('Codeword c =\n');
disp(c);

Generator Matrix G =
1 0 0 1 1 1
0 1 0 0 1 1
0 0 1 1 1 0

Parity Matrix P =
1 1 1
0 1 1
1 1 0

Parity Check Matrix H =


1 0 1 1 0 0
1 1 1 0 1 0
1 1 0 0 0 1

1
G * H' mod 2 =
0 0 0
0 0 0
0 0 0

Message Bits d =
1 0 1

Codeword c =
1 0 1 0 0 1

Published with MATLAB® R2025b

You might also like