Skip to content

rtajan/matlab-tanner-graphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

matlab-tanner-graphs short presentation

matlab-tanner-graphs is a tool written in Matlab for displaying, editing and exporting Tanner graphs. It is easy to use, the Tanner graph is created directly from the parity check matrix.

Using matlab-tanner-graphs

For creating a Tanner graph for the Hamming, just type the following code in Matlab :

H = [1 0 1 0 1 0 1; 0 1 1 0 0 1 1; 0 0 0 1 1 1 1]; % Hamming parity check matrix
tg = tanner_graph(H);                              % Build Tanner graph
plot(tg)                                           % Display Tanner graph

The expected output should be this Tanner graph :

Hamming_screenshot

Now you can edit this graph by grabbing the nodes and moving them.

Also, if you want to export the graph to a latex file (Tikz picture), just type the following code in Matlab

H = [1 0 1 0 1 0 1; 0 1 1 0 0 1 1; 0 0 0 1 1 1 1]; % Hamming parity check matrix
tg = tanner_graph(H);                              % Build Tanner graph
h_tg = plot(tg);                                   % Display Tanner graph and get a handle to it
% Move nodes, if you want to
h_tg.to_tikz('hamming.tex');                       % Export to a latex file

After compiling hamming.tex with pdflatex you should have :

Hamming Tikz

Releases

No releases published

Packages

No packages published

Languages