--- /dev/null
+diff -ruN -x '*.o' -x '*.dll' -x '*.mex' -x '*.mat' cml-orig/CmlStartup.m cml/CmlStartup.m
+--- cml-orig/CmlStartup.m 2007-09-08 23:12:26.000000000 +0930
++++ cml/CmlStartup.m 2015-09-04 07:21:14.218455223 +0930
+@@ -41,7 +41,7 @@
+ addpath( strcat( cml_home, '/mex'), ...\r
+ strcat( cml_home, '/mat'), ...\r
+ strcat( cml_home, '/matalt' ), ...\r
+- strcat( cml_home, '/mexhelp'), ...\r
++ %strcat( cml_home, '/mexhelp'), ...\r
+ strcat( cml_home, '/demos' ), ...\r
+ strcat( cml_home, '/scenarios'), ...\r
+ strcat( cml_home, '/localscenarios'),...\r
+@@ -59,4 +59,4 @@
+ save_directory = strcat( cml_home, '/scenarios/CmlHome.mat' );\r
+ end\r
+ \r
+-save( save_directory, save_flag, 'cml_home' );
+\ No newline at end of file
++save( save_directory, save_flag, 'cml_home' );\r
+diff -ruN -x '*.o' -x '*.dll' -x '*.mex' -x '*.mat' cml-orig/source/matrix.h cml/source/matrix.h
+--- cml-orig/source/matrix.h 1970-01-01 09:30:00.000000000 +0930
++++ cml/source/matrix.h 2015-09-04 07:06:46.907248420 +0930
+@@ -0,0 +1 @@
++#include <mex.h>
% ldpc.m\r
-% LDPC functions\r
+%\r
+% David Rowe 2013\r
+% Octave functions to help us use the CML LDPC code.\r
+%\r
+% Installing CML library\r
+% ----------------------\r
+%\r
+% $ sudo apt-get install liboctave-dev\r
+% $ wget http://www.iterativesolutions.com/user/image/cml.1.10.zip\r
+% $ unzip cml.1.10.zip\r
+% $ patch < ~/codec2-dev/octave/cml.patch\r
+% $ cd source\r
+% $ octave\r
+% octave:> make\r
\r
1;\r
\r
-% LDPC unit test script\r
+% ldpcut.m\r
+%\r
% David Rowe 18 Dec 2013\r
-% Based on siulation by Bill Cowley\r
+%\r
+% Octave LDPC unit test script, based on simulation by Bill Cowley VK5DSP\r
+%\r
\r
-% Start CML library\r
+% Start CML library (see CML set up instructions in ldpc.m)\r
\r
currentdir = pwd;\r
addpath '/home/david/tmp/cml/mat' % assume the source files stored here\r
cd /home/david/tmp/cml\r
-CmlStartup % note that this is not in the cml path!\r
+CmlStartup % note that this is not in the cml path!\r
cd(currentdir)\r
\r
% Our LDPC library\r
code_param = ldpc_init(rate, framesize, modulation, mod_order, mapping);\r
\r
Ntrials = 84;\r
-EsNo=10;\r
+EsNo = 10;\r
\r
Tbits = Terrs = Ferrs = 0;\r
\r
error_positions = xor( detected_data(1:code_param.data_bits_per_frame), data(st:en) );\r
Nerrs = sum( error_positions);\r
\r
- if Nerrs>0, fprintf(1,'x'), else fprintf(1,'.'), end\r
- if (rem(nn, 50)==0), fprintf(1,'\n'), end \r
+ % print "." if frame decoded without errors, 'x' if we can't decode\r
+\r
+ if Nerrs>0, fprintf(1,'x'), else printf('.'), end\r
+ if (rem(nn, 50)==0), printf('\n'), end \r
if Nerrs>0, Ferrs = Ferrs +1; end\r
Terrs = Terrs + Nerrs;\r
Tbits = Tbits + code_param.data_bits_per_frame; \r
end\r
-fprintf(1,'\n')\r
+printf("\nTbits: %d Terrs: %d Ferrs: %d\n", Tbits, Terrs, Ferrs)\r
\r