% Compute channel capacity for telephone line modems.
%
% Rich Kozick, ELEC 470

SNRdBv = -10:60;    % Vector of signal to noise ratios (SNR), in deciBels (dB)
B = 3200;           % Bandwidth of telephone channel, in Hz

SNRv = 10.^(SNRdBv/10);     % SNR in linear units, not dB

C = B*log2(1+SNRv); % Shannon channel capacity for AWGN, in bits/sec

figure(1)
plot(SNRdBv, C);
xlabel('SNR (dB)')
ylabel('CAPACITY (bits/sec)')
title('CAPACITY FOR TELEPHONE LINE MODEM')
grid
