Skip to content

Commit d6f7b34

Browse files
committed
generating PNGs, some evidence of improvements at dec=1,2, but only slight at dec=4
1 parent 638e261 commit d6f7b34

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

octave/trellis.m

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@
304304

305305
% VQ a target sequence of frames then run a test using vanilla uncoded/trellis decoder
306306
function results = run_test(target, vq, sd_table, h_table, ntxcw, nstages, EbNo, verbose)
307-
frames = length(target);
308-
nbits = log2(length(vq));
307+
[frames tmp] = size(target);
308+
[vq_length tmp] = size(vq);
309+
nbits = log2(vq_length);
309310
nerrors = 0;
310311
nerrors_vanilla = 0;
311312
tbits = 0;
@@ -530,15 +531,18 @@ function run_curves(frames=100, dec=1)
530531
figure(1); clf; semilogy(EbNodB, ber_vanilla, "r+-;uncoded;"); hold on;
531532
semilogy(EbNodB, ber, "g+-;trellis;"); hold off;
532533
grid; title(sprintf("BER dec=%d nstages=%d",dec,nstages));
533-
534+
print("-dpng", sprintf("trellis_dec_%d_ber.png",dec));
535+
534536
figure(2); clf; semilogy(EbNodB, per_vanilla, "r+-;uncoded;"); hold on;
535537
semilogy(EbNodB, per, "g+-;trellis;");
536538
grid; title(sprintf("PER dec=%d nstages=%d",dec,nstages));
539+
print("-dpng", sprintf("trellis_dec_%d_per.png",dec));
537540

538541
figure(3); clf; plot(EbNodB, mse_noerrors, "b+-;no errors;"); hold on;
539542
plot(EbNodB, mse_vanilla, "r+-;uncoded;");
540543
plot(EbNodB, mse, "g+-;trellis;"); hold off;
541544
grid; title(sprintf("RMS SD dec=%d nstages=%d",dec,nstages));
545+
print("-dpng", sprintf("trellis_dec_%d_rms_sd.png",dec));
542546
endfunction
543547

544548
% -------------------------------------------------------------------
@@ -550,10 +554,12 @@ function run_curves(frames=100, dec=1)
550554
% uncomment one of the below to run a test or simulation
551555

552556
% These two tests show where we are at:
553-
test_trellis(nframes=600, dec=1, ntxcw=8, nstages=3, EbNodB=3, verbose=0);
554-
test_trellis(nframes=600, dec=4, ntxcw=8, nstages=3, EbNodB=3, verbose=0);
557+
%test_trellis(nframes=600, dec=1, ntxcw=8, nstages=3, EbNodB=3, verbose=0);
558+
%test_trellis(nframes=600, dec=4, ntxcw=8, nstages=3, EbNodB=3, verbose=0);
555559

556-
% run_curves(600,4)
560+
run_curves(600,1)
561+
run_curves(600,2)
562+
run_curves(600,4)
557563

558564
%test_trellis(nframes=200, dec=1, ntxcw=1, nstages=3, EbNodB=3, verbose=0);
559565
%test_trellis(nframes=100, dec=2, ntxcw=8, nstages=3, EbNodB=3, verbose=0);

0 commit comments

Comments
 (0)