From: drowe67 Date: Thu, 3 Sep 2015 22:15:06 +0000 (+0000) Subject: documented installation of CML library X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=bfb233a4d0c7f5e44c1c84356a1d2fce49c592e0;p=freetel-svn-tracking.git documented installation of CML library git-svn-id: https://svn.code.sf.net/p/freetel/code@2294 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/octave/cml.patch b/codec2-dev/octave/cml.patch new file mode 100644 index 00000000..c7cadd0c --- /dev/null +++ b/codec2-dev/octave/cml.patch @@ -0,0 +1,24 @@ +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'), ... + strcat( cml_home, '/mat'), ... + strcat( cml_home, '/matalt' ), ... +- strcat( cml_home, '/mexhelp'), ... ++ %strcat( cml_home, '/mexhelp'), ... + strcat( cml_home, '/demos' ), ... + strcat( cml_home, '/scenarios'), ... + strcat( cml_home, '/localscenarios'),... +@@ -59,4 +59,4 @@ + save_directory = strcat( cml_home, '/scenarios/CmlHome.mat' ); + end + +-save( save_directory, save_flag, 'cml_home' ); +\ No newline at end of file ++save( save_directory, save_flag, 'cml_home' ); +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 diff --git a/codec2-dev/octave/ldpc.m b/codec2-dev/octave/ldpc.m index 7ce4a87a..9a10d93e 100644 --- a/codec2-dev/octave/ldpc.m +++ b/codec2-dev/octave/ldpc.m @@ -1,5 +1,18 @@ % ldpc.m -% LDPC functions +% +% David Rowe 2013 +% Octave functions to help us use the CML LDPC code. +% +% Installing CML library +% ---------------------- +% +% $ sudo apt-get install liboctave-dev +% $ wget http://www.iterativesolutions.com/user/image/cml.1.10.zip +% $ unzip cml.1.10.zip +% $ patch < ~/codec2-dev/octave/cml.patch +% $ cd source +% $ octave +% octave:> make 1; diff --git a/codec2-dev/octave/ldpcut.m b/codec2-dev/octave/ldpcut.m index 9dfdc94e..39843d8d 100644 --- a/codec2-dev/octave/ldpcut.m +++ b/codec2-dev/octave/ldpcut.m @@ -1,13 +1,16 @@ -% LDPC unit test script +% ldpcut.m +% % David Rowe 18 Dec 2013 -% Based on siulation by Bill Cowley +% +% Octave LDPC unit test script, based on simulation by Bill Cowley VK5DSP +% -% Start CML library +% Start CML library (see CML set up instructions in ldpc.m) currentdir = pwd; addpath '/home/david/tmp/cml/mat' % assume the source files stored here cd /home/david/tmp/cml -CmlStartup % note that this is not in the cml path! +CmlStartup % note that this is not in the cml path! cd(currentdir) % Our LDPC library @@ -30,7 +33,7 @@ max_iterations = 100; code_param = ldpc_init(rate, framesize, modulation, mod_order, mapping); Ntrials = 84; -EsNo=10; +EsNo = 10; Tbits = Terrs = Ferrs = 0; @@ -59,11 +62,13 @@ for nn = 1: Ntrials error_positions = xor( detected_data(1:code_param.data_bits_per_frame), data(st:en) ); Nerrs = sum( error_positions); - if Nerrs>0, fprintf(1,'x'), else fprintf(1,'.'), end - if (rem(nn, 50)==0), fprintf(1,'\n'), end + % print "." if frame decoded without errors, 'x' if we can't decode + + if Nerrs>0, fprintf(1,'x'), else printf('.'), end + if (rem(nn, 50)==0), printf('\n'), end if Nerrs>0, Ferrs = Ferrs +1; end Terrs = Terrs + Nerrs; Tbits = Tbits + code_param.data_bits_per_frame; end -fprintf(1,'\n') +printf("\nTbits: %d Terrs: %d Ferrs: %d\n", Tbits, Terrs, Ferrs)