Chapter 8 : Pulse modulation and Time division multiplexing

Example 8.1 Page No : 277

In [1]:
# Variables
W = 5000.;    #Hz

# Calculations and Results
fs = 2*W;
print 'a)  The minimum sampling rate is %i samples per second.'%(fs);
T = 1/fs;    #second
print ' b)  Maximum interval between samples is %f seconds'%(T);
a)  The minimum sampling rate is 10000 samples per second.
 b)  Maximum interval between samples is 0.000100 seconds

Example 8.2 Page No : 277

In [2]:
# Variables
W = 5000.;    #Hz

# Calculations and Results
fs = 1.25*2*W;
print 'a)  The sampling rate is %i Hz.'%(fs);
T = 1/fs;    #second
print 'b)  Maximum interval between samples is %f seconds'%(T);
a)  The sampling rate is 12500 Hz.
b)  Maximum interval between samples is 0.000080 seconds

Example 8.3 Page No : 277

In [3]:
# Variables
W = 5000.;    #Hz

# Calculations
fs = 1.25*2*W;
tp = 30*60;   #seconds
N = fs*tp;    #samples

# Results
print 'Total number of samples is %i '%(N);
Total number of samples is 22500000 

Example 8.5 Page No : 281

In [4]:
# Variables
#All frequencies in kHz
f = 1.;
T = 0.1;   #ms
fs = 1/T;

# Calculations and Results
print 'The positive frequencies below 45 kHz are  %i '%(f);
for i in range(1,101):
    x = fs*i;   #x is a variable
    if((x+f) < 45):
        print '%i , %i'%(x-f,x+f);
    else:
        break;
The positive frequencies below 45 kHz are  1 
9 , 11
19 , 21
29 , 31
39 , 41

Example 8.6 Page No : 284

In [5]:
%matplotlib inline
from numpy import zeros,concatenate,array,arange,ones,linspace
from matplotlib.pyplot import plot,suptitle,xlabel,ylabel,subplot
import math 

#All time in milli second
#All frequencies in kHz
fs = 5.;
tau = 0.04;   #ms
T = 1./fs;      #ms
d = tau/T;
# for plot
f = arange(-2,28,.1);
Pn1 = ones(50);
Pn = ones(50)
for i in range(1,6):
    Pn = concatenate((Pn, Pn1*(1-d*i)));

ps1 = ones(20);
for i in range(1,11):
    ps1 = concatenate(([1-i*0.1], ps1, [1-i*0.1]));

ps1 = concatenate((ps1, zeros(10)));
ps = ps1
for i in range(5):
    ps = concatenate((ps, ps1));

Vs = ps*Pn;
plot(f,Vs)#,[5]);
suptitle('(a) Spectrum of signal after sampling')
xlabel('$f,kHz$')
ylabel('$Vs(f)$');
K1 = 0.5;
Bt = K1/tau;
print 'b) Bandwidth required for K1 = %i is %0.1f kHz'%(K1,Bt);
K1 = 1.;
Bt = K1/tau;
print 'Bandwidth required for K1 = %i is %i kHz'%(K1,Bt);
b) Bandwidth required for K1 = 0 is 12.5 kHz
Bandwidth required for K1 = 1 is 25 kHz

Example 8.7 Page No : 288

In [6]:
# Variables
#All frequencies in kHz
k = 7;
W = 1;

# Calculations
Bt = k*W;

# Results
print 'Minimum Bandwidth is %i kHz'%(Bt);
Minimum Bandwidth is 7 kHz

Example 8.8 Page No : 288

In [7]:
# Variables
#All frequencies in kHz
W = 1.;
fs = 1.25*2*W;

# Calculations and Results
Tf = 1./fs;
print 'a) The sampling rate is %.1f kHz'%(fs);
print 'The frame time is %.1f ms'%(Tf);
tau = Tf/16;  #ms
Bt = 0.5/tau;
print 'The pulse width is %i micro second'%(tau*10**3);
print 'The composite baseband bandwidth is %i kHz'%(Bt);
Bt = 2*Bt;
print 'b) The RF bandwidth is %i kHz'%(Bt);
a) The sampling rate is 2.5 kHz
The frame time is 0.4 ms
The pulse width is 25 micro second
The composite baseband bandwidth is 20 kHz
b) The RF bandwidth is 40 kHz

Example 8.9 Page No : 290

In [8]:
# Variables
#All frequencies in kHz
W = 10.;
fs = 2*W;

# Calculations and Results
Tf = 1/fs;
print 'a) The minimum sampling rate is %i kHz'%(fs);
print 'The frame time is %i micro second'%(Tf*10**3);
tr = 0.01*Tf  #ms
Bt = 0.5/tr;
print 'The maximum rise time is %.1f micro second'%(tr*10**3);
print 'The approximate transmission bandwidth is %i kHz'%(Bt);
a) The minimum sampling rate is 20 kHz
The frame time is 50 micro second
The maximum rise time is 0.5 micro second
The approximate transmission bandwidth is 1000 kHz