| Contents | Index |
parmat = gen2par(genmat)
genmat = gen2par(parmat)
parmat = gen2par(genmat) converts the standard-form binary generator matrix genmat into the corresponding parity-check matrix parmat.
genmat = gen2par(parmat) converts the standard-form binary parity-check matrix parmat into the corresponding generator matrix genmat.
The standard forms of the generator and parity-check matrices for an [n,k] binary linear block code are shown in the table below
| Type of Matrix | Standard Form | Dimensions |
|---|---|---|
| Generator | [Ik P] or [P Ik] | k-by-n |
| Parity-check | [-P' In-k] or [In-k -P' ] | (n-k)-by-n |
.
where Ik is the identity matrix of size k and the ' symbol indicates matrix transpose. Two standard forms are listed for each type, because different authors use different conventions. For binary codes, the minus signs in the parity-check form listed above are irrelevant; that is, -1 = 1 in the binary field.
The commands below convert the parity-check matrix for a Hamming code into the corresponding generator matrix and back again.
parmat = hammgen(3)
genmat1 = gen2par(parmat)
parmat2 = gen2par(genmat1) % Ans should be the same as parmat aboveThe output is
parmat =
1 0 0 1 0 1 1
0 1 0 1 1 1 0
0 0 1 0 1 1 1
genmat =
1 1 0 1 0 0 0
0 1 1 0 1 0 0
1 1 1 0 0 1 0
1 0 1 0 0 0 1
parmat2 =
1 0 0 1 0 1 1
0 1 0 1 1 1 0
0 0 1 0 1 1 1

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |