Klyon
Newbie level 5
Hello!
People, I need your help!!!!!!
For example, I have a parity-check matrix for (7,4). Let it be:
% Parity-Check MAtrix
H = [
1 0 1 1 1 0 0;
1 1 1 0 0 1 0;
0 1 1 1 0 0 1
];
% Generator MAtrix
G = [
1 0 0 0 1 1 0;
0 1 0 0 0 1 1;
0 0 1 0 1 1 1;
0 0 0 1 1 0 1
];
% Uncoded Message
msg = [1 1 0 0];
% Coded Message
coded_msg = rem(msg * G, 2);
% Coded Message With no Error
coded_msg_err = [1 1 0 0 1 0 1];
syndrome = rem(coded_msg_err * H', 2)
syndrome = 0 0 0 (no errors).
Now I want to add a parity bit. I want (8,4) code. Ext. HAmming.
How should I change my H matrix?
Like this?
H = [
1 0 1 1 1 0 0 0;
1 1 1 0 0 1 0 0;
0 1 1 1 0 0 1 0;
1 1 1 1 1 1 1 1
];
Is it correct?
Please help me.
People, I need your help!!!!!!
For example, I have a parity-check matrix for (7,4). Let it be:
% Parity-Check MAtrix
H = [
1 0 1 1 1 0 0;
1 1 1 0 0 1 0;
0 1 1 1 0 0 1
];
% Generator MAtrix
G = [
1 0 0 0 1 1 0;
0 1 0 0 0 1 1;
0 0 1 0 1 1 1;
0 0 0 1 1 0 1
];
% Uncoded Message
msg = [1 1 0 0];
% Coded Message
coded_msg = rem(msg * G, 2);
% Coded Message With no Error
coded_msg_err = [1 1 0 0 1 0 1];
syndrome = rem(coded_msg_err * H', 2)
syndrome = 0 0 0 (no errors).
Now I want to add a parity bit. I want (8,4) code. Ext. HAmming.
How should I change my H matrix?
Like this?
H = [
1 0 1 1 1 0 0 0;
1 1 1 0 0 1 0 0;
0 1 1 1 0 0 1 0;
1 1 1 1 1 1 1 1
];
Is it correct?
Please help me.