1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
|
{
"metadata": {
"name": "",
"signature": "sha256:a9273e79f8d5c3c028c517c94bebc1e2c1c9a292aef113298724eb86d1685f66"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 11: Spread Spectrum (SS) and CDMA Systems"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 11.1, Page 322"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable declaration\n",
"CR1=1.2288; #Mcps(Clock rate 1)\n",
"CR2=5.;#Mcps(Clock rate 2)\n",
"R1=9.6; #Information rate in Kbps for CR1\n",
"PG2=256; #Processing Gain for CR2\n",
"\n",
"#Calculations\n",
"PG1=10*math.log10(CR1*10**3/9.6);#Processing Gain for CR1\n",
"R2=CR2*10**3/PG2;#information rate in Kbps for CR2\n",
"\n",
"#Results\n",
"print 'The processing gain for clock rate 1.2288Mcps is %d dB'%PG1\n",
"print 'Improvemrnt in information rate is %.2f Kbps'%(R2-R1);"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The processing gain for clock rate 1.2288Mcps is 21 dB\n",
"Improvemrnt in information rate is 9.93 Kbps\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 11.2, Page 326"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"#From figure 11.5 we get resultant demodulated signal at a mobile;\n",
"Rx=[[1,1,1,1,-3,1],[1,-3,1,1,1,1],[1,-3,1,1,1,-3],[1,-3,1,1,1,1],[-1,3,3,-1,3,-1]];#Resultant demodulated signal at mobile\n",
"\n",
"#from Figure 11.4 \n",
"c1=[[-1,-1,-1,-1,1,1],[1,-1,1,1,-1,-1],[1,-1,1,-1,-1,-1],[-1,1,1,1,-1,1],[1,-1,-1,1,-1,1]];\n",
"c2=[[1,1,-1,1,1,-1],[-1,1,-1,1,-1,-1],[-1,-1,1,1,1,-1],[1,1,-1,-1,1,-1],[1,-1,-1,-1,-1,-1]];\n",
"c3=[[-1,-1,1,-1,1,-1],[-1,-1,-1,1,1,1],[-1,1,1,-1,-1,1],[-1,1,-1,-1,-1,-1],[1,1,1,-1,1,1]];\n",
"\n",
"#Calculations&Results\n",
"#t={[1 2 3 4 5 6];[7 8 9 10 11 12];[13 14 15 16 17 18];[19 20 21 22 23 24];[25 26 27 28 29 30]};\n",
"#for Mobile 1\n",
"for i in range(0,5):\n",
" Demod1=c1[i][0]*Rx[i][0]+c1[i][1]*Rx[i][1]+c1[i][2]*Rx[i][2]+c1[i][3]*Rx[i][3]+c1[i][4]*Rx[i][4]-1\n",
" if(Demod1<0):\n",
" B1=1;\n",
" else:\n",
" B1=0;\n",
"\n",
"#for mobile 2\n",
"for i in range(0,5):\n",
" Demod2=c2[i][0]*Rx[i][0]+c2[i][1]*Rx[i][1]+c2[i][2]*Rx[i][2]+c2[i][3]*Rx[i][3]+c2[i][4]*Rx[i][4]+1;\n",
" if(Demod2<0):\n",
" B2=1;\n",
" else:\n",
" B2=0;\n",
"\n",
"#for mobile 3\n",
"for i in range(0,5):\n",
" Demod3=c3[i][0]*Rx[i][0]+c3[i][1]*Rx[i][1]+c3[i][2]*Rx[i][2]+c3[i][3]*Rx[i][3]+c3[i][4]*Rx[i][4]-1;\n",
" if(Demod3<0):\n",
" B3=1;\n",
" else:\n",
" B3=0;\n",
"\n",
"print \"Value of integration at end of bit period for mobile1\",Demod1\n",
"print \"Value of integration at end of bit period for mobile2\",Demod2\n",
"print \"Value of integration at end of bit period for mobile3\",Demod3\n",
"print \"The recovered signal at mobile 1 is \",B1\n",
"print \"The recovered signal at mobile 2 is \",B2\n",
"print \"The recovered signal at mobile 3 is \",B3\n",
"print \"In all cases, Recovered signal is negated value of transmitted signal\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Value of integration at end of bit period for mobile1 -12\n",
"Value of integration at end of bit period for mobile2 -8\n",
"Value of integration at end of bit period for mobile3 8\n",
"The recovered signal at mobile 1 is 1\n",
"The recovered signal at mobile 2 is 1\n",
"The recovered signal at mobile 3 is 0\n",
"In all cases, Recovered signal is negated value of transmitted signal\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 11.3, Page 332"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable declaration\n",
"BW=100; #in MHz\n",
"Fspac=10; #frequency spacing in kHz\n",
"\n",
"#Calculations\n",
"FreqTones=BW*10**3/Fspac;\n",
"Chips=math.log(FreqTones,2);\n",
"\n",
"#Result\n",
"print 'Minimum number of chips required are %d chips'%Chips"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Minimum number of chips required are 13 chips\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 11.4, Page 332"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable declaration\n",
"R=120; #transmission rate in kbps\n",
"Hop=2000; #per second\n",
"Spectrum=10; #in MHz\n",
"\n",
"#Calculations&Results\n",
"#For 32-FSK\n",
"Bits_sym=math.log(32,2);\n",
"SR=R/Bits_sym;\n",
"print 'Bits per symbol are %d'%Bits_sym\n",
"print 'Hops per second are 2000 and Symbol rate is %d kbps'%SR\n",
"Sym_hop=SR*10**3/Hop;\n",
"Min_BW=Sym_hop*SR;\n",
"Nonoverlap_hop=Spectrum*10**3/Min_BW;\n",
"print 'Symbols transmitted per hop are %d'%Sym_hop;\n",
"print 'Number of non-Overlapping hop frequencies are %d'%(round(Nonoverlap_hop))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Bits per symbol are 5\n",
"Hops per second are 2000 and Symbol rate is 24 kbps\n",
"Symbols transmitted per hop are 12\n",
"Number of non-Overlapping hop frequencies are 35\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 11.5, Page 332"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable declaration\n",
"R=200;#input data rate in bps\n",
"Fhop=200;#per second\n",
"k=1;#Multipication_Factor\n",
"\n",
"#Calculations&Results\n",
"# We have 32-FSK modulation scheme\n",
"Bits_sym=math.log(32,2);\n",
"Rs=Fhop/Bits_sym;\n",
"print 'There are 200 hops per second and Symbol rate is %d symbols per sec'%Rs; \n",
"\n",
"SDur=1/Rs;\n",
"L=Fhop/Rs;\n",
"CDur=SDur/L;\n",
"Separation=1/CDur;\n",
"M=2**Bits_sym;\n",
"Hop_BW=k*M*Fhop*L;\n",
"Gp=M*k*L; \n",
"\n",
"\n",
"print ' Minimum separation between frequency tones should be %d Hz'%Separation;\n",
"print ' Number of different frequency tones produced by a frequency synthesizer are %d'%M;\n",
"print ' Processing Gain is %d'%Gp;\n",
"print 'Hopping bandwidth is %d kHz'%(Hop_BW/1000);"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"There are 200 hops per second and Symbol rate is 40 symbols per sec\n",
" Minimum separation between frequency tones should be 200 Hz\n",
" Number of different frequency tones produced by a frequency synthesizer are 32\n",
" Processing Gain is 160\n",
"Hopping bandwidth is 32 kHz\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 11.6, Page 342"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"M1=[1,0,0,1,1];\n",
"\n",
"Rx1=[[1,1,1,1,-3,1],[1,-3,1,1,1,1],[1,-3,1,1,1,-3],[1,-3,1,1,1,1],[-1,3,3,-1,3,-1],[1,-1,-1,0,0,0]];#Resultant demodulated signal at mobile(Z(t)) from path1\n",
"Rx2=[[-1,-1,1,1,1,1],[-3,1,1,-3,1,1],[1,1,1,-3,1,1],[1,-3,1,-3,1,1],[1,1,-1,3,3,-1],[3,1,-1,0,0,0]];#Resultant demodulated signal at mobile(Z(t-2Tc)) from path2\n",
"Rx=Rx1+Rx2; #since,Z(t)=z(t)+Z(t-2Tc)\n",
"\n",
"#from Figure 11.13 (d) & Figure 11.14\n",
"c1=[[-1,-1,-1,-1,1,1],[1,-1,1,1,-1,-1],[1,-1,1,-1,-1,-1],[-1,1,1,1,-1,1],[1,-1,-1,1,-1,1]];\n",
"c2=[[-1,1,-1,-1,-1,-1],[1,1,1,-1,1,1],[-1,-1,1,-1,1,-1],[-1,-1,-1,1,1,1],[-1,1,1,-1,-1,1],[-1,1,0,0,0,0]];\n",
"\n",
"#Calculations&Results\n",
"#case-1:Z(t)*C1(t);\n",
"for i in range(0,5):\n",
" Demod_1=c1[i][0]*Rx[i][0]+c1[i][1]*Rx[i][1]+c1[i][2]*Rx[i][2]+c1[i][3]*Rx[i][3]+c1[i][4]*Rx[i][4]+c1[i][5]*Rx[i][5];\n",
" if(Demod_1<0):\n",
" B1=1;\n",
" else:\n",
" B1=0;\n",
"\n",
"#case-2:Z(t)*C1(t-2Tc);\n",
"for j in range(0,5):\n",
" Demod_2=c2[j][2]*Rx[j][2]+c2[j][3]*Rx[j][3]+c2[j][4]*Rx[j][4]+c2[j][5]*Rx[j][5]+c2[j+1][0]*Rx[j+1][0]+c2[j+1][1]*Rx[j+1][1]-10\n",
" if(Demod_2<0):\n",
" B2=1;\n",
" else:\n",
" B2=0;\n",
"\n",
"print \"case-1:z(t)*c1(t)\";\n",
"print \"Value of integration at end of bit period for mobile(case-1)\",Demod_1\n",
"print \"The recovered signal at mobile(case-1) is \",B1\n",
"print \"Actual bit values are\",M1\n",
"print \"Recovered and actual values are not matching\",\n",
"\n",
"print \"\\n\\ncase-2:z(t)*c1(t-2Tc)\"\n",
"print \"Value of integration at end of bit period for mobile(case-2)\",Demod_2\n",
"print \"The recovered signal at mobile(case-2) is \",B2\n",
"print \"Actual bit values are\",M1\n",
"print \"Recovered and actual values are not matching\",\n",
"\n",
"#case3-Sum of path1 and path2\n",
"print \"\\n\\ncase-3:Sum of path1 & path2 integrator\"\n",
"Demod_3=Demod_1+Demod_2;\n",
"print \"Sum of integrator outputs(rake receiver output)\",Demod_3\n",
"\n",
"for k in range(0,5):\n",
" if(Demod_3<0):\n",
" B3=1;\n",
" else:\n",
" B3=0;\n",
" \n",
"print \"Detected bit value \",B3\n",
"print \"Actual bit values are\",M1\n",
"print \"Recovered and actual values are matching\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"case-1:z(t)*c1(t)\n",
"Value of integration at end of bit period for mobile(case-1) -12\n",
"The recovered signal at mobile(case-1) is 1\n",
"Actual bit values are [1, 0, 0, 1, 1]\n",
"Recovered and actual values are not matching \n",
"\n",
"case-2:z(t)*c1(t-2Tc)\n",
"Value of integration at end of bit period for mobile(case-2) -12\n",
"The recovered signal at mobile(case-2) is 1\n",
"Actual bit values are [1, 0, 0, 1, 1]\n",
"Recovered and actual values are not matching \n",
"\n",
"case-3:Sum of path1 & path2 integrator\n",
"Sum of integrator outputs(rake receiver output) -24\n",
"Detected bit value 1\n",
"Actual bit values are [1, 0, 0, 1, 1]\n",
"Recovered and actual values are matching\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 11.7, Page 360"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"Prm=-97;#the signal strength from the base stations in dBm\n",
"#The constant ( K ) is the part of the broadcast message that is sent to the mobile by the base station on the paging channel.\n",
"K=-73; #dB\n",
"P2=18; #power as directed by BS (dBm)\n",
"\n",
"#Calculations&Results\n",
"Ptm=K-Prm;\n",
"print 'The mobile transmitter power be set as a first approximation of %d dBm'%Ptm\n",
"Pwr_Redu=Ptm-P2;#power reduction\n",
"print 'Power reduction = %d dBm'%Pwr_Redu\n",
"Time=6*1.25;\n",
"print 'Time required by mobile station to make changes as directed by base station is %.1f msec'%Time\n",
" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The mobile transmitter power be set as a first approximation of 24 dBm\n",
"Power reduction = 6 dBm\n",
"Time required by mobile station to make changes as directed by base station is 7.5 msec\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 11.8, Page 362"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable declaration\n",
"P1=-95; #pilot1 in dBm\n",
"P2=-100; #pilot2 in dBm\n",
"P3=-101; #pilot3 in dBm\n",
"P4=-105; #pilot4 in dBm\n",
"P5=-102; #pilot in dBm\n",
"NoiseP=-107; #Receiver sensitivity(dBm)\n",
"Tadd=-13; #dB\n",
"\n",
"#Calculations&Results\n",
"#Pcj = received power of the jth pilot in the candidate set\n",
"# Pai= received power of the ith pilot in the active set \n",
"Pa1=P1-NoiseP;\n",
"Pa2=P2-NoiseP;\n",
"Pa3=P3-NoiseP;\n",
"Pa4=P4-NoiseP;\n",
"Pc5=P5-NoiseP;\n",
"\n",
"X=10*math.log10(10**(0.1*Pa1)+10**(0.1*Pa2)+10**(0.1*Pa3)+10**(0.1*Pa4)+10**(0.1*Pc5)); \n",
"print \"Since P1>P2>P3>P4, we replace P4\"\n",
"T_COMP=(P5-P4)/0.5;\n",
"print 'The value of T-COMP that could trigger the mobile station to generate a PSMM should be <= %d dB (<= %d)'%(T_COMP,round(10**(0.1*T_COMP)));\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Since P1>P2>P3>P4, we replace P4\n",
"The value of T-COMP that could trigger the mobile station to generate a PSMM should be <= 6 dB (<= 4)\n"
]
}
],
"prompt_number": 8
}
],
"metadata": {}
}
]
}
|