Chapter 7 : Angle modulation methods

Example 7.1 Page No : 227

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

t = linspace(0,20);
def theta(t):     #function for insmath.tanmath.tanious phase
    return 3*math.pi*t**2;

def frequency(t):     #function for insmath.tanmath.tanious phase
    Ws = 6*math.pi*t;
    return Ws/(2*math.pi);

subplot(2,1,1)
plot(t,theta(t))#,1);
suptitle('Plot1:Insmath.tanmath.tanious signal phase')
xlabel('t')
ylabel('theta')
fs = frequency(t);
subplot(2,1,2)
plot(t,fs)
suptitle('Plot2:Frequency')
xlabel('t')
ylabel('fs')
Out[1]:
<matplotlib.text.Text at 0x110f5a410>

Example 7.2 Page No : 230

In [2]:
# Variables
#v(t) = 80*math.cos[(2*math.pi*10**8*t)+20*math.sin(2*math.pi*10**3*t)]     --eq
#v(t) = A*math.cos[Wc*t+Bmath.sin(Wm*t)]    --eq7-27
#comparing the above 2 equations we get 
A = 80.;     #volts
fc = 10.**8;  #Hz
fm = 10.**3;  #Hz
B = 20.;

# Calculations and Results
print '(a) The carrier cyclic frequency is ',fc,"Hz"
print '(b) The modulating frequency is ',fm,'Hz'
print '(c) The modulation index is ',B
delta_f = B*fm;
print '(d) The frequency deviation is ',delta_f,'Hz'
R = 50.;  #ohm
P = A**2/(2*R);
print '(e) The average power is ',P,'W'
(a) The carrier cyclic frequency is  100000000.0 Hz
(b) The modulating frequency is  1000.0 Hz
(c) The modulation index is  20.0
(d) The frequency deviation is  20000.0 Hz
(e) The average power is  64.0 W

Example 7.3 Page No : 230

In [3]:
# Variables
#from ex 7.2
#v(t) = 80*math.cos[(2*math.pi*10**8*t)+20*math.sin(2*math.pi*10**3*t)]     --eq
B = 20.;

# Calculations
delta_theta = B;   #for PM

# Results
print 'The maximum phase deviation for PM is ',delta_theta
The maximum phase deviation for PM is  20.0

Example 7.4 Page No : 231

In [4]:
# Results
print ('The equation becomes');
print ('v(t) = 80*math.cos[(2*math.pi*10**8*t)+10*math.sin(4*math.pi*10**3*t)]');
The equation becomes
v(t) = 80*math.cos[(2*math.pi*10**8*t)+10*math.sin(4*math.pi*10**3*t)]

Example 7.5 Page No : 231

In [5]:
# Results
print ('The equation becomes');
print ('v(t) = 80*math.cos[(2*math.pi*10**8*t)+20*math.sin(4*math.pi*10**3*t)]');
The equation becomes
v(t) = 80*math.cos[(2*math.pi*10**8*t)+20*math.sin(4*math.pi*10**3*t)]

Example 7.6 Page No : 231

In [6]:
# Variables
delta_f = 12.;   #kHz
fm = 4.;   #kHz

# Calculations
B = delta_f/fm;  #modulating index for FM

# Results
print ('The expression is');
print '(vt) = A*math.cos[2*pi*10**8*t)+%i*math.sin%i*2*pi*10**3*t)]'%(B,fm);
The expression is
(vt) = A*math.cos[2*pi*10**8*t)+3*math.sin4*2*pi*10**3*t)]

Example 7.7 Page No : 231

In [7]:
# Variables
delta_theta = 6.;   #kHz
fm = 5.;   #kHz

# Results
print ('The expression is');
print '(vt) = A*math.cos[2*pi*10**8*t)+%i*math.sin%i*2*pi*10**3*t)]'%(delta_theta,fm);
The expression is
(vt) = A*math.cos[2*pi*10**8*t)+6*math.sin5*2*pi*10**3*t)]

Example 7.8 Page No : 235

In [8]:
# Variables
delta_f = 400.;   #Hz
fm = 2000.;   #Hz

# Calculations and Results
B = delta_f/fm;   #
print 'The modulation index is',B
print ('(For B< = 2.5 , the signal is NBFM)');
Bt = 2*fm;  
print 'The transmission bandwidth Bt =  %i Hz '%(Bt)
The modulation index is 0.2
(For B< = 2.5 , the signal is NBFM)
The transmission bandwidth Bt =  4000 Hz 

Example 7.9 Page No : 235

In [9]:
# Variables
delta_f = 8000;   #Hz
fm = 100.;   #Hz

# Calculations and Results
B = delta_f/fm;   #
print 'The modulation index is',B
print ('(For B> = 50 , the signal is VWBFM)');
Bt = 2*delta_f;  
print 'The transmission bandwidth Bt =  %i Hz '%(Bt)
The modulation index is 80.0
(For B> = 50 , the signal is VWBFM)
The transmission bandwidth Bt =  16000 Hz 

Example 7.10 Page No : 238

In [10]:
# Variables
delta_f = 6.;   #kHz
W = 2.;   #kHz

# Calculations and Results
D = delta_f/W;   #deviation ratio
print 'The deviation ratio is',D
Bt = 2*(delta_f+W);   #carsom's rule is applicable
print 'The transmission bandwidth Bt =  %i kHz '%(Bt)
The deviation ratio is 3.0
The transmission bandwidth Bt =  16 kHz 

Example 7.11 Page No : 239

In [11]:
# Variables
W = 2.;   #kHz  (as in ex 7.10)
delta_theta = 3.;

# Calculations
Bt = 2*(1+delta_theta)*W;   #applying carsom's rule

# Results
print 'The transmission bandwidth Bt =  %i kHz '%(Bt)
The transmission bandwidth Bt =  16 kHz 

Example 7.12 Page No : 239

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

delta_f = 75;   #kHz
fm = array([.025, .075, .75, 1.5, 5, 10, 15])   #in kHz
def Beta(fm,delta_f):
    return delta_f *(1/fm);

def Bandwidth(fm,delta_f):
    Bt = zeros(7)
    Bt[0:3]  =  2 *delta_f;
    for i in range(3,7):
       Bt[i]  =  2 *(delta_f + fm[i]); 
    return Bt

B = Beta(fm,delta_f);
Bt = Bandwidth(fm,delta_f);   #applying carsom's rule
print ('Table - 7.2');
print ('fm(kHz)     Beta       Bt(kHz)');
for i in range(7):
    print '%4.3f         '%(fm[i]),
    print '%4.1f        '%(B[i]),
    print '%i'%(Bt[i]);

plot(fm,Bt);
suptitle('Bandwidth of FM')
xlabel('fm,kHz')
ylabel('Bt,kHz')
Table - 7.2
fm(kHz)     Beta       Bt(kHz)
0.025          3000.0         150
0.075          1000.0         150
0.750          100.0         150
1.500          50.0         153
5.000          15.0         160
10.000           7.5         170
15.000           5.0         180
Out[12]:
<matplotlib.text.Text at 0x110fb06d0>

Example 7.13 Page No : 240

In [16]:
%matplotlib inline
from matplotlib.pyplot import plot,suptitle,xlabel,ylabel
from numpy import array

# Variables
delta_f = 75;   #kHz
fm = array([.025, .075, .75, 1.5, 5, 10, 15])   #in kHz (From prob-7.12)

# Calculations and Results
delta_theta = delta_f/fm[6];
Bt = 12*fm;   #applying carsom's rule
print 'Delta theta = ',delta_theta

plot(fm,Bt);
suptitle('Bandwidth of PM')
xlabel('fm,kHz')
ylabel('Bt,kHz')
Delta theta =  5.0
Out[16]:
<matplotlib.text.Text at 0x111054a50>

Example 7.14 Page No : 242

In [17]:
# Variables
delta_f1 = 2.;   #kHz
fc1 = 100.;      #kHz
W = 5.;          #kHz

# Calculations and Results
fc2 = 3*fc1;
print '(a)  The output center frequency  = ',fc2
delta_f2 = 3*delta_f1;
print '(b)  The output frequency deviation = ',delta_f2

D1 = delta_f1/W;
D2 = 3*D1;
print '(c)  The output deviation ratio  = ',D2
(a)  The output center frequency  =  300.0
(b)  The output frequency deviation =  6.0
(c)  The output deviation ratio  =  1.2

Example 7.16 Page No : 248

In [18]:
# Variables
Kf = 4.;    #kHz/V
f0 = 100.;  #kHz

# Calculations and Results
#  Part a
vm = 2.;   #Volts
delta_f = Kf*vm; #kHz
f = f0+delta_f;      #kHz
print '(a)  The change in frequency is',delta_f,'Corresponding frequwncy to this input is',f

#Part b
vm = -3;   #Volts
delta_f = Kf*vm; #kHz
f = f0+delta_f;      #kHz
print '(b)  In this case,the change in frequency is',delta_f,'Corresponding frequwncy to this input is',f
(a)  The change in frequency is 8.0 Corresponding frequwncy to this input is 108.0
(b)  In this case,the change in frequency is -12.0 Corresponding frequwncy to this input is 88.0

Example 7.17 Page No : 248

In [19]:
import math 
from numpy import array,concatenate,zeros

#All frequencies in kHz
fci = 100.;    #basic center frequency
fco = 100000.;  #output center frequency
delta_f = (3000./3072)*0.025;   #maximum frequency deviation at modulator
W = 15.;
D = delta_f/W;
Bt = 2*W;  
table_row1 = array([fci ,delta_f, D, Bt]);  #At point A
def table(table_row,multiplier):
    return  concatenate((table_row[0:3]*multiplier ,[table_row[3]]))
    
table_row2 = table(table_row1,4);   #at point B
table_row3 = table(table_row2,4);   #at point C
table_row4 = table(table_row3,4);   #at point D

def table1(table_row,multiplier):
    table1 = zeros(4)
    table1[0:3] =  table_row[0:3]*multiplier;
    Bt = 2*(table1[1]+W);  #Applying carsons rule Bt = 2*(delta_f+W)
    table1[3] =  Bt;
    return table1
    

table_row5 = table1(table_row4,3);   #at point E    ,carsons rule applied from here
table_row6 = concatenate(([(fco/16)], table_row5[1:4]));   #at point F  ,center frequency after mixer
table_row7 = table1(table_row6,4);   #at point G
table_row8 = table1(table_row7,4);   #at point H
table_row9 = table_row8;               #at point I
print ('Point    fc      delta_f     D           Bt');
def lay(Point,t_row):
    print " %c    %8.0i"%(Point,t_row[0]),
    for i in range(1,4):
       print "    %3.4f"%(t_row[i]),
    print ""

lay('A',table_row1);
lay('B',table_row2);
lay('C',table_row3);
lay('D',table_row4);
lay('E',table_row5);
lay('F',table_row6);
lay('G',table_row7);
lay('H',table_row8);
lay('I',table_row9);
Point    fc      delta_f     D           Bt
 A         100     0.0244     0.0016     30.0000 
 B         400     0.0977     0.0065     30.0000 
 C        1600     0.3906     0.0260     30.0000 
 D        6400     1.5625     0.1042     30.0000 
 E       19200     4.6875     0.3125     39.3750 
 F        6250     4.6875     0.3125     39.3750 
 G       25000     18.7500     1.2500     67.5000 
 H      100000     75.0000     5.0000     180.0000 
 I      100000     75.0000     5.0000     180.0000 

Example 7.18 Page No : 258

In [20]:
# Variables
#All frequencies in kHz
Kd = 2.;    #V/kHz
fc = 100.;

# Calculations and Results
# part a
f = 102.5;
delta_f = f-fc;
vd = Kd*delta_f;    #V
print '(a)  The first case result is',vd

# part b
f = 98.5;
delta_f = f-fc;
vd = Kd*delta_f;   #V
print '(a)  The second case result is',vd
(a)  The first case result is 5.0
(a)  The second case result is -3.0

Example 7.19 Page No : 261

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

#All frequencies in Hz
D = 5.;     #deviation ratio
fc = array([400., 560., 730., 960.]);    #Center frequency
delta_f = 0.075*fc;     #frequency deviation
W = delta_f/D ;         #modulating frequency
Bt = 2 *(delta_f + W);  #Bandwidth
fl = fc - Bt/2;          #Lower frequency
fh = fc + Bt/2;          #Higher frequency

x = arange(301,1108,1);
y = [1.5];
y = concatenate((y ,zeros(len(arange(302,fl[0]+1)))))
for i in range(3):
    y = concatenate((y ,ones(len(arange(fl[i],fh[i]+1)))));
    y = concatenate((y ,zeros(len(arange(fh[i]+1,fl[i+1]+1)))));

y = concatenate((y, ones(len(arange(fl[3],fh[3]+1)))));
y = concatenate((y, zeros(len(arange(fh[3],1101)))));
print len(x),len(y)
plot(x,y);
suptitle('Composite baseband spectrum')
xlabel('f,Hz');
delta_frt = D*1046;
Brt = 2*(delta_frt+1046);
print '(b)  The RF transmission bandwidth is ',Brt,'Hz'
807 807
(b)  The RF transmission bandwidth is  12552.0 Hz