% [X] - Extract and compare more parameters from demod
% [X] - Run some tests in parallel
-%
-% FSK Modem test instructions --
-% 1 - Compile tfsk.c and fm_mod.c
-% - tfsk.c is in unittest/, so build must not be configured for release
-% 2 - Change tfsk_location and fsk_mod_location to point to tfsk
-% 3 - Ensure octave packages signal and parallel are installed
-% 4 - run tfsk.m. It will take care of the rest.
-%
+#{
+
+ FSK Modem automated test instructions:
+
+ 1. Use cmake to build in debug mode to ensure unittest/tfsk is built:
+
+ $ cd ~/codec2
+ $ rm -Rf build_linux && mkdir build_linux
+ $ cd build_linux
+ $ cmake -DCMAKE_BUILD_TYPE=Debug ..
+ $ make
+
+ 2 - Change tfsk_location below if required
+ 3 - Ensure Octave packages signal and parallel are installed
+ 4 - Start Octave and run tfsk.m. It will perform all tests automatically
+
+#}
%tfsk executable path/file
-global tfsk_location = '../build/unittest/tfsk';
+global tfsk_location = '../build_linux/unittest/tfsk';
maxdvec = abs(max(dvec));
pass = maxdvec<tol;
- printf('Comparing vectors %s in test %s. Diff is %f\n',vname,tname,maxdvec);
+ printf(' Comparing vectors %s in test %s. Diff is %f\n',vname,tname,maxdvec);
if pass == 0
printf('\n*** vcompare failed %s in test %s. Diff: %f Tol: %f\n\n',vname,tname,maxdvec,tol);
omod = fsk_horus_mod(states,bits');
dmod = cmod-omod;
- pass = max(dmod)<(mod_pass_fail_maxdiff*length(dmod))
+ pass = max(dmod)<(mod_pass_fail_maxdiff*length(dmod));
if !pass
printf('Mod failed test %s!\n',tname);
end
tstats = fsk_demod_xt(Fs,Rs,states.f1_tx,states.f2_tx,rx,test_name);
printf("Test %s done\n",test_name);
- pass = tstats.pass
+ pass = tstats.pass;
obits = tstats.obits;
cbits = tstats.cbits;
% Figure out BER of octave and C modems
- bitcnt = length(tx_bits)
+ bitcnt = length(tx_bits);
rx_bits = obits;
ber = 1;
ox = 1;
pass = sum(passv)>=length(passv);
%and no tests died
pass = pass && length(passv)==ebnodbs;
- passv
+ passv;
assert(pass)
endfunction