function IXY_4PAM_plotter

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

% calcolo dell'informazione mutua dei due modelli impiegati
IXY = 0*SNR_dB;
IXY_bit = 0*SNR_dB;
for i = 1:numel(SNR_dB)
    [IXY(i),IXY_bit(i)] = IXY_4PAM_AWGN_Hard(SNR_dB(i));
end

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

% plot
hold off
plot(SNR_dB,IXY,'LineWidth',2);
hold on
plot(SNR_dB,IXY_bit,'g--','LineWidth',2);
plot(SNR_dB,C_Shannon,'r-.','LineWidth',2);
grid on
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)','Shannon (AWGN)'},'Location','NorthWest');
title('4-PAM');
