function IXY_4PAM_plotter2

% range di SNR da esplorare
SNR_dB = -10:20;

% calcolo dell'informazione mutua dei due modelli impiegati
IXY_hard = 0*SNR_dB;
IXY_bitH = 0*SNR_dB;
for i = 1:numel(SNR_dB)
    [IXY_hard(i),IXY_bitH(i)] = IXY_4PAM_AWGN_Hard(SNR_dB(i));
end
IXY_soft = 0*SNR_dB;
IXY_LLR  = 0*SNR_dB;
for i = 1:numel(SNR_dB)
    [IXY_soft(i),IXY_LLR(i)] = IXY_4PAM_AWGN_Soft(SNR_dB(i));
end

% limite di Shannon
C_Shannon = 0.5*log2(1+10.^(SNR_dB/10));

% plot
hold off
plot(SNR_dB,IXY_hard,'LineWidth',2);
hold on
plot(SNR_dB,IXY_bitH,'m-','LineWidth',2);
plot(SNR_dB,IXY_soft,'k-','LineWidth',2);
plot(SNR_dB,IXY_LLR,'g-','LineWidth',2);
plot(SNR_dB,C_Shannon,'r-.','LineWidth',2);
grid on
set(gca,'YLim',[0 3]);
xlabel('SNR (dB)');
ylabel('Rate (bits/channel use)');
legend('I(X;Y) (Hard)',...
	'I(b_1;b_{1,est})+I(b_2;b_{2,est}) (Hard)',...
	'I(X;y) (Soft)',...
	'I(b_1;Lb_{1,est})+I(b_2;Lb_{2,est}) (LLR)',...
	'Shannon (AWGN)');
title('4-PAM');
