{
"metadata": {
"name": "",
"signature": "sha256:b436f6c7efcfe44aefe53a71d9fd5898f0588601d695fbac95eee4b2051b4d00"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 4 : Angle Modulation"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.2 Page No : 199"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"#Given angle modulated signal is x = 3*math.cos[2*pi*(10**6)*t+2*math.sin(2*pi*10**3*t)]\n",
"\n",
"#So, phase of the angle modulates signal is Q = 2*pi*(10**6*t)+2*math.sin(2*pi*(10**3)*t)\n",
"\n",
"#Insmath.tanmath.taneous frequency = dQ/dt = 2*pi*(10**6)+ 4*pi*(10**3)*math.sin(2*pi*(10**3)*t)\n",
"\n",
"#For Insmath.tanmath.taneous frequency at 0.25ms, Substituting t = 0.25ms in Insmath.tanmath.taneous frequency\n",
"#Insmath.tanmath.taneous frequency is expressed as f1_rad for frequency in radians per second\n",
"f1_rad = 2*math.pi*(10**6)+ 4*math.pi*(10**3)*math.sin(2*math.pi*(10**3)*0.00025)\n",
"\n",
"#Insmath.tanmath.taneous frequency is expressed as f1_hz for frequency in hertz\n",
"f1_hz = f1_rad/(2*math.pi)\n",
"\n",
"print 'the Instantaneous frequency at time t = 0.25ms is ',f1_rad,' rad/sec = ',f1_hz,' Hz'\n",
"\n",
"#For Insmath.tanmath.taneous frequency at 0.25ms, Substituting t = 0.5ms in Insmath.tanmath.taneous frequency \n",
"#Insmath.tanmath.taneous frequency is expressed as f2rad for frequency in radians per second\n",
"f2_rad = 2*math.pi*(10**6)+ 4*math.pi*(10**3)*math.sin(2*math.pi*(10**3)*0.0005)\n",
"\n",
"#Insmath.tanmath.taneous frequency is expressed as f2hz for frequency in hertz\n",
"f2_hz = f2_rad/(2*math.pi)\n",
"\n",
"print 'the Instantaneous frequency at time t = 0.5ms is ',f2_rad,' rad/sec = ',f2_hz,' Hz'\n",
"\n",
"#Maximum phase deviation = max[2*math.sin(2*pi*(10**3)*t)] = 2*1\n",
"maxDp = 2;\n",
"\n",
"print 'Maximum phase deviation is ',maxDp,' rad'\n",
"\n",
"#Maximum frequency deviation = max[4*pi*(10**3)*math.sin(2*pi*(10**3)*t)] = 4*pi*(10**3)*1\n",
"maxDf = 4*math.pi*(10**3)*1;\n",
"\n",
"print 'Maximum frequency deviation is %.4f'%maxDf,' Hz'\n",
"#print ('in rad',maxDf,'Maximum frequency deviation is')\n",
"\n",
"#In the textbook the calculated value of max frequency devaition is = 2000 Hz, in reality the value = 12566.371 Hz \n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the Instantaneous frequency at time t = 0.25ms is 6295751.67779 rad/sec = 1002000.0 Hz\n",
"the Instantaneous frequency at time t = 0.5ms is 6283185.30718 rad/sec = 1000000.0 Hz\n",
"Maximum phase deviation is 2 rad\n",
"Maximum frequency deviation is 12566.3706 Hz\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.4 Page No : 208"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"\n",
"#Given modulating signal m(t) = 2*math.sin(2*pi*(10**3)*t), B for phase modulation Bp = 10 & for fequency modulation Bf = 10\n",
"Bp = 10.\n",
"Bf = 10.\n",
"#So Amplitude of modulating signal is Am = 2 metres\n",
"Am = 2.\n",
"#Frequency of modulating signal is fm = 1000 hertz\n",
"fm = 1000.\n",
"\n",
"#Bandwidth = 2*(1+B)*fm\n",
"#Bandwidth for phase modulation with modulating signal m(t) is bw_pm = 2*(1+Bp)*fm\n",
"bw_pm = 2.*(1+10)*1000\n",
"#Bandwidth for frequency modulation with modulating signal m(t) is bw_fm = 2*(1+Bf)*fm\n",
"bw_fm = 2*(1+10)*1000.\n",
"\n",
"print 'Bandwidth for phase modulation ',bw_pm,' Hz'\n",
"print 'Bandwidth for frequency modulation ',bw_fm,' Hz'\n",
"\n",
"#Bandwidth for phase & frequency modulation if frequency of modulating signal is doubled i.e fm = 2000 hertz\n",
"\n",
"#Bp & Bf after frequency of modulating signal is doubled\n",
"\n",
"#Bp = kp*Am, observing the equation as there is no change in amplitude Bp = 10\n",
"Bp = 10.\n",
"#Bf = kf*Am/fm, observing the equation as there is change in frequency Bf = 10/2 = 5\n",
"Bf = 5.\n",
"\n",
"#Bandwidth for phase modulation if frequency of modulating signal is doubled is bw_double_pm = 2*(1+Bp)*fm\n",
"bw_double_pm = 2.*(1+10)*2000\n",
"#Bandwidth for frequency modulation if frequency of modulating signal is doubled is bw_double_fm = 2*(1+Bf)*fm\n",
"bw_double_fm = 2*(1+5)*2000.\n",
"\n",
"print 'Bandwidth for phase modulation for doubled frequency ',bw_double_pm,' Hz'\n",
"print 'bandwidth for frequency modulation for doubled frequency ',bw_double_fm,' Hz'\n",
"\n",
"#Bandwidth for phase & frequency modulation if amplitude of modulating signal is halfed i.e Am = 1 metre\n",
"\n",
"#Bp & Bf after amplitude of modulating signal is halfed\n",
"\n",
"#Bp = kp*Am, observing the equation as there is change in amplitude Bp = 10/2 = 5\n",
"Bp = 5\n",
"\n",
"#Bf = kf*Am/fm, observing the equation as there is change in amplitude Bf = 5/2 = 2.5\n",
"Bf = 2.5\n",
"\n",
"#Bandwidth for phase modulation if frequency of modulating signal is doubled is bw_halfed_pm = 2*(1+Bp)*fm\n",
"bw_halfed_pm = 2*(1+5)*2000\n",
"\n",
"#Bandwidth for frequency modulation if frequency of modulating signal is doubled is bw_halfed_fm = 2*(1+Bf)*fm\n",
"bw_halfed_fm = 2*(1+2.5)*2000\n",
"\n",
"print 'Bandwidth for phase modulation for halfed amplitude ',bw_halfed_pm,' Hz'\n",
"print 'Bandwidth for frequency modulation for halfed amplitude ',bw_halfed_fm,' Hz'\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Bandwidth for phase modulation 22000.0 Hz\n",
"Bandwidth for frequency modulation 22000.0 Hz\n",
"Bandwidth for phase modulation for doubled frequency 44000.0 Hz\n",
"bandwidth for frequency modulation for doubled frequency 24000.0 Hz\n",
"Bandwidth for phase modulation for halfed amplitude 24000 Hz\n",
"Bandwidth for frequency modulation for halfed amplitude 14000.0 Hz\n"
]
}
],
"prompt_number": 2
}
],
"metadata": {}
}
]
}