1% Plot some results from FSK LLR tests 2% Assume array "res" contains rows of simulation results::: 3% Eb Ec M Ltype Nbits Nerr BERraw 4% (some uncoded rows might contain -1 to indicate val is not applicable) 5 6figure(102); clf; hold on; 7 8%uncoded results 9sub = res(res(:,4)==-1 & res(:,3)==2, :) 10semilogy(sub(:,1), sub(:,7), 'k+--') 11sub = res(res(:,4)==-1 & res(:,3)==4, :) 12semilogy(sub(:,1), sub(:,7), 'k--') 13 14leg=[]; 15% coded results 16for M = [2 4 ] 17 18if M==2, lt = '-+'; else lt='-x'; end 19 20 sub = res(res(:,4)==1 & res(:,3)==M, :) 21 if length(sub)>0, 22 semilogy(sub(:,1), sub(:,6)./sub(:,5), ['k' lt]) 23 leg= [leg; 'Orig LLRs']; 24 end 25 26 27sub = res(res(:,4)==2 & res(:,3)==M, :) 28if length(sub)>0, 29 semilogy(sub(:,1), sub(:,6)./sub(:,5), ['g' lt]) 30 leg= [leg; ' PDF LLRs']; 31end 32 33sub = res(res(:,4)==3 & res(:,3)==M, :) 34if length(sub)>0 35 semilogy(sub(:,1), sub(:,6)./sub(:,5), ['b' lt]) 36 leg= [leg; ' HD LLRs']; 37end 38 39sub = res(res(:,4)==4 & res(:,3)==M, :) 40semilogy(sub(:,1), sub(:,6)./sub(:,5), ['m' lt]) 41leg= [leg; ' CML LLRs']; 42endfor 43 44ylabel('BER') 45xlabel('Eb/N0 (Info Bits; dB)') 46 title('MFSK LLR test (+is 2FSK, xis 4FSK') 47 legend(leg) 48 legend('boxoff'); 49 50if exist('plotname'), print -dpng plotname; disp('saved'); end 51 52