Chapter 12 : Digital Modulation and Modems

Example 1 : pg 407

In [1]:
 
# page no 407
# prob no 12_1
#calculate the data rate and theoretical max
#A radio channel with BW=10KHz and SNR=15 dB
from math import log
#given
B=10.*10**3;
snr=15.;
#calculations and results
#converting dB in power ratio
SNR=10**(snr/10);
#a)Determination of theoretical max data rate
C1=B*log(1+SNR) /log(2);
print 'a)The theoretical max data rate is',round(C1/1000,3),'kb/s'
#b)Determination of data rate with 4 states i.e M=4
M=4.;
C2=2*B*log(M) / log(2);
print 'b)The data rate for 4 states is',C2/1000,'kb/s'
a)The theoretical max data rate is 50.278 kb/s
b)The data rate for 4 states is 40.0 kb/s

Example 2 : pg 408

In [2]:
 
# page no 408
# prob no 12_2
#calculate the baud and bit rates
from math import log
#A modulator transmit symbol with symbol rate=10k/sec with 64 states
#given
M=64.;
S=10000.;
#calculations and results
#Baud rate is simply symbol rate
print 'The baud rate is ',S/1000,'kbaud'
#Determination of bit rate
C=S*log(64) / log(2);
print 'The bit rate is ',C/1000,'kb/s'
The baud rate is  10.0 kbaud
The bit rate is  60.0 kb/s

Example 3 : pg 411

In [3]:
 
# page no 411
# prob no 12_3
#calculate the frequency shift, max, min frequency
#given
f=200.*10**3;
fb=270.833 *10**3;
data_rate=270.833 *10**3
fc=880*10**6;
bandwidth=200*10**3;
#calculations and results
freq_shift=0.5*fb;
print 'a)The frequency shift is',freq_shift,'Hz'
# The shift each way from the carrier frequency is half the freq_shift
f_max=fc+0.25*fb;
print 'b)The maximum frequency is',round(f_max,3),'Hz'
f_min=fc-0.25*fb;
print 'The minimum frequency is',round(f_min,3),'Hz'
bandwidth_efficiency=data_rate/bandwidth;
print 'The bandwidth efficiency in b/s/Hz is',round(bandwidth_efficiency,3),'b/s/Hz'
a)The frequency shift is 135416.5 Hz
b)The maximum frequency is 880067708.25 Hz
The minimum frequency is 879932291.75 Hz
The bandwidth efficiency in b/s/Hz is 1.354 b/s/Hz

Example 4 : pg 412

In [4]:
 
# page no 412
# prob no 12_4
#calculate the channel data rate
#given
baud_rate=24.3;# in kilobaud
#calculations
# In this problem dibit system is used.
#Therefore symbol_rate=baud_rate=0.5*bit_rate
bit_rate=2*baud_rate;
#results
print 'The channel data rate is',bit_rate,'kb/s'
The channel data rate is 48.6 kb/s

Example 5 : pg 413

In [5]:
 
# page no 413
# prob no 12_5
#calculate the no. of bits per symbol
from math import log
#given
no_of_phase_angles=16;
no_of_amplitudes=4;
#calculations
no_of_states_per_symbol=no_of_phase_angles*no_of_amplitudes;
bit_per_symbol=log(no_of_states_per_symbol)/ log(2);
#results
print 'The no. of bits per symbol is',bit_per_symbol
The no. of bits per symbol is 6.0

Example 6 : pg 415

In [6]:
 
# page no 415
# prob no 12_6
#calculate the shannon limit
from math import log
#given
B=3.*10**3;SNR_dB=30.;
#calculations
SNR_power=10**(30./10);
C=B*log(1+SNR_power)/ log(2);
print 'Shannon limit',round(C,2),'b/s'
Shannon limit 29901.68 b/s