399399% top level function to set up and run a test
400400function results = test_trellis(nframes = 100 , dec= 1 , ntxcw= 8 , nstages= 3 , EbNodB= 3 , verbose= 0 )
401401 K = 20 ; K_st= 2 + 1 ; K_en= 16 + 1 ;
402- vq_fn = " ../build_linux/vq_stage1 .f32" ;
402+ vq_fn = " ../build_linux/vq_stage1_bs004 .f32" ;
403403 vq_output_fn = " ../build_linux/all_speech_8k_test.f32" ;
404404 target_fn = " ../build_linux/all_speech_8k_lim.f32" ;
405405
@@ -511,11 +511,11 @@ function test_vq(vq_fn)
511511endfunction
512512
513513% generate sets of curves
514- function run_curves(frames = 100 , dec= 1 )
514+ function run_curves(frames = 100 , dec= 1 , nstages = 5 )
515515 results_log = [];
516- EbNodB = [1 2 3 4 ];
516+ EbNodB = [0 1 2 3 4 5 ];
517517 for i= 1 : length(EbNodB )
518- results = test_trellis(frames , dec , ntxcw= 8 , nstages= 3 , EbNodB(i ), verbose= 0 );
518+ results = test_trellis(frames , dec , ntxcw= 8 , nstages , EbNodB(i ), verbose= 0 );
519519 results_log = [results_log results ];
520520 end
521521 for i= 1 : length(results_log )
@@ -530,24 +530,23 @@ function run_curves(frames=100, dec=1)
530530
531531 figure(1 ); clf ; semilogy(EbNodB , ber_vanilla , " r+-;uncoded;" ); hold on ;
532532 semilogy(EbNodB , ber , " g+-;trellis;" ); hold off ;
533- grid ; title(sprintf(" BER dec=%d nstages=%d" ,dec ,nstages ));
533+ grid( ' minor ' ) ; title(sprintf(" BER dec=%d nstages=%d" ,dec ,nstages ));
534534 print(" -dpng" , sprintf(" trellis_dec_%d_ber.png" ,dec ));
535535
536536 figure(2 ); clf ; semilogy(EbNodB , per_vanilla , " r+-;uncoded;" ); hold on ;
537537 semilogy(EbNodB , per , " g+-;trellis;" );
538- grid ; title(sprintf(" PER dec=%d nstages=%d" ,dec ,nstages ));
538+ grid( ' minor ' ) ; title(sprintf(" PER dec=%d nstages=%d" ,dec ,nstages ));
539539 print(" -dpng" , sprintf(" trellis_dec_%d_per.png" ,dec ));
540540
541541 figure(3 ); clf ; plot(EbNodB , mse_noerrors , " b+-;no errors;" ); hold on ;
542542 plot(EbNodB , mse_vanilla , " r+-;uncoded;" );
543543 plot(EbNodB , mse , " g+-;trellis;" ); hold off ;
544- grid ; title(sprintf(" RMS SD dec=%d nstages=%d" ,dec ,nstages ));
544+ grid( ' minor ' ) ; title(sprintf(" RMS SD dec=%d nstages=%d" ,dec ,nstages ));
545545 print(" -dpng" , sprintf(" trellis_dec_%d_rms_sd.png" ,dec ));
546546endfunction
547547
548548% -------------------------------------------------------------------
549549
550- graphics_toolkit (" gnuplot" );
551550more off ;
552551randn(' state' ,1 );
553552
@@ -557,9 +556,10 @@ function run_curves(frames=100, dec=1)
557556% test_trellis(nframes=600, dec=1, ntxcw=8, nstages=3, EbNodB=3, verbose=0);
558557% test_trellis(nframes=600, dec=4, ntxcw=8, nstages=3, EbNodB=3, verbose=0);
559558
560- run_curves(600 ,1 )
561- run_curves(600 ,2 )
562- run_curves(600 ,4 )
559+ % run_curves(600,1)
560+ % run_curves(600,2)
561+ % run_curves(600,4)
562+ run_curves(600 ,3 ,5 )
563563
564564% test_trellis(nframes=200, dec=1, ntxcw=1, nstages=3, EbNodB=3, verbose=0);
565565% test_trellis(nframes=100, dec=2, ntxcw=8, nstages=3, EbNodB=3, verbose=0);
0 commit comments