optical_fiber_communication

76
Scilab Code for Optical Fiber Communication by Gerd Keiser 1 Created by Prof. R. Senthilkumar Institute of Road and Transport Technology rsenthil [email protected] Cross-Checked by Prof. Saravanan Vijayakumaran, IIT Bombay [email protected] 11 January 2011 1 Funded by a grant from the National Mission on Education through ICT, http ://s poken-tutorial.o rg/N MEICT- Int ro. This Te xt Book Compa nion and Scilab codes written in it can be downloaded from the website www.scilab.in

Upload: thiago-duarte

Post on 08-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 1/76

Scilab Code for

Optical Fiber Communication

by Gerd Keiser 1

Created byProf. R. Senthilkumar

Institute of Road and Transport Technologyrsenthil [email protected]

Cross-Checked byProf. Saravanan Vijayakumaran, IIT Bombay

[email protected]

11 January 2011

1Funded by a grant from the National Mission on Education through ICT,http://spoken-tutorial.org/NMEICT-Intro. This Text Book Companion andScilab codes written in it can be downloaded from the website www.scilab.in

Page 2: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 2/76

Book Details

Authors: G. Keiser

Title: Optical Fiber Communication

Publisher: Tata McGrawHill

Edition: 4th Edition, 8th Reprint

Year: 2010

Place: New Delhi

ISBN: 0-07-064810-7

1

Page 3: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 3/76

Scilab numbering policy used in this document and the relation to theabove book.

Exa Example (Solved example)

Fig Code for Figure(Scilab code that is used for plotting the respective figureof the above book )

For example, Exa 4.56 means solve example 4.56 of the above book.

2

Page 4: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 4/76

Contents

List of Scilab Codes 4

1 First chapter 2

2 Second chapter 7

3 Third chapter 11

4 Fourth chapter 16

5 Fifth chapter 22

6 Sixth chapter 26

7 Seventh chapter 31

8 Eight chapter 35

9 Ninth chapter 40

10 Tenth chapter 46

11 Eleventh chapter 54

12 Twelve chapter 59

13 Thirteen chapter 64

14 Fourteen chapter 68

3

Page 5: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 5/76

List of Scilab Codes

Exa 1.1 Program to calculate time period and phase shift . . . 2Exa 1.2 Example 1.2 . . . . . . . . . . . . . . . . . . . . . . . 3Exa 1.4 Shannon Channel Capacity formula . . . . . . . . . . 3Exa 1.5 Capacity of a channel using Shannon’s formula . . . . 4Exa 1.6 Program to calculate attenuation loss of power . . . . 5Exa 1.7 Power gain calculation for a signal travelling from one

point to another point . . . . . . . . . . . . . . . . . . 5Exa 2.1 Critical Angle of incidence . . . . . . . . . . . . . . . 7Exa 2.2 Finding Critical angle, numerical aperture, acceptance

angle . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Exa 2.3 Program to Calculate NORMALIZED FREQUENCY

’V’ and Numerical Aperture . . . . . . . . . . . . . . . 8Exa 2.4 Power flow in the core and cladding of step index fiber 8

Exa 2.5 Program to calculate Fiber Birefringence Betaf  . . . 9Exa 3.1 Program to Find Attenuation in dB/km . . . . . . . 11Exa 3.2 To calculate input and output power in dBm . . . . . 11Exa 3.3 Rayleigh scattering loss . . . . . . . . . . . . . . . . . 12Exa 3.4 Program to calculate percent in decrease of number of 

modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Exa 3.5 Calculation of pulse broadening . . . . . . . . . . . . 13Exa 3.6 Calculation of bandwidth distance . . . . . . . . . . . 14Exa 3.7 Program to Find out the Material Dispersion . . . . . 14Exa 3.8 Program to Find out Waveguide Dispersion . . . . . . 15Exa 4.1 Program to find intrinsic carrier concentration . . . . 16

Exa 4.3 Finding Enegy gap and Wavelength . . . . . . . . . . 16Exa 4.4 Finding Enegy gap and Wavelength . . . . . . . . . . 17Exa 4.5 To find out the Internal Quantum Efficiency and Inter-

nal Power level of LED source . . . . . . . . . . . . . . 17

4

Page 6: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 6/76

Exa 4.6 External Quantum Efficiency in percentage . . . . . . 18

Exa 4.7 Program to find Lasing Threshold gain . . . . . . . . 19Exa 4.8 Program TO Calculate Frequency Spacing and Wave-length Spacing . . . . . . . . . . . . . . . . . . . . . . 19

Exa 4.9 Calculation of number of half-wavelengths and wave-length spacing between lasing modes . . . . . . . . . . 20

Exa 5.1 Calculation of Lateral power distribution coefficient . 22Exa 5.2 Program to Calculate Optical Power Emitted from the

Light source and Optical power coupled to step-indexfiber . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Exa 5.3 Fresnel reflection, power coupled and power loss . . . 23Exa 5.4 Power coupled between two graded index fibers . . . . 24

Exa 5.5 Loss between single mode fibers due to Lateral mis-alignment . . . . . . . . . . . . . . . . . . . . . . . . . 24

Exa 5.6 Loss between single mode fibers due to angular mis-alignment . . . . . . . . . . . . . . . . . . . . . . . . . 25

Exa 6.1 Cut-off wavelength of photodiode . . . . . . . . . . . 26Exa 6.2 Calculation of Quantum efficiency . . . . . . . . . . . 26Exa 6.3 Calculation of photocurrent . . . . . . . . . . . . . . 27Exa 6.4 Calculation of Responsivity of photodiode . . . . . . 27Exa 6.5 To find primary photocurrent and multiplication factor 28Exa 6.6 Mean-square shot noise current, Mean-square dark cur-

rent and Mean-Square thermal noise current . . . . . . 29Exa 6.7 Circuit bandwidth of a photodiode . . . . . . . . . . 30Exa 7.1 To find optimum decision threshold . . . . . . . . . . 31Exa 7.2 To find out signal-to-noise ratio and probability of error

for given ’Q’ . . . . . . . . . . . . . . . . . . . . . . . 31Exa 7.3 Plotting Bit Error Rate versus Q factor . . . . . . . . 33Exa 7.4 To find the energy of the photon incident on photodiode

and Minimum incident optical power . . . . . . . . . . 34Exa 8.1 Program to calculate the Total Optical Power loss . . 35Exa 8.2 Program to calculate the system margin . . . . . . . 35Exa 8.3 Program to calculate link rise time . . . . . . . . . . 36

Exa 8.4 Program to calculate link rise time . . . . . . . . . . 36Exa 8.5 Calculation of Number of bits affected by a burst error 37Exa 8.6 Program to find coefficients of generator polynomial . 37Exa 8.7 Program to find CRC(Cyclic Redundancy Check) . . 38Exa 8.8 Program to percentage of burst error detected by CRC 39

5

Page 7: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 7/76

Exa 8.9 Percent overhead to the information stream Using Reed-

Solomon code for error correction . . . . . . . . . . . . 39Exa 9.1 Program to find Relative Intensity Noise (RIN) . . . . 40Exa 9.2 Program to Find limiting conditions for pin-photodiode 40Exa 10.1 Finding the center wavelength . . . . . . . . . . . . . 46Exa 10.2 Finding mean frequency spacing . . . . . . . . . . . . 46Exa 10.3 Program to find coupling ratio, Excess loss, Insertion

loss, Return loss of 2x2 Fiber coupler . . . . . . . . . . 47Exa 10.5 Finding output powers at output port of 2x2 coupler 48Exa 10.6 Program to find waveguide length . . . . . . . . . . . 48Exa 10.7 Program to find Excess loss, Splitting loss and total loss 49Exa 10.8 Program to Waveguide Length difference . . . . . . . 49

Exa 10.9 Fiber Bragg Grating: Peak Reflectivity, Coupling coef-ficient, full-bandwidth . . . . . . . . . . . . . . . . . . 50

Exa 10.10 Phased-Array-Based-Devices: Channel spacing in termsof wavelength and path-length difference . . . . . . . . 51

Exa 10.11 Phased-Array-Based Devices: Length difference betweenadjacent array waveguides . . . . . . . . . . . . . . . . 52

Exa 10.12 Maximum number of channels that can be placed inthe tuning range . . . . . . . . . . . . . . . . . . . . . 53

Exa 11.1 Program to calculate Photon density . . . . . . . . . 54Exa 11.2 Pumping rate and zero-signal gain . . . . . . . . . . . 54

Exa 11.3 Maximum input power and maximum output power . 55Exa 11.6 Optical Signal-to-noise ratio (OSNR) . . . . . . . . . 56Exa 11.7 Pump power of EDFA . . . . . . . . . . . . . . . . . 56Exa 11.8 OSNR for different ASE noise level . . . . . . . . . . 57Exa 11.9 Noise penalty factor . . . . . . . . . . . . . . . . . . . 57Exa 11.10 Upper bound on input optical signal power . . . . . . 58Exa 12.1 Effective length of fiber . . . . . . . . . . . . . . . . . 59Exa 12.2 Calculation of Stimulated Brillouin Scattering (SBS)

threshold power . . . . . . . . . . . . . . . . . . . . . 59Exa 12.3 Four-wave mixing-calculation of power generated due

to the interaction of signals at different frequencies . . 60

Exa 12.4 Full-width Half-Maximum (FWHM) soliton pulse nor-malized time . . . . . . . . . . . . . . . . . . . . . . . 61

Exa 12.5 Calculation of normalized distance parameter for dis-persion shifted fiber . . . . . . . . . . . . . . . . . . . 61

Exa 12.6 Program to calculate soliton peak power . . . . . . . 62

6

Page 8: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 8/76

Exa 12.7 FWHM soliton pulse width and fraction of bit slot oc-

cupied by a soliton . . . . . . . . . . . . . . . . . . . . 62Exa 13.1 Calculation of power budget for optical link . . . . . . 64Exa 13.2 Calculation of Number stations for given loss . . . . . 65Exa 13.3 Calculation of worst case Dynamic Range . . . . . . . 66Exa 13.4 Calculation of power margin between transmitter and

receiver for Star architectures . . . . . . . . . . . . . . 66Exa 13.5 Determination of maximum length of multimode fiber

link . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67Fig 14.10 Performance Measurement and Monitoring for sce . . 68

1

Page 9: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 9/76

Page 10: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 10/76

21 // 1 . 0 0 0D−09

22 // p ha se s h i f t i n d e g r e e s23 // 9 0 .24 // p ha se s h i f t i n r a d i an s25 // 1 . 5 7 0 6 8 0 6

Scilab code Exa 1.2 Example 1.2

1 / / C ap ti on : Program t o c a l c u l a t e t im e p e r i o d and p ha s es h i f t

2 // Example1 . 13 / / P ag e 84 clear ;5 clc ;

6 close ;

7 f1 = 1 0^ 5; // f1 = 100KHz8 f2 = 1 0^ 9; // f2 = 1GHz9 T1 = 1/ f1 ;

10 T2 = 1/ f2 ;

11 p hi = ( 1/ 4) * 3 6 0;

12 p h i_ r ad = p hi / 5 7 .3 ;

13 disp ( T 1 , ’ Time p e r i od o f s i n e wave w it h f r eq u e nc y =

100 KHZ ’ )14 disp ( T 2 , ’ Time p e r i od o f s i n e wave w it h f r eq u e nc y = 1GHZ ’ )

15 disp ( p h i , ’ p ha se s h i f t i n d e gr e e s ’ ) ;

16 disp (phi _rad , ’ p ha se s h i f t i n r a di a n s ’ ) ;

17 / / R e s u l t18 / /Time p e r i o d o f s i n e wave w it h f r e q u e n c y = 10 0 KHZ19 // 0 . 0 0 0 0 120 / /Time p e r i o d o f s i n e wave w it h f r e q u e n c y = 1GHZ21 // 1 . 0 0 0D−0922 // p ha se s h i f t i n d e g r e e s

23 // 9 0 .24 // p ha se s h i f t i n r a d i an s25 // 1 . 5 7 0 6 8 0 6

3

Page 11: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 11/76

Scilab code Exa 1.4

1 / / C a p t i o n : S ha nn on C h an n el C a p a c i t y f o r m u l a2 // Example1 . 43 / / p ag e 1 24 clear ;

5 clc ;

6 close ;

7 B = 10 ^6 ; / / B an dw id th o f n o i s y c h a n n e l 1 0MHZ8 S_N = 1; / / s i g n a l−to−n o i s e r a t i o n i s 19 C = B * log2 ( 1 + S _ N ) ;

10 disp (C , ’ The maximum c a p a c i t y f o r t h i s c h a nn e l i nb i t s / s e c C = ’ )

11 / / R e s u l t12 / /The maximum c a p a c i t y f o r t h i s c h a nn e l i n b i t s / s e c

C = 1 0 0 0 0 0 0 .

Scilab code Exa 1.51 / / C a p ti o n : C a p a ci t y o f a c h a n n e lu s i n g s ha nn on ’ s f o r m u l a

2 // Example1 . 53 / / p ag e 1 24 clear ;

5 clc ;

6 close ;

7 f Lo w = 3 * (1 0 ^6 ) ; / / l o w f r e q u e n c y = 3MHz8 f Hi gh = 4 *( 1 0^ 6) ; / / h i h g f r e q u e n c y = 4MHz9 S _N _d B = 2 0; / / s i g n a l −to−n o i s e r a t i o 20 dB

10 S _N = 1 0^ ( S _ N_ dB / 1 0) ;

11 B = fHigh - fLow ;

12 C = B * log2 ( 1 + S _ N ) ;

13 disp (B , ’ B a nd wi dt h i n Hz B = ’ )

14 disp (C , ’ C ap ac it y o f a c h an n el i n b i t s / s e c s C = ’ )

15 disp ( S _ N , ’ s i g n a l t o n o i s e r a t i o S/N = ’ )

16 / / R e s u l t17 // Bandwidth i n Hz B = 1 00 00 00 .18 // C ap ac it y o f a c ha nn el i n b i t s / s e c s C =

6 6 5 8 2 1 1 . 519 // s i g n a l to n o i s e r a t i o S/N = 1 0 0 .

4

Page 12: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 12/76

Scilab code Exa 1.61 / / C a p ti o n : Pro gra m t o c a l c u l a t ea t t e n u a ti o n ( o r ) l o s s o s power

2 / / E xa mp le 1 . 63 / / p ag e 1 44 clear ;

5 clc ;

6 close ;

7 P 1 = 1; / / o ne w at t8 P2 = P1 /2; // r ed uc ed by h a l f v a lu e

9 A t te n_ d B = 1 0* log10 ( P 2 / P 1 ) ;10 disp (At ten_dB , ’ A t t en u a t io n i n dB = ’ ) ;

11 p o w er _ l os t = 1 0 ^( A t t e n _ dB / 1 0)

12 disp (power_lost , ’ The amount o f power l o s t = ’ ) ;

13 / / R e s u l t14 / / A t t e n u a t i o n i n dB = − 3 . 0 1 0 315 // The amount o f power l o s t = 0 . 5

Scilab code Exa 1.71 / / C ap ti on : Power g a i n c a l c u l a t i o nf o r a s i g n a l t r a v e l l i n g from

2 // one p o in t t o a no th er p o in t3 / / E xa mp le 1 . 74 / / p ag e 1 45 clear ;

6 clc ;

7 close ;

8 L o ss _ li n e1 = -9 ; //−9 dB9 A m p_ g ai n 2 = 1 4; / / 1 4 d B

10 L o ss _ li n e3 = -3 ; //−3 dB11 d B _ at _ l i ne 4 = L o s s _l i n e 1 + A m p _ ga i n 2 + L o s s _ li n e 3 ;

12 disp (dB_at_line4 , ’ The amount o f p ow er g a i n e d by as i g n a l t r a v e l l i n g from p oi nt 1 t o p oi nt 4 i n dB = ’)

13 / / R e s u l t

5

Page 13: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 13/76

14 // The amount o f power g a in e d b y a s i g n a l t r a v e l l i n g

from p o i n t 1 t o p o i n t 4 i n dB = 2 .

6

Page 14: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 14/76

Chapter 2

Second chapter

Scilab code Exa 2.1

1 // C a pt io n : C r i t i c a l A ng le o f i n c i d e n c e2 / / E xa mp le 2 . 13 / / p ag e 3 74 clear ;

5 close ;

6 clc ;

7 n1 = 1 .4 8;

8 n2 = 1 .0 0;

9 p hi c = asin ( n 2 / n 1 ) ;10 disp ( p h i c * 5 7 . 3 , ’ T o t a l I n t e r f l e c t i o n r e f l e c t i o n a ng le

: c r i t i c a l a n g l e o f i n c i d e n c e i n d e g r e e s ’ )

11 / / R e s u l t12 // T ot al I n t e r f l e c t i o n r e f l e c t i o n a n g l e : c r i t i c a l

a n gl e o f i n c i d e n c e 4 2. 5 09 77 3

Scilab code Exa 2.21 // C a pt io n : F in d in g C r i t i c a l a ng le ,n u me r ic a l a p er t ur e , a c ce p ta n c e a n g l e

2 / / E xa mp le 2 . 23 / / p ag e 4 54 clear ;

5 close ;

6 clc ;

7

Page 15: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 15/76

7 n1 = 1 .4 8; // c o re r e f r a c t i v e i nd ex

8 n2 = 1 .4 6; / / c l a d d i n g i n d ex9 p hi c = asin ( n 2 / n 1 ) * 5 7 . 3 ;

10 NA = sqrt ( n1 ^ 2 - n 2 ^2 ) ;

11 p hi 0 = asin ( N A ) * 5 7 . 3 ;

12 disp ( p h i c , ’ C r i t i c a l a n lg e ’ )

13 disp ( N A , ’ n u m e ri c a l a p e r t u r e ’ )

14 disp ( p h i 0 , ’ a c ce pt a nc e a n ge l i n a i r ’ )

15 / / R e s u l t16 // C r i t i c a l a n lg e17 // 8 0 . 5 7 5 9 2 718 / / n u m e ri c a l a p e r t u r e

19 // 0 . 2 4 2 4 8 7 120 // a c c e p t a n ce a n ge l i n a i r21 // 1 4 . 0 3 4 4 1 2

Scilab code Exa 2.31 / / C a p ti o n : Pro gra m t o C a l c u l a t eNORMALIZED FREQUENCY ’V’ and Nu me ri ca l Ap er tu re

2 // Example2 . 33 / / P ag e 5 84 c l ea r a ll ;

5 close ;6 clc ;

7 a = 25 e -0 6;

8 L a m bd a = 1 30 0 e - 0 9 ;

9 V = 26 .6 ;

10 N u m e r ic a l _ Ap e r t u re = V * L a m b da / ( 2 * % p i * a )

11 disp (Numerical_Aperture , ” N u me ri ca l A p er tu r e i s ” ) ;

12 disp ( M = ( V ^2 ) /2 , ’ T o t a l number o f mod es M e n t e r i n gt h e f i b e r i s : ’ )

13 / / R e s u l t14 // Nu m er i ca l A pe r t ur e i s : 0 .2 20 14 31

15 // T ot al number o f modes M e n t e r i n g t he f i b e r i s :3 5 3 . 7 8

8

Page 16: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 16/76

Scilab code Exa 2.41 / / C a p ti o n : Power f l o w i n t h e c o r e and

c l ad d i n g o f s te p−

i nd ex f i b e r2 / / E xa mp le 2 . 43 / / p ag e 6 24 clear ;

5 close ;

6 clc ;

7 V = [ 22 , 3 9] ;

8 M = V ^ 2/ 2;

9 P c l ad d _ P = ( 4 /3 ) * ( M . ^ ( - 0 .5 ) ) ;

10 P c or e _P = 1 - P c la d d_ P ;

11 disp (M , ’ T o t a l n um be r o f m od es ’ )

12 disp ( P c l a d d _ P * 1 0 0 , ’ P e r ce n t a ge o f p ower p r o p a g a t es i nt he c l a d d i ng ’ )

13 / / R e s u l t14 / / T o t a l number o f mod es15 // 2 4 2 . 7 6 0 . 516 // P er ce nt ag e o f power p r o p ag a te s i n t he c l ad d i ng17 // 8 . 5 7 0 9 9 1 3 4 . 8 3 4 9 1 8 2

Scilab code Exa 2.51 / / C ap ti on : Program t o c a l c u l a t e

F i be r B i r e f r i n g e n c e BETA f  2 // Example2 . 53 / / p ag e 6 54 c l ea r a ll ;

5 close ;

6 clc ;

7 L am b da = input ( ’ E nt er t h e w a ve l en g th o f O p t i c a lS i g n a l ’ ) ;

8 Lp = input ( ’ Be at Le ngt h ’ ) ;

9 B E T A _f _ F O RM U L A 1 = 2 * % pi / L p ;

10 disp (BETA _f_FORMULA1 , ”The f i b e r b i r e f r i e n g e n c e u si ng

f o rm u l a 1 ”) ;11 B E T A _f _ F O RM U L A 2 = L a m bd a / L p ;

12 disp (BETA _f_FORMULA2 , ”The f i b e r b i r e f r i e n g e n c e u si ngf o rm u l a 2 ”) ;

13 / / R e s u l t

9

Page 17: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 17/76

14 // E n te r t he w av el en gt h o f O p t i ca l S i g n a l 1 30 0 e−09

15 / / B ea t L en gt h 8 e−

0216 // The f i b e r b i r e f r i e n g e n c e u si ng f or mu la 17 8 . 5 3 9 8 1 6

17 // The f i b e r b i r e f r i e n g e n c e u si ng f or mu la 20 . 0 0 0 0 1 6 2

10

Page 18: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 18/76

Chapter 3

Third chapter

Scilab code Exa 3.1

1 / / C a p t i o n : P ro gr am t o F in d A t t e n u a t i o n i n dB/km2 // Example3 . 13 / / p ag e 9 14 clear ;

5 clc ;

6 z = [1 2]; // d i a t an c e s a re i n k i l o me t e r7 a l p h a _i n _ d B_ p e r _ km = 3 ;

8 r = ( a l p h a _ i n_ d B _ p er _ k m * z ) / 1 0;

9 P 0_ Pz = ( 10 ^ r ) ;10 for i = 1: length ( P 0 _ P z )

11 P z_ P0 ( i ) = 1 - (1 / P 0_ Pz ( i ) ) ;

12 end

13 disp ( P z _ P 0 * 1 0 0 , ’ O p ti c al s i g n a l power d e cr e as e d by i np e r c e n t a g e ’ )

14 //RESULT15 // O p t i ca l s i g n a l power d e c re a s ed by i n p e r ce n t ag e16 // 4 9 . 8 8 1 2 7 717 // 7 4 . 8 8 1 1 3 6

Scilab code Exa 3.21 / / C ap ti on : To C a l c u l a t e i n p u t ando u t p u t p ow er i n dBm

2 // Example3 . 2

11

Page 19: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 19/76

3 / / p ag e 9 1

4 clear ;5 close ;

6 clc ;

7 P in = 2 00 e - 0 6; // power l au nc he d i n t o t he f i b e r8 a lp ha = 0 .4 ; / / a t t e n u a t i o n i n dB p e r KM9 z = 30; // o p t i c a l f i b e r l e ng t h 30 KM

10 P in _d Bm = 1 0* log10 ( P i n / 1 e - 0 3 ) ;

11 P o ut _d B m = 1 0* log10 ( P i n / 1 e - 0 3 ) - a l p h a * z ;

12 P o ut = 1 0 ^( P o u t_ d B m / 1 0)

13 disp (Pin _dBm , ’ Pin dBm ’ )

14 disp (Po ut_dBm , ’ Pout dBm ’ )

15 disp ( P o u t * 1 e - 0 3 , ’ O u tp ut p ow er i n w a t ts ’ )16 / / R e s u l t17 //P in dBm = − 6 . 9 8 9 718 //Pout dBm = − 1 8 . 9 8 9 719 // Output power i n w at ts = 0 . 00 0 0 12 6

Scilab code Exa 3.31 // C a pt io n : R a yl e ig h s c a t t e r i n g l o s s2 // Example3 . 33 / / p a g e 9 7

4 clear ;5 close ;

6 clc ;

7 a l ph a _0 = 1 .6 4; / / a t t e n u a t i o n a t La mb da 0 i n dB /KM8 L a mb da _ 0 = 8 50 e - 0 9; / / w a v el e n g th 8 50 n an om et er9 L am b da = 1 31 0 e - 09 ; / / w a v e l e n g t h 1 3 5 0 n a no m et e r

10 a l p h a_ L a m bd a = a l p ha _ 0 * ( ( L a m b da _ 0 / L a m bd a ) ^ 4 ) ;

11 disp (alpha_Lambda , ’ R ay le ig h s c a t t e r i n g l o s s a lp ha (Lambda) = ’ )

12 / / R e s u l t13 / / R a y le i g h s c a t t e r i n g l o s s a l ph a ( Lambda ) = 0 . 2 9 0 6 92 9

Scilab code Exa 3.41 / / C a p ti o n : Pro gra m t o c a l c u l a t ep e r ce n t i n d e c r e a s e o f number o f modes

12

Page 20: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 20/76

2 / / E xa mp le 3 . 4

3 / / p ag e 9 94 clear ;

5 clc ;

6 a lp ha = 2; // g ra de d i n de x p r o f i l e7 n2 = 1. 5; / / c l a d d i n g8 L am da = 1 .3 e - 0 6; // w av e l e ng t h9 R = 0. 01 ; // bend r a d i u s o f c u r va t u re

10 a = 25 e -0 6; // c or e r a di u s11 d el ta = 0 .0 1; // cor e−c l a d d i ng i nd ex p r o f i l e12 k = 4 .8 3 e0 6; / / p r o p a g a t i o n c o n s t a n t13 disp (k , ’ k = ’ )

14 p ar t1 = ( 2* a / R )+ floor ( ( 3 / ( 2 * n 2 * k * R ) ) ^ ( 2 / 3 ) ) ;15 p a rt 2 = ( a l p ha + 2 ) / ( 2 * a l p ha * d e l t a ) ;

16 N e f f_ N i nf = 1 - p a r t1 * p a r t 2 ;

17 disp ( ’ n umber o f modes d e c r e a s e d by ’ )

18 disp ( ’ P er ce n t i n g ra ded−i nd ex f i b e r ’ , N e f f _ N i n f * 1 0 0 )

19 //RESULTS20 // number o f modes d e c re a s ed by 50 P er ce nt i n g ra ded

−i nd ex f i b e r

Scilab code Exa 3.5

1 // C a pt io n : C a l c u l a t i o n o f p u l s e b ro a de ni n g2 // Example3 . 53 / / p ag e 1 034 clear ;

5 clc ;

6 close ;

7 C = 3 e 0 8 ; // f r e e s pa ce v e l o c i t y i n me t r e / s e c8 n1 = 1 .4 8; // c o re r e f r a c t i v e i nd ex9 n 2 = 1 .4 65 ; // c l ad d i n g r e f r a c t i v e i nd ex

10 d el ta = 0 .0 1; // i nd ex d i f f e r e n c e

11 L = 10 ^3 ; / / f i b e r l e n g t h 1 0KM12 d e l ta T = ( L * ( n 1 ^ 2) / ( C * n 2 ) ) * d e lt a ;

13 disp ( ( d e l t a T / L ) * 1 0 ^ 1 2 , ’ p u l s e b r o a d e n i ng i n n s /KM ’ )

14 / / R e s u l t15 / / p u l s e b r o ad e n in g i n n s /KM = 4 9 . 8 3 8 45 3

13

Page 21: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 21/76

Scilab code Exa 3.6

1 // C a p ti on : C a l c u l a t i o n o f b an dw id th d i s t a n c e2 // Example3 . 63 / / p ag e 1 044 clear ;

5 clc ;

6 close ;

7 n1 = 1 .4 8; // c o re r e f r a c t i v e i nd ex8 n 2 = 1 .4 65 ; // c l a d d i n i g r e f r a c t i v e i nd ex9 d el ta = 0 .0 1; // i nd ex d i f f e r e n c e

10 C = 3 *( 1 0^ 8 ) ; // f r e e s pa ce v e l c o t i y11 B L = ( n 2 /( n 1 ^ 2) ) * ( C / de lt a ) ;

12 disp ( B L , ’ B an dwidth d i s t a n c e i n bPS−M’ )

13 disp ( B L / 1 0 ^ 9 , ’ B an dw id th d i s t a n c e i n MbPS−KM’ )

14 / / R e s u l t15 / / Ba nd wi dt h d i s t a n c e i n bPS−M16 // 2 . 0 0 6D+1017 / / B an dw id th d i s t a n c e i n MbPS−KM18 // 2 0 . 0 6 4 8 2 8

Scilab code Exa 3.71 / / C a p t i o n : P ro gr am t o F in d o u t t h eM a t er i a l D i s p e r s i o n

2 // Example3 . 73 / / p a g e 1 0 74 clear ;

5 clc ;

6 L am da = 8 00 e - 0 9; / / W a ve le n gt h i n m e te r7 s i g m a_ L a m da _ L E D = 4 0 e - 09 ; // s p e c t r a l w id th i n m et er s8 p u l s e_ s p r ea d = 4 . 4 e - 12 ; / / p u l s e s p r ea d i n s e c / m et er

9 m a t _ di s p e rs i o n = p u l se _ s p re a d / s i g m a _ L a md a _ L ED10 disp (mat_d ispersion , ’ m a t er i a l d i s p e r s i o n i n s e c on ds /s q u a r e m e te r ’ )

11 / / R e s u l t12 // m a t e r i a l d i s p e r s i o n i n s e co n ds / s q ua r e m et er

14

Page 22: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 22/76

0 . 0 0 0 1 1

Scilab code Exa 3.81 / / C a p t i o n : P ro gr am t o F in d o u tWa veg ui de D i s p e r s i o n

2 // Example3 . 83 / / p a g e 1 1 04 clear ;

5 clc ;

6 n2 = 1 .4 8; // i n de x o f c l a d d i ng7 d el ta = 0 . 00 2; // i nd ex d i f f e r e n c e8 L am da = 1 32 0 e - 09 ; / / W av el en gt h i n m e t er s9 V _ dV b_ d V = 0 .2 6; // The v al ue i n s q u ar e b r ac k e t s f o r

v = 2 . 410 C = 3 e0 8 ;// E n t e r t h e v e l o c i t y o f l i g h t i n f r e e s p ac e11 D w g _L a m da = - (( ( n 2 * d el t a ) / C ) * (1 / L a m da ) ) * V _ d V b _ dV

12 disp ( D w g _ L a m d a * 1 e 0 6 , ’ The w a ve gu id e d i s p e r s i o n i n p s /nm.km’ ) ;

13 //RESULTS14 // The wa ve gu id e d i s p e r s i o n i n p s /nm . km = −

1 . 9 4 3 4 3 4 3

15

Page 23: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 23/76

Chapter 4

Fourth chapter

Scilab code Exa 4.11 / / C a p t i o n : P ro gr am t o f i n d i n t r i n s i cc a r r i e r c o nc e n t r a t i o n

2 // Example4 . 13 / / p a g e 1 3 64 clear ;

5 close ;

6 clc ;

7 m = 9 .1 1 e -3 1; // E l e c tr o n r e s t mass i n kg8 m e = 0 .0 68 * m; // E f f e c t i v e e l e c t r o n mass kg9 m h = 0 .5 6* m ; // E f f e c t i v e h o l e mass i n kg

10 E g = 1 . 42 * 1. 6 02 1 8 e - 19 ; //band−gap e ne rg y i n v o l t s11 k B = 1 . 38 0 54 e - 2 3; / / B ol tz ma ’ s c o n s t a n t12 T = 3 0 0 ; // room t e m pe r a tu r e i n k e l v i n13 h = 6 .6 25 6 e - 34 ; / / P l an c k ’ s c o n s t a n t14 K = 2 * (( 2 * % p i * k B * T /( h ^ 2 ) ) ^ 1 . 5) * ( ( m e * m h ) ^ 0 .7 5 ) ; //

c h a r a c t e r i s t i c c on st an t o f m a t e r i a l15 n i = K * %e ^ ( - Eg / ( 2* k B * T )) ;

16 disp ( n i , ’ i n t r i n s i c c a r r i e r c o n c e n t r a t i o n i n c u b i cmeter ’ )

17 / / R e s u l t18 / / i n t r i n s i c c a r r i e r c o n c e n t r a t i o n i n c ub e m et er

2.551D+12

16

Page 24: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 24/76

Scilab code Exa 4.3

1 / / C a p t i o n : F i n d i n g E neg y g ap a nd W a ve le ng t h2 // Example4 . 33 / / p a g e 1 4 64 clear ;

5 close ;

6 clc ;

7 x = 0. 07 ; / / c o m p o s i t i o n a l p a ra m et er o f GaAlAs8 E g = 1 . 4 2 4+ 1 . 2 66 * x + 0 . 2 6 6* x ^ 2 ;

9 L am da = 1 . 24 0/ E g ;

10 disp ( E g , ’ Band E ne rg y g ap i n e v ’ )

11 disp ( L a m d a , ’ W a ve le ng t h i n m i c r o m e t e r s ’ )

12 / / R e s u l t13 // Band Energy gap i n ev 1 . 5 1 3 9 23 414 / / W av el en gt h i n m i cr o m e te r s 0 . 8 1 9 0 63 9

Scilab code Exa 4.4

1 / / C a p t i o n : F i n d i n g E neg y g ap a nd W a ve le ng t h2 // Example4 . 43 / / p a g e 1 4 64 clear ;

5 close ;

6 clc ;

7 y = 0. 57 ; / / c o m p o s i t i o n a l p a ra m et er o f InGaAsP8 E g = 1 . 35 - 0 . 7 2 * y + 0 . 12 * ( y ^ 2 ) ;

9 L am da = 1 . 24 0/ E g ;

10 disp ( E g , ’ Band E ne rg y g ap i n e v ’ )

11 disp ( L a m d a , ’ W a ve le ng t h i n m i c r o m e t e r s ’ )

12 / / R e s u l t13 // Band E nerg y g ap i n ev 0 . 9 78 5 8 814 / / W av el en gt h i n m i cr o m e te r s 1 . 2 6 7 1 31 8

Scilab code Exa 4.5

1 // C a p ti on : To f i n d o ut t h e I n t e r n a l QuantumE f f i c i e n c y and I n t e r n a l Power l e v e l o f LED s o u r ce

2 // Example4 . 5

17

Page 25: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 25/76

3 / / p a g e 1 4 9

4 clear ;5 clc ;

6 t uo _r = 3 0e - 0 9; // r a d i a t i v e r e co m b in a ti o n i n s e co n d s7 t u o _n r = 1 00 e - 0 9 ; //non−r a d i a t i v e r ec om bi na t i on i n

s e c o n d s8 E t t a _i n t e rn a l = 1 / (1 + ( t u o _r / t u o _ n r ) ) ; // i n t e r n a l

quantum e f f i c i e n c y9 h = 6 .6 25 6 e - 34 ; / / P la nk ’ s c o n s t a n t

10 C = 3 e 0 8 ; / / v e l o c i t y i n m/ s e c11 q = 1 .6 02 e - 19 ; // e l e c t r o n c ha r ge i n c ou lo mb s12 I = 40 e -0 3; / / d r i v e c u r r e n t i n Amps

13 L am da = 1 31 0 e - 09 ; / / p ea k w a v e l e n g t h o f InGaAsP LED14 P i n te r n al = ( E t t a _ i nt e r n al * (( h * C ) / q ) ) * ( I / L am d a ) ; //

i n t e r n a l power l e v e l15 disp (Pinternal , ’THE INTERNAL POWER GENRATED WITH IN

LED SOURCE IN WATTS I S ’ ) ;

16 disp (Etta_in ternal , ’ The i n t e r n a l Quantum e f f i c i e n c yf o r t h e g iv en r a d i a t i v e and n on−r a d i a t i v er e co m b in a ti o n t im e i s ’ ) ;

17 disp ( E t t a _ i n t e r n a l * 1 0 0 , ’ I n t e r n a l Quantum E f f i c i e n c yi n P e r ce n t ag e ’ ) ;

18//RESULT19 //THE INTERNAL POWER GENRATED WITH IN LED SOURCE IN

WATTS I S20 / / 0 . 0 2 9 1 4 2 721 // The i n t e r n a l Quantum e f f i c i e n c y f o r t he g i v en

r a d i a t i v e and non−r a d i a t i v e r ec om bi na t i o n t im e i s0 . 7 6 9 2 3 0 8

22 / / I n t e r n a l Quantum E f f i c i e n c y i n P e r ce n t ag e23 / / 7 6 . 9 2 3 07 7

Scilab code Exa 4.61 / / C a p t i o n : E x t e r n a l QuantumE f f i c i e n c y i n p e r ce nt a g e

2 / / E xa mp le 4 . 63 / / p a g e 1 5 14 clear ;

18

Page 26: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 26/76

5 close ;

6 clc ;7 n = 3 . 5 ; // r e f r a c t i v e i nd ex o f an LED8 E t t a _E x t e rn a l = 1 /( n * ( n + 1 ) ^ 2) ;

9 disp ( E t t a _ E x t e r n a l * 1 0 0 , ’ E x t e r na l E f f i c i e n c y i np e r c e n t a g e ’ )

10 / / R e s u l t11 // E x te rn al E f f i c i e n c y i n p e r ce nt ag e 1 .4 10 93 47

Scilab code Exa 4.7

1 / / C a pt i on : Pr og ram t o f i n d L a s i n g T h r es h o l d g a i n

2 // Example4 . 73 / / p a g e 1 5 64 clear ;

5 clc ;

6 L = 5 00 e - 06 ; // L a se r d i od e l e n g t h i n m et er s7 R1 = 0. 32 / / r e f l e c t i o n c o e f f i c i e n t v a l u e o f o ne en d ;8 R2 = 0. 32 / / r e f l e c t i o n c o e f f i c i e n t v a l u e o f a n o t h e r

end ;9 a l p ha _ b ar = 1 0/ 1 e - 0 2 ; // a b s o r p t i o n c o e f f i c i e n t ;

10 a l p ha _ e nd = ( 1 /( 2 * L ) ) * log ( 1 / ( R 1 * R 2 ) ) ; // m i rr o r l o s si n t h e l a s i n g c a v i t y

11 a l p h a_ t h r es h o l d = a l p ha _ b ar + a l p ha _ e nd ; // t o t a l l o s s12 disp (alph a_threshold , ” The T h r es h o l d G ai n p e r m et re ” )

13 a l p h a _t h r e sh o l d _ cm = a l p h a _t h r e s ho l d / 1 0 0

14 disp ( a l p h a _ t hr e s h o ld _ c m , ” The T h r es h o l d Ga in p e rc e n t i m e t r e ” ) ;

15 / / R e s u l t16 / / The T h r es h o l d G ai n p e r m et re 3 2 7 8 . 8 6 8 617 / /The T h re s ho l d Gain p e r c e n t i m e t r e 3 2 . 7 8 8 68 6

Scilab code Exa 4.81 / / C a p t i o n : P ro gr am TO C a l c u l a t eF r e qu e n cy S p a c i n g & W a v el e ng t h S p a c i n g

2 // Example4 . 83 / / p a g e 1 6 04 clear ;

19

Page 27: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 27/76

5 clc ;

6 L am da = 8 50 e - 9 / / E m i s s i o n w a v e l e n g t h o f LASER d i o d e7 n = 3.7 / / r e f r a c t i v e i n d ex o f LASER d i o d e8 L = 500 e -6 / / l e n g t h o f LASER d i o d e9 C = 3 e 0 8 // v e l o c i t y o f L ig ht i n f r e e s pa ce

10 d e l t a_ f r e qu e n c y = C / ( ( 2* L ) * n ) ;

11 d e l ta _ L a md a = ( L a m da ^ 2 ) / ( ( 2 * L ) * n );

12 H a lf _ po w er = 2 e - 09 ; / / h a l f p ower p o i n t 3 n an om et er13 s ig ma = sqrt ( - ( H a l f _ p o w e r ^ 2 ) / ( 2 * log ( 0 . 5 ) ) ) ;

14 disp (delt a_frequency , ’ E nt er t he f r e qu e n cy s p a c in g i nH e r t z ’ ) ;

15 disp (delta_Lamda , ’ E nt er t he w ae le ng th s p a ci n g i n

m e t r e s ’ ) ;16 disp ( s i g m a , ’ s p e c t r a l w i d th o f t he g ai n ’ ) ;

17 //RESULT18 // E n te r t he f r e qu e n cy s p a c in g i n H er tz19 // 8 . 10 8D+1020 // E n te r t he w ae le ng th s p a c in g i n m et re s21 // 1 .9 53D−1022 // s p e c t r a l w i d th o f t he g ai n23 // 1 . 6 9 9D−09

Scilab code Exa 4.91 / / C a p ti o n : C a l c u a l t i o n o f number o f  h a l f  −w a v el e n gt h s and w a ve l en g th s p a c i n g b et we enl a s i n g modes

2 // Example4 . 93 / / p a g e 1 6 14 clear ;

5 clc ;

6 close ;

7 L am b da = 9 00 e - 0 9; // w av el en gt h o f l i g t h e mi tt ed byl a s e r d io da

8 L = 3 00 e - 06 ; // l en gt h o f l a s e r c h ip9 n = 4 . 3 ; // r e f r a c t i v e i nd ex o f t h e l a s e r m a te r i a l

10 m = 2 * L* n / L am b da ; / / number o f h a l f  −w a v e l e n g t h s11 d e l t a_ L a m bd a = ( L a m b da ^ 2 ) / ( 2 * L * n ) ; // w av e l e ng t h

s p a c i n g

20

Page 28: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 28/76

12 disp (m , ’ n umber o f h a l f  −w a v el e n g th s s p an n in g t h e

r e g i o n b et wee n m i rr o r s u r f a c e s ’ )13 disp (delta_Lambda , ’ s p a ci n g b et wee n l a s i n g modes i s ’ )

14 / / R e s u l t15 / / number o f h a l f  −w a ve l en g th s s pa nn in g t he r e g i o n

bet w ee n m ir ro r s u r f a c e s 2 86 6. 66 6716 // s p ac i n g bet w e en l a s i n g modes i s 3 . 14 0D−10

21

Page 29: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 29/76

Chapter 5

Fifth chapter

Scilab code Exa 5.11 // C a pt io n : C a l c u l a t i o n o f L a t e r a lp o we r d i s t r i b u t i o n c o e f f i c i e n t

2 // Example5 . 13 / / p a g e 1 9 24 clear ;

5 clc ;

6 close ;

7 phi = 0; // l a t e r a l c o o r d i n a te8 H a lf _ po w er = 1 0; / / h a l f p ow er beam w i dt h9 t et a = H a lf _ po w er / 2 ;

10 t e ta _r a d = t et a / 5 7. 3;

11 L = log ( 0 . 5 ) / log ( cos ( t e t a _ r a d ) ) ;

12 disp (L , ’ L a t e r a l p ow er d i s t r i b u t i o n c o e f f i c i e n t L= ’ )

13 / / R e s u l t14 / / L a t e r a l p ow er d i s t r i b u t i o n c o e f f i c i e n t L =

1 8 1 . 8 3 3 0 3

Scilab code Exa 5.21 / / C a p ti o n : Pro gra m t o C a l c u a l t e

O p t i c a l Power E mi tt ed f ro m t h e L i g h t s o u r c e andO p t i ca l power c ou p le d t o s te p−i nd ex f i b e r

2 // Example5 . 23 / / p a g e 1 9 44 clear ;

22

Page 30: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 30/76

5 close ;

6 clc ;7 r s = 35 e -0 6; // t he s o u r ce r a d i u s i n m et er8 a = 25 e -0 6; // t h e c or e r a d i i o f s t e p−i nd ex f i b e r

me t e r9 NA = 0 .2 0; // t he n u me r ic a l a p e r tu r e v a lu e

10 B o = 1 50 e 04 ; // r a d i a n c e i n W/ s q u a r e m et er . s r11 P s = ( ( %p i ^ 2) * ( r s ^2 ) ) * Bo ; / / po wer e m i tt e d by t h e

s o u r c e12 if ( r s <= a ) then

13 P L ED _ st e p = P s *( N A ^ 2) ;

14 elseif ( r s > a ) then

15 P L E D_ s t ep = ( (( a / r s ) ^ 2 ) * Ps ) * ( N A ^ 2 ) ;16 end

17 disp ( P s , ’ O p t i c a l p ower e m i tt e d by LED l i g h t s o u r c eP s = ’ )

18 disp (PLED_step , ’ O p t i c a l Power c o u pl e d i n t o s t e pi n d ex f i b e r i n Watts PLED step = ’ ) ;

19 //RESULT20 / / O p t i c a l p ower e m i tt e d by LED l i g h t s o u r c e Ps =

0 . 0 1 8 1 3 5 421 // O p ti c al Power c ou pl ed i n t o s t ep i nd ex f i b e r i n

Watts P LED step = 0 . 0 0 0 3 7 01

Scilab code Exa 5.31 / / C ap ti on : F r e s n e l r e f l e c t i o n , p ow erc o up l ed and power l o s s

2 // Example5 . 33 / / p a g e 1 9 44 clear ;

5 clc ;

6 close ;

7 n 1 = 3. 6; // r e f r a c t i v e i nd ex o f o p t i c a l s o u r c e

8 n = 1. 48 ; // r e f r a c t i v e i nd ex o f s i l i c a f i b e r9 R = ( ( n1 - n ) / ( n1 + n ) ) ^2 ;

10 L = -10* log10 ( 1 - R ) ;

11 disp (L , ’ Power l o s s i n dB L = ’ )

12 / / R e s u l t

23

Page 31: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 31/76

13 // Power l o s s i n dB L = 0 . 8 31 0 3 22

Scilab code Exa 5.41 / / C a p t i o n : P ow er c o u p l e d b e t w ee n t wog ra de d i nd ex f i b e r s

2 // Example5 . 43 / / p a g e 2 0 54 clear ;

5 clc ;

6 close ;

7 a = 1e - 0 6; // c o re r a d i i i n m et er s8 d = 0 .3 *a ; // a x i a l o f f s e t9 P T_ P = ( 2/ % p i ) *( acos ( d / ( 2 * a ) ) - ( 1 - ( d / ( 2 * a ) ) ^ 2 ) ^ 0 . 5 * ( d

/ ( 6 * a ) ) * ( 5 - 0 . 5 * ( d / a ) ^ 2 ) ) ;

10 P T_ P_ dB = 1 0* log10 ( P T _ P )

11 disp (PT_ P_dB , ’ O p t i c a l p ower c o u pl e d f ro m f i r s t f i b e ri n t o s ec o nd f i b e r i n dB i s = ’ )

12 / / R e s u l t13 / / O p t i c a l p ower c o u pl e d fr om f i r s t f i b e r i n t o s e co n d

f i b e r i n dB i s = − 1 . 2 5 9 7 8 1 3

Scilab code Exa 5.51 / / C ap ti on : L o ss b et we en s i n g l e modef i b e r s due t o L a t e r a l m is al ig nm en t

2 // Example5 . 53 / / p ag e 2 114 clear ;

5 clc ;

6 close ;

7 V = 2 .4 05 ; / / n o r m a l i z e d f r e q u e n c y8 n 1 = 1 .4 7; // c o re r e f r a c t i v e i nd ex9 n 2 = 1 .4 65 ; // c l ad d i ng r e f r a c t i v e i nd ex

10 a = ( 9/ 2) * 1 0^ - 0 6; // c o re r a d i i i n m et er s11 d = 1e - 06 ; // l a t e r a l o f f s e t i n m e t e r s12 W = a * ( 0 . 6 5 +1 . 6 1 9* V ^ ( - 1 .5 ) + 2 . 8 79 * V ^ - 6 ) ;

13 L sm = -1 0* log10 ( exp ( - ( d / W ) ^ 2 ) ) ;

14 disp (W , ’mode− f i e l d d i a m e t e r i n m e t er s W = ’ ) ;

24

Page 32: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 32/76

15 disp ( L s m , ’ L os s bet w e en s i n g l e mode o p t i c a l f i b e r s

due t o l a t e r a l o f f s e t Lsm = ’ )16 / / R e s u l t17 //mode− f i e l d d i a m e t e r i n m e te r s W = 0 . 0 0 0 0 04 918 // L os s b et w ee n s i n g l e mode o p t i c a l f i b e r s due t o

l a t e r a l o f f s e t Lsm = 0 . 17 75 79 7

Scilab code Exa 5.61 / / C a p ti o n : L o s s b et we en s i n g l e modef i b e r s due t o a n gu l a r m is al ig nm en t

2 // Example5 . 63 / / p a g e 2 1 24 clear ;

5 clc ;

6 close ;

7 clear ;

8 clc ;

9 close ;

10 V = 2 .4 05 ; / / n o r m a l i z e d f r e q u e n c y11 n 1 = 1 .4 7; // c o re r e f r a c t i v e i nd ex12 n 2 = 1 .4 65 ; // c l ad d i ng r e f r a c t i v e i nd ex13 a = ( 9/ 2) * 1 0^ - 0 6; // c o re r a d i i i n m et er s

14 d = 1e - 06 ; // l a t e r a l o f f s e t i n m e t e r s15 W = a * ( 0 . 6 5 +1 . 6 1 9* V ^ ( - 1 .5 ) + 2 . 8 79 * V ^ - 6 ) ; //mode− f i e l d

d i a m e t e r16 te ta = 1; / / i n d e g r e e s17 t et a = 1 / 57 .3 ; / / i n r a d a i a n s18 L am b da = 1 30 0 e - 09 ; / / w a v el e n g th i n m e t er s19 L s m_ a ng = - 10 * log10 ( exp ( - ( % p i * n 2 * W * t e t a / L a m b d a ) ^ 2 ) ) ;

20 disp (Lsm _ang , ’ L os s b et we en s i n g l e mode f i b e r s due t oa n g u l a r m i s al i g nm e n t Lsm ang = ’ )

21 / / R e s u l t22 // L os s b et w ee n s i n g l e mode f i b e r s due t o a n gu l ar

m i s a l i g n m en t L sm a ng = 0 . 4 0 5 4 6 5 8

25

Page 33: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 33/76

Chapter 6

Sixth chapter

Scilab code Exa 6.1

1 // Capt ion : Cut−o f f w av el en gt h o f p h ot o di o de2 // Example6 . 13 / / p a g e 2 2 44 clear ;

5 clc ;

6 close ;

7 h = 6 . 62 5* ( 10 ^ - 3 4) ; / / p l a n k s c o n s t a n t8 C = 3 *( 10 ^8 ) ; // f r e e s pa ce v e l o c i t y9 E g = 1 .4 3 *1 . 6* ( 10 ^ - 1 9 ) ; / / j o u l e s

10 L a mb d aC = h * C / Eg ;

11 disp (Lam bdaC , ’Cut−o f f Wa vel eng th o f p h ot o di o de i nm e t e r s = ’ )

12 / / R e s u l t13 //Cut−o f f W av el en gt h o f p h o to d i o de i n m e te r s=

0 . 0 0 0 0 0 0 9

Scilab code Exa 6.2

1 // C a pt io n : C a l c u l a t i o n o f Quantum e f f i c i e n c y2 // Example6 . 23 / / p ag e 2 264 clear ;

5 clc ;

26

Page 34: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 34/76

Page 35: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 35/76

11 e tt a = 0 .9 ; // quantum e f f i c i e n c y 9 0%

12 h = 6 .6 2 5* 10 ^ - 3 4; / / p l a n k s c o n s t a n t13 R = ( e tt a * q) / ( h* v ) ; / / R e s p o n s i v i t y14 disp (R , ’ R e s p o n s i v i t y o f p h o to d i o de a t 1 33 0nm i n A/W

R = ’ )

15 Eg = 0 .7 3; // e ne rg y gap i n e l e c t r o n v o l t s16 L a mb d aC = 1 .2 4/ E g ; / / c u t−o f f w av el en gt h i n m et er s17 disp (Lam bdaC , ’ cu t−o f f w av el en gt h i n m et er s = ’ )

18 / / R e s u l t19 / / R e s p o n s i v i t y o f p h o t o d i o d e a t 1 3 30nm i n A/W R =

0 . 9 4 1 8 8 6 820 / / c u t−o f f w av el en gt h i n m et er s = 1 .6 9 8 63 0 1

Scilab code Exa 6.51 / / C a p ti o n : To f i n d p r im a ryp h ot o cu r r e n t and m u l t i p l i c a t i o n f a c t o r

2 // Example6 . 53 / / p a g e 2 3 04 clear ;

5 clc ;

6 close ;

7 e tt a = 0 .6 5; / / quantum e f f i c i e n c y o f s i l i c o n

q a v a l a n c he p h o t o d i o d e8 C = 3 *( 10 ^8 ) ; // f r e e s pa ce v e l o c i t y i n m/ s9 L am b da = 9 00 e - 0 9; / / w a v el e n g th i n m e t er s

10 q = 1 .6 *( 10 ^ - 1 9) ; / / c h a r g e i n c ou l om b s11 h = 6 . 62 5* ( 10 ^ - 3 4) ; / / p l a n k s c o n s t a n t12 v = C / La mb da ; // f r e q u n e cy i n Hz13 P in = 0 .5 *1 0^ - 0 6 ; // o p t i c a l p ower14 I p = ( ( et ta * q ) /( h * v )) * P in ;

15 I m = 1 0* (1 0^ - 0 6 ) ; / / m u l t i p l i e d p h o t o c u r r en t16 M = I m / I p ; // m u l t i p l i c a t i o n f a c t o r17 disp ( I p * 1 0 ^ 6 , ’ P r im a ry p h o t o c u r r e n t i n uAmps I p= ’ )

18 disp ( ceil ( M ) , ’ Pr im ary p h o to c u rr e n t i s m u l t i p l i e d bya f a c t o r o f M = ’ )

19 / / R e s u l t20 // P ri ma ry p h o t o cu r r en t i n uAmps I p = 0 . 23 5 4 71 7

28

Page 36: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 36/76

21 // P ri mar y p h ot o cu r r e nt i s m u l t i p l i e d by a f a c t o r o f  

M = 4 3 .

Scilab code Exa 6.61 // Capt ion :Mean−s qu ar e s ho t n o i s ec u r r e n t , Mean−s q u a re d ar k c u r r e n t and Mean−S q u a r e

t he rm al n o i s e c u r r e nt2 // Example6 . 63 / / p ag e 2 344 clear ;

5 clc ;

6 close ;

7 L am b da = 1 33 0 e - 09 ; / / w a v el e n g th i n m e t er s8 I D = 4 e -0 9; / / p h o t o d i o d e c u r r e n t9 e tt a = 0 .9 0; // quantum e f i c i e n c y

10 RL = 1 00 0; / / Load r e s i s t a n c e 1 00 0 ohms11 P in = 3 00 e - 0 9; // i n c i d e n t o p t i c a l power i s 300 nano

w a t t s12 B e = 2 0* (1 0^ 6) ; / / r e c e i v e r b an dw id th13 q = 1 .6 *( 10 ^ - 1 9) ; / / c h a r g e i n c ou l om bs14 h = 6 .6 2 5* 10 ^ - 3 4; / / p l a n k s c o n s t a n t15 v = ( 3 * 10 ^ 8 ) / L a m bd a ; / / f r e q u e n c y i n Hz16 I p = ( e tt a * q * Pi n ) /( h * v );

// p r i ma ry p h o t o c u r re n t17 I sh ot = 2 * q* I p * Be ; / / s h o t−n o i s e c u r r e nt18 I sh ot = sqrt ( I s h o t ) ;

19 I DB = 2 * q* I D * Be ; // d a rk c u r r e n t20 IDB = sqrt ( I D B ) ;

21 T = 2 8 3 ; // room t e m pe r a tu r e i n k e l v i n22 K B = 1 .3 8 *1 0^ - 2 3 ; / / b o lt zm a nn ’ s c o n s t a n t23 RL = 1 00 0; // l oa d r e s i s t a n c e24 I T = ( 4* K B * T) * Be / R L ;/ / Therma l n o i s e c u r r e n t25 IT = sqrt ( I T ) ;

26 disp ( I p * 1 0 ^ 6 , ’ p ri ma ry p h o t o c u r re n t i n uA IP = ’ )

27 disp ( I s h o t * 1 0 ^ 9 , ’mean−

s qu ar e s ho t n o i se c u r r e n t f o ra p in p ho to di od e i n nA I s h o t = ’ )

28 disp ( I D B * 1 0 ^ 9 , ’mean−s q u a r e d ar k c u r r e n t i n nA IDB= ’ )

29 disp ( I T * 1 0 ^ 9 , ’mean−s q u ar e t he rm al n o i s e c u r r e nt f o rt h e r e c e i v e r i n nA IT =’ )

29

Page 37: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 37/76

30 / / R e s u l t

31 // p r im ar y p h o to c u rr e n t i n uA IP = 0 . 28 9 0 86 832 //mean−s qu ar e s ho t n o i se c u r r e n t f o r a p i np ho to di od e i n nA I s h o t = 1 . 3 60 2 04 2

33 //mean−s q ua r e d ar k c u r r en t i n nA IDB = 0 . 1 634 //mean−s qu ar e t he r ma l n o i se c u r r e n t f o r t he r e c e i v e r

i n n A I T = 1 7 . 6 7 5 7 4 6

Scilab code Exa 6.7

1 // C a p ti on : c i r c u i t b an dw id th o f a p h o to d i od e2 // Example6 . 73 / / p ag e 2 394 clear ;

5 clc ;

6 close ;

7 C P = 3 *1 0^ - 1 2; // p ho to di od e c a p ac i t an c e i s 3 p i cof a r a d

8 C A = 4 *1 0^ - 1 2; // a m p l i f i e r c a pc i ta n c e i s 4 p i c o f a r ad9 CT = CP + CA ; // t o t a l c a p a c i t a nc e

10 R T1 = 1 00 0; // p h ot o di o de l o ad r e s i s t a n c e11 B C1 = 1 /( 2* % p i * RT 1 * CT ) ; // c i r c u i t b an dw id th

12 RT2 = 50; // p h ot o di o de l o ad r e s i s t a n c e13 B C2 = 1 /( 2* % p i * RT 2 * CT ) ; / / c i r c u i t b an dw id th14 disp ( B C 1 , ’ C i r c u i t b an dw id th f o r 1 k i l o Ohm p h o to d i od e

r e s i s t a n c e BC1 = ’ )

15 disp ( B C 2 , ’ C i r c u i t b an dw id th f o r 50 ohm p h o to d i o der e s i s t a n c e BC2 = ’ )

16 / / R e s u l t17 / / C i r c u i t b an dw id th f o r 1 k i l o Ohm p h o t o d i o d e

r e s i s t a n c e BC1 = 2 2 7 36 4 2 0.18 // C i r c u i t b and wi dth f o r 50 ohm p h ot o di o de r e s i s t a n c e

BC2 = 4 . 5 4 7 D+08

30

Page 38: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 38/76

Chapter 7

Seventh chapter

Scilab code Exa 7.1

1 // C a p ti on : To f i n d optimum d e c i s i o n t h r e s h o l d2 // Example7 . 13 / / P ag e 2 5 84 clear ;

5 clc ;

6 close ;

7 bon = 1;

8 b of f = 0;

9 s ig ma _o n = 1;10 s i gm a _o f f = 1 ;

11 Q = ( b on - b o f f ) / ( s i gm a _ on + s i g ma _ o ff )

12 V th = b on - Q * s i g ma _ on

13 disp (Q , ’Q p a r a me te r v a l u e = ’ )

14 disp ( V t h , ’ o ptimum d e c i s i o n t h r e s h o l d Vth = ’ )

15 / / R e s u l t16 / /Q p a ra m et er v a l u e = 0 . 517 / /optimum d e c i s i o n t h r e s h o l d Vth = 0 . 5

Scilab code Exa 7.2

1 // C a pt io n : To f i n d o ut s i g n a l−to−n o i s e r a t i o andp r o b a b i l i t y o f e r r o r f o r g iv en ’Q’

2 // Example7 . 2

31

Page 39: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 39/76

Figure 7.1: Figure for Example7.3

3 / / P ag e 2 5 84 clear ;

5 clc ;

6 close ;

7 Q = 6;

8 P e = ( 1/ 2) * (1 - erf ( Q / sqrt ( 2 ) ) ) ;

9 S _N _d B = 1 0* log10 ( 2 * Q ) ;

10 disp ( P e , ’ P r o b a b i l i t y o f e r r o r Pe (Q) = ’ )

11 disp (S_N_dB , ’ S i g n a l−

to−

n o i s e r a t i o i n dB S/N = ’ )12 / / R e s u l t13 // P r o b a b i l i t y o f e r r o r Pe (Q) = 9 . 8 6 6D−1014 / / S i g n a l −to−n o i s e r a t i o i n dB S /N = 1 0 . 79 18 12

32

Page 40: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 40/76

Scilab code Exa 7.3

1 / / C a pt i on : P l o t t i n g B it−

E r r o r−

Rate v e r s u s Q f a c t o r2 // Example7 . 33 / / p ag e 2 594 clear ;

5 clc ;

6 close ;

7 Q = 0 :0 .0 1: 8;

8 P e = ( 1/ 2) * (1 - erf ( Q . / sqrt ( 2 ) ) ) ;

9 a = gca () ;

10 a . d a t a _ bo u n d s = [0 , 1 e - 1 6 ; 8 , 0 . 5] ;

11 plot ( Q , P e , ’ r ’ )

12 x l a b e l ( ’Q ’ )13 y l a b e l ( ’ Pe ’ )

14 t i t l e ( ’BER( Pe ) v e r s u s t h e f a c t o r Q ’ )

15 disp ( P e ( 1 ) , ’ P r o b a b i l i t y o f e r r o r a t Q =0 ’ )

16 disp ( P e ( 1 0 1 ) , ’ P r o b a b i l i t y o f e r r o r a t Q =1 ’ )

17 disp ( P e ( 2 0 1 ) , ’ P r o b a b i l i t y o f e r r o r a t Q =2 ’ )

18 disp ( P e ( 3 0 1 ) , ’ P r o b a b i l i t y o f e r r o r a t Q =3 ’ )

19 disp ( P e ( 4 0 1 ) , ’ P r o b a b i l i t y o f e r r o r a t Q =4 ’ )

20 disp ( P e ( 5 0 1 ) , ’ P r o b a b i l i t y o f e r r o r a t Q =5 ’ )

21 disp ( P e ( 6 0 1 ) , ’ P r o b a b i l i t y o f e r r o r a t Q =6 ’ )

22 disp ( P e ( 7 0 1 ) ,’ P r o b a b i l i t y o f e r r o r a t Q =7 ’

)

23 disp ( P e ( 8 0 1 ) , ’ P r o b a b i l i t y o f e r r o r a t Q =8 ’ )

24 / / R e s u l t25 // P r o b a b i l i t y o f e r r o r a t Q =026 // 0 . 527 // P r o b a b i l i t y o f e r r o r a t Q =128 // 0 . 1 5 8 6 5 5 329 // P r o b a b i l i t y o f e r r o r a t Q =230 // 0 . 0 2 2 7 5 0 131 // P r o b a b i l i t y o f e r r o r a t Q =332 // 0 . 0 0 1 3 4 9 9

33 // P r o b a b i l i t y o f e r r o r a t Q =434 // 0 . 0 0 0 0 3 1 735 // P r o b a b i l i t y o f e r r o r a t Q =536 // 0 . 0 0 0 0 0 0 337 // P r o b a b i l i t y o f e r r o r a t Q =6

33

Page 41: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 41/76

38 // 9 . 8 6 6D−10

39 // P r o b a b i l i t y o f e r r o r a t Q =740 // 1 . 2 8 0D−1241 // P r o b a b i l i t y o f e r r o r a t Q =842 // 6 . 1 0 6D−16

Scilab code Exa 7.41 // C a pt io n : To f i n d t he e ne rg y o f t hep ho to n i n c i d e n t on p h ot o di o de

2 / / and Minimum i n c i d e n t o p t i c a l p ow er3 // Example7 . 44 / / p ag e 2 625 clear ;

6 clc ;

7 close ;

8 h = 6.626 e -34; / / p l a n ks c o n s t a n t J / s9 C = 3 e 0 8 ; // f r e e s pa ce v e l o c i t y i n m/ s

10 B = 1 0 e 0 6 ; / / d a t a r a t e 1 0 Mb/ s e c11 tuo = 2/ B ; // 1/ t u o = h a l f t h e d a ta r a t e B12 L am b da = 8 50 e - 0 9; / / o p e r a t i n g w a ve l en g th i n nm13 E = 2 0. 7* h * C / L am bd a ;

14 Pi = E / tuo ;

15 disp (E , ’ En erg y o f t he i n c i d e n t p ho to n E = ’ )16 disp ( P i , ’ minimum i n c i d e n t o p t i c a l p ower P i = ’ )

17 disp (10* log10 ( P i * 1 0 0 0 ) , ’ minimum i n c i d e n t o p t i c a lp o we r i n dBm = ’ )

18 / / R e s u l t19 // Energy o f t he i n c i d e n t photon E = 4 . 84 1D−1820 / / minimum i n c i d e n t o p t i c a l po wer P i = 2 . 4 2 0 D−1121 / / m inimum i n c i d e n t o p t i c a l po wer i n dBm = −

7 6 . 1 6 1 0 5 9

34

Page 42: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 42/76

Page 43: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 43/76

7 P s = 3 ; / / l a s e r o u tp ut i n dBm

8 A P D_ s en = - 32 ; / /APD s e n s i t i v i t y i n dBm9 A l l o we d _ L os s = P s - A P D _ se n ; // i n dB10 lsc = 1; // s o ur c e c o nn e ct o r l o s s i n dB11 l jc = 2 *4 ; / / two ( j um pe r+c o n n e c t o r l o s s ) i n dB12 a lp ha = 0 .3 ; / / a t t e n u a t i o n i n dB /Km13 L = 60; / / c a b l e l e n g t h i n Km14 c a b le _ a tt = a l ph a * 6 0 ; // c a b l e a t t e n u a ti o n i n dB15 lrc = 1; // r e c e i v e r c o nn e c t o r l o s s i n dB16 s y s t e m _ m a r g i n = A l l o w ed _ L o s s - l s c - l j c - c a b l e_ a t t - l r c ;

17 disp (system_ margin , ’ The F in a l Margin i n dB = ’ )

18 / / R e s u l t

19 // ’ The F i n al Margin i n dB = 7 .

Scilab code Exa 8.3

1 // C ap ti on : Program t o c a l c u l a t e l i n k r i s e t ime2 // Example8 . 33 / / p ag e 2 914 clear ;

5 clc ;

6 close ;

7 t _t x = 1 5e - 0 9;// t r a n s mi t t e r r i s e t ime8 t _m at = 2 1e - 0 9; // m a t e r ia l d i s p e r s i o n r e l a t e d r i s e

t i m e9 t _m od = 3 .9 e - 0 9; // r i s e t im e r e s u l t i n g from modal

d i s p e r s i o n10 t _ rx = 14 e - 0 9 ; // r e c e i v e r r i s e t i m e11 t sy s = sqrt ( t _ t x ^ 2 + t _ m a t ^ 2 + t _ m o d ^ 2 + t _ r x ^ 2 )

12 disp ( t s y s * 1 e 0 9 , ’ l i n k r i s e t i m e i n nano s ec on ds t s y s= ’ )

13 / / R e s u l t14 // l i n k r i s e t im e i n nano s ec on ds t s y s = 2 9 .6 17 7 31

Scilab code Exa 8.4

1 // C a pt io n : Program t o c a l c u l a t e l i n k r i s e t im e2 // Example8 . 4

36

Page 44: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 44/76

Page 45: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 45/76

6 close ;

7 x = poly (0 , ’ x ’ ) ;8 G = x ^ 7 +0 + x ^ 5+ 0 +0 + x ^ 2+ x + 1;

9 C = coeff ( G ) ;

10 disp ( C ( $ : - 1 : 1 ) , ’ C o e f f i c i e n t s o f g e n er a t o r p ol yn om i a lC = ’ )

11 / / R e s u l t12 // C o e f f i c i e n t s o f g e n er at or p o l y n o m i a l C = 1 . 0 .

1 . 0 . 0 . 1 . 1 . 1 .

Scilab code Exa 8.71 / / C a p t i o n : P ro gr am t o f i n d CRC(C y c l i c R ed un da nc y C he ck )

2 // Example8 . 73 / / p ag e 3 084 clear ;

5 clc ;

6 close ;

7 x = poly (0 , ’ x ’ ) ;

8 m = [ 1 ,1 , 1 , 1 ,0 ];

9 G = x ^ 7 + x ^ 6+ x ^ 5 + x ^ 4 + 0 + 0+ 0 + 0 ;

10 D = x ^ 3+ 0+ x + 1;

11 [R , Q ] = pdiv ( G , D )12 R = coeff ( R ) ;

13 Q = coeff ( Q ) ;

14 R = abs ( modulo ( R , 2 ) ) ;

15 Q = abs ( modulo ( Q , 2 ) ) ;

16 disp (R , ’ R e mainde r R = ’ )

17 disp (Q , ’ Q u o t i e n t Q = ’ )

18 disp ([ m R ] , ’CRC f o r t h e g i v e n i n f o r m a t i o n CRC = ’ )

19 / / R e s u l t20 / / R e m a i n d e r R =21 // 1 . 0 . 1 .

22 / / Q u o t i e n t Q =23 // 1 . 1 . 0 . 1 . 1 .24 / /CRC f o r t h e g i v e n i n f o r m a t i o n CRC =25 // 1 . 1 . 1 . 1 . 0 . 1 . 0 . 1 .

38

Page 46: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 46/76

Scilab code Exa 8.81 / / C ap ti on : Program t o p e r c e n t a g e o f  

b u r s t e r r o r d e t e c t e d by CRC2 // Example8 . 83 / / p ag e 3 094 clear ;

5 clc ;

6 close ;

7 N = 32 ;

8 P ed = 1 - ( 1/ (2 ^ N )) ;

9 disp ( P e d * 1 0 0 , ’ P er ce n t o f b u r st e r r o r d e t e ct e d by CRCf o r a l e ng t h o f 32 Ped= ’ )

10 / / R e s u l t

11 // P er ce nt o f b u r st e r r o r d e t e ct e d by CRC f o r al e n g t h o f 32 Ped = 10 0.

Scilab code Exa 8.91 / / C ap ti on : P e rc e nt o v er h ea d t o t h ei n f o r a m t i o n s tr ea m U si ng Reed−S ol om on c o de f o re r r o r c o r r e c t i o n

2 // Example8 . 93 / / p ag e 3 094 clear ;

5 clc ;6 close ;

7 S =8; //Reed−S ol om on c od e w it h 1 b y te8 n = ( 2^ S - 1) ; // l e ng t h o f c o de d s eq ue nc e9 k = 2 3 9 ; // l e n g t h o f m es sa ge s e q ue n c e

10 r = n - k ;

11 disp (r , ’ n umber o f r ed un da n t b y t e s r = ’ )

12 disp ( ( r / k ) * 1 0 0 , ’ P e r c e n t o v e rh e a d = ’ )

13 / / R e s u l t14 / / number o f r ed un da nt b y t e s r = 1 6 .15 // P e r c e n t o v e r h e a d = 6 . 6 9 4 5 6 0 7

39

Page 47: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 47/76

Page 48: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 48/76

Figure 9.1: Figure for Example9.2Preamplifier

41

Page 49: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 49/76

Figure 9.2: Figure for Example9.2quantumnoise

42

Page 50: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 50/76

Figure 9.3: Figure for Example9.2reflectionnoise

43

Page 51: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 51/76

3 / / p ag e 3 23

4 clear ;5 clc ;

6 close ;

7 T = 30 0; // room t e mp e ra t u re i n k e l v i n8 k B = 1 . 38 0 54 e - 2 3; / / Bo lt zm an n ’ s c o n s t a n t i n J o u l e s / k9 m = 0. 25 ; / / m o d u a l t i o n i n d e x

10 R IN _ dB = - 14 3; // R e l a t i v e i n t e n s i t y i n dB/Hz11 R IN = 1 0^ ( R I N_ dB / 1 0) ;

12 P c = ( 1 0^ ( 0/ 1 0) ) * 1 e -3 ; // p ower c ou p le d t o o p t i c a lf i b e r i n dBm

13 R = 0 . 6 ; / / R e s p o n s i v i t y A/w

14 Be = 10 e06 ; // bandwidth 10MHz15 I D = 10 e -0 9; / / d ar k c u r r e n t 1 0nA16 R eq = 7 50 ; // e q u i v a l e n t r e s i s t a n c e 7 50 ohm17 F t = 1 0^ (3 /1 0) ; / / i n 3 dB18 M = 1; // M u l t i p l i c a t i o n f a c t o r f o r p in p ho to di od e19 R = 0 . 6 ; // r e s p o n s i v i t y i n A/m20 q = 1 .6 02 e - 19 ; / / c h a r g e i n c ou l om b s21 p = 0 : -1 : -2 0;

22 P = ( 10 ^( p / 1 0) ) * 1 e -3 ;

23 C _ N_ 1 = 0 . 5 *( ( m * R * P ) ^ 2) / ( 4 * k B * T * Be * F t / R e q ) ;

24 C _N _3 = 0 .5 * m ^ 2/ ( R IN * B e ) ;

25 C _ N_ 2 = 0 . 5* m ^ 2 * R * P / ( 2* q * B e ) ;

26 figure

27 plot ( p , 1 0 * log10 ( C _ N _ 1 ) , ’ r ’ )

28 x l a b e l ( ’ R e c e i v e d O p t i c a l P ow er ( dBm ) ’ )

29 y l a b e l ( ’ C a r r i e r−to−n o i s e r a t i o ( dB ) ’ )

30 t i t l e ( ’ C a r r i e r−to−n o i s e r a t i o 1 ( P r e am p l i f i e rr e c e i v e r n o i s e ) ’ )

31 figure

32 plot ( p , 1 0 * log10 ( C _ N _ 2 ) , ’m ’ )

33 x l a b e l ( ’ R e c e i v e d O p t i c a l P ow er ( dBm ) ’ )

34 y l a b e l ( ’ C a r r i e r−

to−

n o i s e r a t i o ( dB ) ’ )35 t i t l e ( ’ C a r r i e r−to−n o i s e r a t i o 2 ( Quantum n o i s e ) ’ )

36 figure

37 plot ( p , 1 0 * log10 ( C _ N _ 3 ) * ones (1 , length ( p ) ) )

38 x l a b e l ( ’ R e c e i v e d O p t i c a l P ow er ( dBm ) ’ )

44

Page 52: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 52/76

39 y l a b e l ( ’ C a r r i e r−to−n o i s e r a t i o ( dB ) ’ )

40 t i t l e ( ’ C a r r i e r−

to−

n o i s e r a t i o 3 ( R e f l e c t i o n n o i se ) ’ )

45

Page 53: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 53/76

Chapter 10

Tenth chapter

Scilab code Exa 10.1

1 // C a p ti on : F i nd i ng t h e c e n t e r w a ve l en g th2 // Example10 . 13 / / p ag e 3 434 clear ;

5 clc ;

6 close ;

7 d e lt a _v = 1 4 e1 2 ; / / o p t i c a l b an dw id th8 L am b da = 1 52 0; / / s p e c t r a l band9 C = 3 e 0 8 ; // f r e e s pa ce v e l o c i t y

10 d e l t a_ L a m bd a = ( L a m b da ^ 2 ) * d e l t a _v / C ;

11 disp ( d e l t a _ L a m b d a * 1 e - 0 9 , ’ s p e c t r a l band i n nano m et er’ )

12 / / R e s u l t13 / / s p e c t r a l band i n nano m et er = 1 0 7 . 8 1 8 67

Scilab code Exa 10.2

1 // C a p ti on : F i nd i ng mean f r e q u e n cy s p a c i n g

2 // Example10 . 23 / / p ag e 3 434 clear ;

5 clc ;

6 close ;

46

Page 54: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 54/76

7 C = 3 e 0 8 ; // f r e e s pa ce v e l o c i t y

8 d e l t a_ L a m bd a = 0 . 8 e - 09 ; // s p e c t r a l band i n m et er9 L am b da = 1 55 0 e - 09 ; / / w a v el e n g th i n m et er10 d e l ta _ v = C * d e l t a _ La m b da / L a m bd a ^ 2 ;

11 disp ( ceil ( d e l t a _ v * 1 e - 0 9 ) , ’ Mean F re q ue n cy s p a c i n g i nGHz =’ )

12 / / R e s u l t13 / / Mean F r eq u en c y s p a c i n g i n GHz = 1 0 0 .

Scilab code Exa 10.31 / / C a pt i on : P ro gra m t o f i n d c o u p l i n gr a ti o , E xc es s l o ss , I n s e r t i o n l o ss , Return l o s s

o f 2 x2 F ib e r c o u pl e r2 // Example10 . 33 / / p ag e 3 484 clear ;

5 clc ;

6 close ;

7 P 0 = 2 00 e - 06 ; // i np ut o p t i c a l power l e v e l i n w at ts8 P 1 = 90 e -0 6; // o u tp ut power a t p o rt 19 P 2 = 85 e -0 6; // o u tp ut power a t p o rt 2

10 P 3 = 6 .3 e - 09 ; // o u tp ut power a t p o rt 311 C o u p li n g _ ra t i o = ( P 2 / ( P 1 + P2 ) ) * 1 0 0;

12 E x ce s s_ l os s = 1 0* log10 ( P 0 / ( P 1 + P 2 ) ) ;

13 I n s e r ti o n _ lo s s _ 0 _1 = 1 0* log10 ( P 0 / P 1 ) ;

14 I n s e r ti o n _ lo s s _ 0 _2 = 1 0* log10 ( P 0 / P 2 ) ;

15 R e tu r n_ l os s = 1 0* log10 ( P 3 / P 0 ) ;

16 disp (Coupl ing_ratio , ’ C o up l in g r a t i o ’ )

17 disp (Excess_loss , ’ E xc es s l o s s i n dB ’ )

18 disp (Insertion_loss_0_1 , ’ I n s e r t i o n l o s s ( p or t 0 t op o rt 1 ) i n dB ’ )

19 disp (Insertion_loss_0_2 , ’ I n s e r t i o n l o s s ( p or t 0 t op o rt 2 ) i n dB ’ )

20 disp (Return_loss , ’ R et un r l o s s i n dB ’ )21 / / R e s u l t22 // C ou pl in g r a t i o23 // 4 8 . 5 7 1 4 2 924 // E x ce ss l o s s i n dB

47

Page 55: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 55/76

25 // 0 . 5 7 9 9 1 9 5

26 // I n s e r t i o n l o s s ( p or t 0 t o p or t 1 ) i n dB27 // 3 . 4 6 7 8 7 4 928 // I n s e r t i o n l o s s ( p or t 0 t o p or t 2 ) i n dB29 // 3 . 7 1 6 1 1 0 730 // R etunr l o s s i n dB31 // − 4 5 . 0 1 6 8 9 4

Scilab code Exa 10.51 / / C a pt i on : F i n d i ng o u t pu t p o we rs a to ut pu t p or t o f 2 x2 c o u pl e r

2 // Example10 . 5

3 / / p ag e 3 504 clear ;

5 clc ;

6 close ;

7 S = sqrt ( 1 / 2 ) * [ 1 , % i ; % i , 1 ] ; // s c a t t e r i n g m at ri x8 E in = [ 1; 0] ;

9 E ou t = S * Ei n ;

10 P ou t1 = E ou t ( 1) * conj ( E o u t ( 1 ) ) ;

11 P ou t2 = E ou t ( 2) * conj ( E o u t ( 2 ) ) ;

12 disp ( P o u t 1 , ’ O utput p ower a t p o r t 1 Po ut1 = ’ )

13 disp ( P o u t 2 , ’ O utput p ower a t p o r t 2 Po ut2 = ’ )14 / / R e s u l t15 // Output power a t p o rt 1 Pout1 = 0 . 516 // Output power a t p o rt 2 Pout2 = 0 . 5

Scilab code Exa 10.6

1 / / C a pt i on : Pr og ram t o f i n d w a ve g ui d e l e n g t h2 // Example10 . 63 / / p ag e 3 534 clear ;

5 clc ;6 close ;

7 k = 0 .6 /1 e - 03 ; / / c o u p l i n g c o e f f i c i e n t p e r m i l l ime t e r

8 m =1; //mode=1

48

Page 56: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 56/76

9 L = % pi * ( m +1 ) / (2 * k ) ;

10 disp ( L * 1 e 0 3 , ’ C o u p l i n g L e ng t h i n mm L = ’ )11 / / R e s u l t12 / / C ou p li n g L en gt h i n mm L = 5 . 2 3 5 9 87 8

Scilab code Exa 10.71 / / C ap ti on : Program t o f i n d E x ce s sl o s s , S p l i t t i n g l o s s and t o t a l l o s s

2 // Example10 . 73 / / p ag e 3 554 clear ;

5 clc ;

6 close ;7 P o we r _L o st = 5 / 10 0;

8 F T = 1 - P o we r _L o st ; / / p ow er c o u p l e d9 N = 32;

10 E x ce s s_ L os s = - 10 * log10 ( F T ^ log2 ( N ) ) ;

11 S p l i tt i n g _L o s s = - 10 * log10 ( 1 / N ) ;

12 T o t al _ L os s = E x c e ss _ L o ss + S p l i tt i n g _L o s s ;

13 disp (Excess_Loss , ’ E x c es s L o s s i n dB ’ )

14 disp (Split ting_Loss , ’ S p l i t t i n g L os s i n dB ’ )

15 disp (Total_Loss , ’ T ot al L os s e x p e ri e n c e d i n S t ar

C o u p l e r s i n dB ’ )16 / / R e s u l t17 // E xc es s L os s18 // 1 . 1 1 3 8 1 9 719 // S p l i t t i n g L o s s20 // 1 5 . 0 5 1 521 // T ot al L os s e x pe r i e n c e d i n S ta r C ou pl er s22 // 1 6 . 1 6 5 3 2

Scilab code Exa 10.8

1 / / C a pt i on : Pr og ram t o W av eg ui de L en gt h d i f f e r e n c e2 // Example10 . 83 / / P ag e 3 5 74 clear ;

5 close ;

49

Page 57: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 57/76

6 clc ;

7 d e l t a_ L a m bd a = 0 . 08 e - 0 9 ; / / w a ve l en g th s p a c i n g i nn an o m e t e r s8 L am b da = 1 55 0 e - 09 ; / / w a v el e n g th i n m e t er s9 n ef f = 1 .5 ; // e f f e c t i v e r e f r a c t i v e i n de x i n t h e

w a v e g u i d e10 C = 3 e0 8 ; // f r e e s pa ce v e l o c i t y11 d e lt a_ v 1 = 1 0 e0 9 ; / / f r e q u e n c y s p a c i n g 112 d e lt a_ v 2 = 1 30 e 0 9 ; // f r e q u e n cy s p a c i n g 213 d e l ta _ L 1 = C / ( 2 * n e ff * d e l t a _ v1 ) ;

14 d e l ta _ L 2 = C / ( 2 * n e ff * d e l t a _ v2 ) ;

15 disp ( d e l t a _ L 1 * 1 e 0 3 , ’ w av e g ui de l e ng t h d i f f e r e n c e i n

m i l l i m et er s ’ )16 disp ( d e l t a _ L 2 * 1 e 0 3 , ’ w av e g ui de l e ng t h d i f f e r e n c e i n

m i l l i m et er s ’ )

17 / / R e s u l t18 // w a v e g u i d e l e n g t h d i f f e r e n c e i n m i l l i m et er s19 // 1 0 .20 // w a v e g u i d e l e n g t h d i f f e r e n c e i n m i l l i m et er s21 // 0 . 7 6 9 2 3 0 8

Scilab code Exa 10.9

1 // C a p ti on : F i b e r B ra gg G r at i ng : Peak R e f l e c t i v i t y ,C o up li ng c o e f f i c i e n t , f u l l −bandw i dt h

2 //E x ample 10 . 9 . a3 clear ;

4 close ;

5 clc ;

6 k L = [ 1 ,2 , 3] ;

7 R ma x = tanh ( k L ) ^ 2 ;

8 //E x ample 10 . 9 . b9 L = 0. 5 e - 02 ;

10 L a m b da _ B r ag g = 1 5 30 e - 0 9 ;11 n ef f = 1 .4 8;

12 d e lt a _n = 2 .5 e - 0 4;

13 e tt a = 8 2 /1 00 ;

14 k = % pi * d e l t a _n * e t t a / L a m b d a _B r a g g ;

50

Page 58: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 58/76

15 d e l t a_ L a m bd a = ( L a m b d a _B r a g g ^ 2 ) * (( ( k * L ) ^ 2+ % p i ^ 2 )

^ 0 . 5 ) / ( % p i * n e f f * L ) ;16 disp ( k / 1 0 0 , ’ C oupl i ng c o e f f i c i e n t pe r cm k =’ )

17 disp ( d e l t a _ L a m b d a * 1 e 0 9 , ’ f u l l b a n dw i d th i n nm = ’ )

18 disp ( ’ ’ )

19 disp ( ’ kL Rmax (%) ’ )

20 disp ( ’ ’ )

21 disp ( k L , ’ kL ’ )

22 disp ( R m a x * 1 0 0 , ’Rmax ’ )

23 disp ( ’ ’ )

24 / / R e s u l t25 / / C o u p l i n g c o e f f i c i e n t p e r cm k = 4 . 2 0 9 3 2 3 5

26 // f u l l bandwi dt h i n nm = 0 .3 8 0 7 6 5227 //28 // kL Rmax (%)29 //30 // kL31 //32 // 1 . 2 . 3 .33 / / Rmax34 // 5 8 . 0 0 2 5 6 6 9 2 . 9 3 4 9 1 8 9 9 . 0 1 3 3 9 635 //

Scilab code Exa 10.101 // Capt ion : Phased−Array−Based−D e v i ce s : C ha nn el s p a c i n g i n t e rm s o f w a ve l en g th and

path−l e n g t h d i f f e r e n c e2 // Example10 .1 03 / / p ag e 3 724 clear ;

5 clc ;

6 close ;

7 L a mb da _ c = 1 55 0 e - 09 ; / / c e n t r a l d e s i g n w a ve l en g th

8 nc = 1 .4 5; // r e f r a c t i v e i nd ex o f g r a t i ng a rr ayw a v e g u i d e

9 ns = 1 .4 5; // r e f r a c t i v e i nd ex o f t e h s t a r c o u p le r10 ng = 1 .4 7; // g ro up i n de x o f g r a t i n g a r ra y w av eg ui de

51

Page 59: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 59/76

11 x = 5 e - 0 6 ; // c e n t e r −to−c e n t e r s p a ci n g b et wee n t he

i n p u t w a v eg u i d es12 d = 5 e - 0 6 ; // c e n t e r −to−c e n t e r s p a ci n g b et wee n t heo u tp u t w a v eg u i d es

13 m =1;

14 L f = 10 e -0 3; // d i s t a n c e b et we en t r a n s m i t t e r ando b j e c t

15 d e lt a _L = m * L a mb da _ c / nc ;

16 d e l t a_ L a m bd a = ( x / L f ) *( n s * d / m ) * ( nc / n g ) ;

17 disp ( d e l t a _ L * 1 e 0 6 , ’ W aveguide l e n g t h d i f f e r e n c e i n um= ’ )

18 disp ( d e l t a _ L a m b d a * 1 e 0 9 , ’ C ha nn el s p a c i n g i n t e rm s o f  

w a v e l e n g t h i n nm= ’ )19 / / R e s u l t20 // Waveguide l e n g t h d i f f e r e n c e i n um = 1 . 0 68 9 65 521 // Ch ann el s p a ci n g i n te r ms o f w av el en gt h i n nm =

3 . 5 7 5 6 8 0 3

Scilab code Exa 10.11

1 // Capt ion : Phased−Array−B a se d D e v i c e s : L e n gt hd i f f e r e n c e b et we en a d j a ce n t a r ra y w av eg ui de s

2 // Example10 .1 13 / / p ag e 3 734 clear ;

5 close ;

6 clc ;

7 nc = 1 .4 5; // e f f e c t i v e r e f r a c t i v e i n d ex8 L a m bd a _ C = 1 5 50 . 5 e - 0 9; / / c e n t e r w a v el e n g th9 d e l t a_ L a m bd a = 3 2 .2 e - 0 9 ; // f r e e s p e c t r a l r an ge

10 C = 3 e 0 8 ; // f r e e s pa ce v e l o c i t y i n m/ s11 d e l ta _ L = L a m bd a _ C ^ 2 /( n c * d e l t a _ L am b d a ) ;

12 disp ( d e l t a _ L * 1 e 0 6 , ’ l e n g th d i f f e r e n c e b et wee n

a d j a ce n t a r ra y w av eg ui de s i n um = ’ )13 / / R e s u l t14 // l e n g t h d i f f e r e n c e b et we en a d j a ce n t a r ra y

w a v eg u i d es i n um = 5 1. 4 89 6 18

52

Page 60: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 60/76

Scilab code Exa 10.121 // Capt ion : Maximum number of  

c ha n ne l s t ha t can be p l ac e d i n t he t un in g r an ge2 // Example10 .1 23 / / p ag e 3 834 clear ;

5 clc ;

6 close ;

7 L am b da = 1 55 0 e - 09 ; / /DBR l a s e r o p e r a t i n g w a v el e n g th8 d e l ta _ n ef f = 0 . 00 6 5 ; //maximum i nd e x c hange9 d e l t a_ L a m b da _ t u ne = L a m bd a * d e l t a _ ne f f ; // t un i ng

r an ge i n m et er s10 d e l t a _L a m b da _ s i g na l = 0 . 02 e - 0 9 ; // s o u r ce s p e c t r a l

w id th i n m e te rs11 d e l t a _L a m b d a_ c h a n ne l = 1 0 * d e l t a _L a m b d a_ s i g n al ;

12 N = d e l t a_ L a m b da _ t u ne / d e l t a _L a m b d a_ c h a nn e l ;

13 disp (N , ’ The number c h a nn e l s t h at ca n o p e r at e i n t h i st u ni n g r an ge i s N= ’ )

14 / / R e s u l t15 // The n umber c h a nn e l s t h at can o p e ra t e i n t h i s

t un in g r an ge i s N = 5 0 . 3 75

53

Page 61: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 61/76

Chapter 11

Eleventh chapter

Scilab code Exa 11.1

1 / / C a pt i on : Pr og ram t o c a l c u l a t e P ho to n d e n s i t y2 // Example11 . 13 / / p ag e 3 974 clear ;

5 clc ;

6 close ;

7 Vg = 2 e08 ; // g ro up v e l o c i t y i n m/ s8 h = 6 .6 25 e - 34 ; / / p l a n k s c o n s t a n t9 C = 3 e 0 8 ; // f r e e s pa ce v e l o c i t y i n m/ s

10 L am da = 1 55 0 e - 09 ; / / o p e r a t i n g w a v el e n g th11 V = C / La md a; / / f r e q u e n c y i n Hz12 w = 5e - 06 ; // w i dt h o f o p t i c a l a m p l i f i e r i n m et e rs13 d = 0 .5 e - 06 ; // t h i c k n e ss o f o p t i c a l a m p l i f i e r i n

m e t e r s14 P s = 1 e -0 6; // o p t i c a l s i g n a l o f power15 N ph = P s /( V g * h* V * w* d ) ;

16 disp ( N p h , ’ The p ho to n d e n s i t y i n p ho t on s / c u b i c m et eri s Nph = ’ )

17 / / R e s u l t18 / /The p ho to n d e n s i t y i n p h ot on s / c u b i c m et er i s Nph =1.560D+16

54

Page 62: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 62/76

Scilab code Exa 11.2

1 / / C a p t i o n : P ump in g r a t e a nd z e r o−

s i g n a l g ai n2 / / E xa mp le 11 . 2 ( a ) a nd ( b )3 / / p ag e 3 974 clear ;

5 clc ;

6 close ;

7 I = 1 00 e - 03 ; / / b i a s c u r r e n t i n Amps8 w = 3e - 06 ; // a c t i v e a r ea w id th i n m et er s9 L = 5 00 e - 06 ; // a m p l i f i e r l e ng h t i n m et er s

10 d = 0 .3 e - 06 ; // a c t i v e a r e a t h i c k n e ss i n m et er s11 q = 1 .6 02 e - 19 ; / / c h a r g e i n c ou l om b s

12 R p = I / ( q* d * w* L ) ;13 disp ( R p , ’ The pumping r a t e i n e l e c t r o n s / s . c u b i cm e t er

i s Rp = ’ )

14 T uo = 0 .3 ; / / t h e c o n fi n e me n t f a c t o r15 a = 2e - 20 ; // ga i n c o e f f i c i e n t i n sq u ar e me t e r16 J = I /( w* L) ; / / b i a s c u r r e n t d e n s i t y i n Amp/ s q u r e

me t e r17 nth = 1 e24 ; // t h r e s h o l d d e n s i t y p er c u bi c m et er18 T uo r = 1 e -0 9; // Time c o n s t a n t i n s e c o nd s19 g 0 = T u o * a * T uo r * ( ( J / ( q * d )) - ( n t h / T uo r ) )

20 disp ( g 0 / 1 0 0 ,’ The z e r o

s i g n a l g ai n p e r cm i s g0 = ’)

21 / / R e s u l t22 / / The pumping r a t e i n e l e c t r o n s / s . c u b i cm e t er i s Rp

= 1 . 3 8 7 D+3323 / / The z e ro−s i g n a l g ai n p er cm i s g0 = 2 3. 22 92 97

Scilab code Exa 11.31 // C apt i on : Maximum i np ut pow er andmaxmimum ou tp ut power

2 / / E xa mp le 1 1 . 33 / / p ag e 4 04

4 clear ;5 clc ;

6 close ;

7 L a mb da _ p = 9 80 e - 0 9; //pump w av e l e ng t h8 L a mb da _ s = 1 55 0 e - 09 ; / / s i g n a l w a ve l en g th

55

Page 63: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 63/76

Page 64: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 64/76

5 clc ;

6 close ;7 L a mb da _ p = 9 80 e - 0 9; / /pump w a v e l e n g t h i n m e t e r s8 L a mb da _ s = 1 54 0 e - 09 ; // s i g n a l w av el en gt h i n m et er s9 P s_ o ut = 1 0e - 0 3; // o u tp ut s i g n a l power

10 P s_ in = 1 e - 03 ; / / i n p u t s i g n a l p ower11 P p _i n = ( L a m b d a_ s / L a m b d a _p ) * ( P s _ ou t - P s _ in )

12 disp ( P p _ i n * 1 e 0 3 , ’Pump p ower i n m i l l i w at ts P p i n = ’ )

13 / / R e s u l t14 / /Pump p ower i n m i l l i w a tt s P p i n = 1 4 . 1 4 2 8 5 7

Scilab code Exa 11.81 // C a pt io n : OSNR f o r d i f f e r e n t ASE n o i s e l e v e l

2 // Example11 . 83 / / p ag e 4 134 clear ;

5 clc ;

6 close ;

7 P _A S E1 = - 22 ; / /ASE l e v e l i n dBm8 P _A S E2 = - 16 ; / /ASE l e v e l i n dBm9 Po ut = 6; // a m p l i f i e d s i g n a l l e v e l i n dBm

10 O SN R1 = P ou t - P _A SE 1 ; // Op t i c a l SNR i n dBm11 O SN R2 = P ou t - P _A SE 2 ; // Op t i c a l SNR i n dBm12 disp ( O S N R 1 , ’ Op ti ca l SNR in dBm OSNR = ’ )

13 disp ( O S N R 2 , ’ Op ti ca l SNR in dBm OSNR = ’ )

14 / / R e s u l t15 / / O p t i c a l SNR i n dBm OSNR = 2 8 .16 / / O p t i c a l SNR i n dBm OSNR = 2 2 .

Scilab code Exa 11.91 // C ap ti on : N o is e p e n al t y f a c t o r2 // Example11 . 9

3 / / p ag e 4 144 clear ;

5 clc ;

6 close ;

7 G = [ 1 0 ^ ( 3 0 / 1 0 ) , 1 0 ^ ( 20 / 1 0 ) ] ; / / A m p l i f i e r Ga in

57

Page 65: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 65/76

8 for i = 1: length ( G )

9 F p at h ( i ) = ( 1 / G ( i )) * ( ( G ( i ) - 1) / log ( G ( i ) ) ) ^ 2 ;10 disp (10* log10 ( F p a t h ( i ) ) , ’ N oi se p e na l ty f a c t o r i nd B F p a t h = ’ ) ;

11 disp ( G ( i ) , ’ f o r a g ai n o f G = ’ ) ;

12 end

13 / / R e s u l t14 // N oi s e p e na l t y f a c t o r i n dB F path = 1 3. 2 0 45 7 115 // f o r a g ai n o f G = 1 0 0 0.16 // N oi s e p e na l t y f a c t o r i n dB F path = 6 .6 4 7 79 0 217 // f o r a g a i n o f G = 1 0 0 .

Scilab code Exa 11.101 / / C a p t i o n : U pp er b ou nd o n i n p u to p t i c a l s i g n a l power

2 // Example11 .1 03 / / p ag e 4 154 clear ;

5 clc ;

6 close ;

7 e tt a = 0 .6 5; / /Quantum e f f i c i e n c y8 nsp = 2; // p o pu l at i on i n v e r s i o n be t we en two l e v e l s

9 R = 50 ; // l o ad r e s i s t a n c e inoh ms10 L am b da = 1 55 0 e - 09 ; // o p e r a t i n g w a ve l en g th i n m e te r s11 T = 3 0 0 ; // room t e m pe r a tu r e i n k e l v i n s12 k B = 1 . 38 0 54 e - 2 3; / / b o lt zm a nn ’ s c o n s t a n t13 h = 6 .6 25 6 e - 34 ; / / p l an k ’ s c o n s t a n t14 C = 3 e 0 8 ; // f r e e s pa ce v e l o c i t y i n m/ s15 V = C / La mb da ; // f r e q u e n cy i n Hz16 q = 1 .6 02 e - 19 ; / / c h a r g e i n c ol u mb s17 P s _i n = k B * T * h *V / ( R * n sp * ( e t t a ^ 2) * ( q ^ 2 ) ) ;

18 disp ( P s _ i n * 1 e 0 6 , ’ U pper b ound o n i n p u t o p t i c a l s i g n a lpower i n m ic ro w at ts P s i n= ’ )

19 / / R e s u l t20 // Upper bound o n i n pu t o p t i c a l s i g n a l power i n m ic ro

w a tt s P s i n = 4 89 .8 16 35

58

Page 66: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 66/76

Chapter 12

Twelve chapter

Scilab code Exa 12.11 // C ap ti on : E f f e c t i v e l e ng t h o f f i b e r2 // Example12 . 13 / / p ag e 4 324 clear ;

5 clc ;

6 close ;

7 L = 75; // a m p l i f i e r s p ca i ng i n k i l o me t e r8 a lp ha = 4 .6 1 e - 02 ; // f i b e r a t t e n u a t io n p er Km9 Le ff = (1 - exp ( - a l p h a * L ) ) / a l p h a ;

10 disp ( L e f f , ’ E f f e c t i v e l en g t h o f f i b e r i n k i l o m e t e r sL e f f = ’ )

11 / / R e s u l t12 // E f f e c t i v e l e n gt h o f f i b e r i n k i l o m e t e r s L e ff =

2 1 . 0 0 8 4 9 4

Scilab code Exa 12.2

1 // C ap ti on : C a l c u l a t i o n o f S ti mu l a te d B r i l l o u i nS c a t t e r i n g ( SBS ) t h r e s h o l d p ower

2 // Example12 . 23 / / p ag e 4 334 clear ;

5 clc ;

6 close ;

59

Page 67: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 67/76

7 d e lt a_ V B = 2 0 e0 6 ; // B r i l l o u i n l i n e w i d t h i n Hz

8 A ef f = 5 5e - 1 2; // e f f e c t i v e c ro s s−

s e c t i o n a l a re a o f  t he p r o pa g a ti n g wave i n s q ua r e m et er9 L ef f = 2 0 e0 3 ; // e f f e c t i v e l e n g th

10 b = 2; // p o l a r i z a t i o n f a c t o r11 g B = 4 e -1 1; // B r i l l o u s ga i n c o e f f i c i e n t m/W12 d e lt a _V s ou r ce = 4 0 e0 6 ; // o p t i c a l s o ur c e l i n e wi d t h i n

Hz13 P th = 2 1 *( A e f f * b / ( g B * L ef f ) ) * ( 1 +( d e l t a_ V s o ur c e /

d e l t a _ V B ) ) ;

14 disp ( P t h * 1 e 0 3 , ’ SBS t h r e s h o l d power i n m i l l i w at tsPth=’ )

15 / / R e s u l t16 //SBS t h r e s h o l d power i n m i l l i w at ts Pth= 8 . 66 2 5

Scilab code Exa 12.31 / / C a p t i o n : F ou r−w av e mi x i ng−c a l c u l a t i o n o f power g e ne r a t ed due t o t he

2 // i n t e r a c t i o n o f s i g n a l s a t d i f f e r e n t f r e q u e n c i e s3 // Example12 . 34 / / p ag e 4 385 clear ;

6 clc ;

7 close ;

8 c h i1 1 11 = 6 e - 15 ; // T hi rd o r d er n o n l i n e a rs u c e p t i b i l i t y c u bi c me t er /W. s

9 D =3; // d e g e n er a t i n g f a c t o r10 L ef f = 2 2 e0 3 ;// e f f e c t i v e l e n g t h i n m e te r s11 A ef f = 6 .4 e - 1 1; // e f f e c t i v e c ro s s−s e c t i o n a l a re a o f  

t h e f i b e r i n s qu ar e me t er12 e tt a = 0 .0 5; // quantum e f f i c i e n c y13 L am b da = 1 54 0 e - 09 ; // W av el en gt h i n s i n g l e mode

f i b e r s i n me t er

14 C = 3 e 0 8 ; // f r e e s pa ce v e l o c i t y i n m/ s e c15 a l ph a = 0 . 04 6 1 ; / / a t t t e n u a t i o n p e r Km16 L = 75 ; // f i b e r l i n k l e ng t h i n Km17 P = 1e - 03 ; // e ac h c ha nn el i np ut power o f 1 m i l l i

w a t t s

60

Page 68: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 68/76

18 n = 1. 48 ; // r e f r a c t i v e i nd ex

19 k = ( ( 32 * ( % p i ^ 3) * c h i 1 1 11 ) / ( ( n ^ 2 ) * L a m bd a * C ) ) * ( L e ff /A e f f ) ; // n o n l i ne a r i n t e r a c t i o n c o ns t a n t20 P 1 12 = e t ta * ( D ^ 2 ) * ( k ^ 2) * ( P ^ 3 ) * exp ( - a l p h a * L ) ;

21 disp ( P 1 1 2 * 1 e 0 3 , ’ Power g e n er a t ed due t o i n t e r a c t i o no f s i g n a l s a t d i f f e r e n t f r e q . i n m i l l i w a t t s P112

= ’ )

22 / / R e s u l t23 // Power g en e r at ed due t o i n t e r a c t i o n o f s i g n a l s a t

d i f f e r e n t f r e q . i n m i l l i w a tt s P112= // 5 . 7 9 8D−08

Scilab code Exa 12.41 // C apt i on : F ul l−

w id th H a lf  −

Maximum(FWHM) s o l i t o n p u l s e n o r m a l i z e d t i me

2 // Example12 . 43 / / p ag e 4 464 clear ;

5 clc ;

6 close ;

7 T s = [ 15 e - 12 , 5 0e - 1 2] ; / /FWHM s o l i t o n p u l s e w i d t h8 T o = T s / 1. 7 62 7 ;

9 disp ( T o * 1 e 1 2 , ’ N o rm a l iz e d t i me f o r FWHM s o l i t o n p u l s e

i n p i co s e c on d s To = ’ )10 / / R e s u l t11 / / N or m al i ze d t im e f o r FWHM s o l i t o n p u l s e i n p i c o

s e c on ds To = [ 8 .5 0 9 6 7 27 2 8 . 3 65 5 7 6 ]

Scilab code Exa 12.51 / / C ap ti on : C a l c u l a t i o n o f n o r m al i z e dd i s t a n ce p a ra me t e r f o r d i s p e r s i o n s h i f t e d f i b e r

2 // Example12 . 53 / / p ag e 4 464 clear ;

5 clc ;

6 close ;

7 T s = 20 e -1 2; / /FWHM s o l i t o n p u l s e w id th i n s e c o n d s8 D = 0 .5 e - 06 ; // d i s p e r s i o n o f t he f i b e r p s / (nm . km)

61

Page 69: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 69/76

9 L am b da = 1 55 0 e - 9; / / w a v el e n g th i n m et er

10 C = 3 e 0 8 ; // f r e e s pa ce v e l o c i t y i n m/ s11 L d is p = 0 . 3 22 * 2 * % p i * C *( T s ^ 2 ) / ( ( L a mb d a ^ 2 ) * D ) ;

12 disp ( L d i s p / 1 0 0 0 , ’ d i s p e r s i o n l e n g th i n Km L di sp = ’ )

13 / / R e s u l t14 // d i s p e r s i o n l e n g th i n Km Ld is p = 2 0 2. 1 0 80 4

Scilab code Exa 12.61 / / C ap ti on : Program t o c a l c u l a t es o l i t o n p ea k p ower

2 // Example12 . 63 / / p ag e 4 474 clear ;

5 clc ;

6 close ;

7 L am b da = 1 55 0 e - 9; / / w a v el e n g th i n m e t er s8 n 2 = 2 .6 e - 20 ; / / po we r i n s q u a r e m et er /w9 Aeff = 50 e -12; // e f f e c t i v e a re a i n s qu ar e me t e r

10 L di sp = 2 02 e 0 3 ; // d i s p e r s i o n l e ng t h i n m et er s11 P p ea k = ( A e f f / ( 2* % p i * n 2 ) ) * ( L a mb d a / L d i sp ) ;

12 disp ( P p e a k * 1 e 0 3 , ’ S o l i t o n peak power i n m i l l i w at tsP pe ak =’ )

13 / / R e s u l t14 // S o l i t o n pea k power i n m i l l i w at ts Ppeak =

2 . 3 4 8 5 3 5 4

Scilab code Exa 12.71 / / C a p t i o n :FWHM s o l i t o n p u l s e w i d t hand f r a c t i o n o f b i t s l o t o cc up ie d by a s o l i t o n

2 // Example12 . 73 / / p ag e 4 484 clear ;

5 clc ;

6 close ;

7 //E x ample 12 . 7 . a8 L di sp = 1 00 e 0 3 ; // d i s p e r i s o n l e ng t h i n me te r9 o me ga = 4 68 2; // o s c i l l a t i o n p e r i o d

62

Page 70: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 70/76

10 L I = o me ga * L d is p ;

11 disp ( L I , ’ i n t e r a c t i o n d i s t a n c e i n me t e r LI= ’ )12 //E x ample 12 . 7 . b13 D = 0 .5 e - 06 ; // d i s p e r i s o n o f f i b e r i n ps /nm .km14 C = 3 e 0 8 ; // f r e e s pa ce v e l o c i t y15 S 0 = 8 ; // n o rm a li z ed s e p a r a t i o n o f n e i g h no r i n g

s o l i t o n s16 B = 1 0 e 0 9 ; / / d a t a r a t e 1 0 Gb/ s e c17 L am b da = 1 55 0 e - 9; / / w a v el e n g th i n m e t er s18 B et a2 = ( L a mb da / ( 2* % p i ) );

19 L T = ( C * exp ( S 0 ) ) / ( 1 6 * D * B ^ 2 * ( B e t a 2 ^ 2 ) * ( S 0 ^ 2 ) ) ;

20 disp ( L T * 1 e 0 3 , ’ T ot al t r a n s m i s s i o n d i s t a n c e i n Km LT =

’ )21 //E x ample 12 . 7 . c22 T s = 0 . 88 1 /( S 0 * B );

23 disp ( T s * 1 e 1 2 , ’FWHM s o l i t o n p u l s e w id th i n p i c os e c o n ds Ts = ’ )

24 //E x ample 12 . 7 . d25 T s_ TB = 0 . 88 1/ S 0 ;

26 disp ( T s _ T B * 1 0 0 , ’ F ra c t i o n o f t h e b i t s l o t o cc up i e d bya s o l i t o n i n p e rc e nt a ge Ts TB= ’ )

27 / / R e s u l t28

// i n t e r a c t i o n d i s t a n c e i n m et er LI = 4 . 6 8 2D+0829 / / T o t a l t r a n s m i s s i o n d i s t a n c e i n Km LT = 2 . 8 7 0 D+1130 / /FWHM s o l i t o n p u l s e w id th i n p i c o s e c o nd s Ts =

1 1 . 0 1 2 531 // F ra ct io n o f t h e b i t s l o t o cc up ie d by a s o l i t o n i n

p e r c e n t a g e Ts TB = 1 1 . 0 1 2 5

63

Page 71: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 71/76

Chapter 13

Thirteen chapter

Scilab code Exa 13.11 / / C ap ti on : C a l c u l a t i o n o f p owe rb ud g et f o r o p t i c a l l i n k

2 // Example13 . 13 / / p ag e 4 644 clear ;

5 clc ;

6 close ;

7 N = [ 5 ,1 0 ,5 0] ; / / number s t a t i o n s8 a lp ha = 0 .4 ; / / a t t e n u a t i o n i n dB /Km9 L _t ap = 1 0; // c ou pl i n g l o s s i n dB

10 L _t h ru = 0 .9 ; // c o u p l e r t hr ou gh pu t i n dB11 Li = 0. 5; // I n t r i n s i c c o u pl e r l o s s i n dB12 Lc = 1. 0; / / c o u p le r−to− f i b e r l o s s i n dB13 L = 0 . 5 ; // l i n k l e n g th i n Km14 f i be r _L o ss = a lp ha * L ; // f i b e r l o s s i n dB15 P b u dg e t = N * ( a l p ha * L + 2 * L c + L i + L _ th r u ) - a l p ha * L - 2 *

L _ t h r u + 2 * L _ t a p ;

16 disp (fiber_Loss , ’ f i b e r l o s s i n dB f o r L =500 m ’ )

17 disp (Pbu dget , ’ p ower b ud ge t i n dB f o r o p t i c a l l i n k

when N = 5 , 10 and 50 s t a t i o n s r e s p e c t i v e l y = ’ )18 / / R e s u l t19 // f i b e r l o s s i n dB f o r L =500 m20 // 0 . 2

64

Page 72: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 72/76

Page 73: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 73/76

Scilab code Exa 13.31 // C ap ti on : C a l c u l a t i o n o f w or st

c a s e D yn am ic R an ge2 // Example13 . 33 / / p ag e 4 654 clear ;

5 clc ;

6 close ;

7 N = [ 5 , 1 0 ] ; // number o f s t a t i o n s8 a lp ha = 0 .4 ; / / a t t e n u a t i o n i n dB /Km9 L = 0 . 5 ; // l i n k l e n g th i n Km

10 Lc = 1. 0; / / c o u p le r−to− f i b e r l o s s i n dB11 L _t h ru = 0 .9 ; // c o u p l e r t hr ou gh pu t i n dB

12 Li = 0. 5; // I n t r i n s i c c o u pl e r l o s s i n dB13 D R = ( N - 2 ) * ( a l ph a * L + 2 * L c + Li + L _ t h ru ) ;

14 disp ( D R , ’ worst−c a s e d ya nmi c r a ng e i n dB f o r N =5 a nd10 r e s p e c t i v e l y DR = ’ )

15 / / R e s u l t16 / / w o r s t−c a s e dyanmic r an ge i n dB f o r N =5 a nd 10

r e s p e c t i v e l y DR =17 // 1 0 . 8 2 8 . 8

Scilab code Exa 13.4

1 // C a p ti on : C a l c u l a t i o n o f po wer m ar gi n b et we ent r a n s m i t t e r a nd r e c e i v e r f o r S ta r a r c h i t e c t u r e s

2 // Example13 . 43 / / p ag e 4 664 clear ;

5 close ;

6 clc ;

7 N = [ 10 , 5 0] ; // number o f s t a t i o n s8 a lp ha = 0 .4 ; / / a t t e n u a t i o n i n dB /Km9 L = 0.5 ; / / d i s t a n c e i n Km

10 L e x ce s s = [ 0 . 75 , 1 .2 5 ]; // e x c e s s l o s s i n dB f o r N =10a nd 5 0

11 Lc = 1. 0; // c o n ne c to r l o s s i n dB12 P s _P r ( 1 ) = L e x ce s s ( 1 ) + a l ph a * 2 * L + 2 * L c + 10 * log10 ( N ( 1 ) ) ;

13 P s _P r ( 2 ) = L e x ce s s ( 2 ) + a l ph a * 2 * L + 2 * L c + 10 * log10 ( N ( 2 ) ) ;

66

Page 74: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 74/76

14 disp ( P s _ P r ( 1 ) , ’ The p ow er m ar gi n i n dB b et we en t h e

t r a n s mi t t e r and r e c e i v e r f o r N=10 i s Ps−

P r = ’ )15 disp ( P s _ P r ( 2 ) , ’ The p ow er m ar gi n i n dB b et we en t h et r a n s mi t t e r and r e c e i v e r f o r N=50 i s Ps−P r = ’ )

16 / / R e s u l t17 / /The po wer m ar gi n i n dB b et we en t h e t r a n s m i t t e r and

r e c e i v e r f o r N=10 i s Ps−Pr = 1 3 . 1 518 / /The po wer m ar gi n i n dB b et we en t h e t r a n s m i t t e r and

r e c e i v e r f o r N=50 i s Ps−P r = 2 0 . 6 3 9 7

Scilab code Exa 13.51 / / C a p t i o n : D e t e r m i n a t i o n o f maximuml e ng t h o f mul ti mode f i b e r l i n k

2 // Example13 . 53 / / p ag e 4 774 clear ;

5 clc ;

6 close ;

7 L _O M2 = 4 0; // l e n g t h o f OM2 f i b e r8 L _O M3 = 1 00 ; / / l e n g t h o f OM3 f i b e r9 B W_ O M2 = 5 00 e 0 6 ;/ / b an dw id th o f OM2 f i b e r

10 B W_ O M3 = 2 00 0 e 06 ; / / b an dw id th o f OM3 f i b e r

11 L m ax = L _ OM 2 * ( B W _ O M3 / B W _O M 2 ) + L _ OM 3 ;12 disp ( L m a x , ’ The maximum l i n k l e n g t h i n m et er i s Lmax

= ’ )

13 / / R e s u l t14 / / The maximum l i n k l e n g t h i n m et er i s Lmax = 2 6 0 .

67

Page 75: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 75/76

Chapter 14

Fourteen chapter

Scilab code Fig 14.10

1 / / C a p t i o n : P e r f o r m a n c e M ea s ur em e nt a nd M o n i t o r i n g2 // F ig ur e : 1 4 . 1 0 P l o t t i n g p u l se s ha pe o f g a u ss i an

d i s t r i b u t i o n3 / / and d e t e rm i n i n g 3−dB o p t i c a l and e l e c t r i c a l

bandw i dt h4 clear ;

5 close ;

6 clc ;

7 s ig ma = 1;8 t = - 3* s i gm a : 0 . 01 : 3* s i g ma ;

9 p = ( 1/ ( s ig ma * sqrt ( 2 * % p i ) ) ) * exp ( - t ^ 2 . / ( 2 * s i g m a ^ 2 ) ) ;

10 f d B _o p t i ca l = 0 . 18 7 / s i g ma ;

11 f d B _ el e c t ri c a l = 0 . 13 3 / s i g ma ;

12 disp (fdB_optical , ’ f d B o p t i c a l ’ )

13 disp (fdB_e lectrical , ’ f d B e l e c t r i c a l ’ )

14 plot ( t , p , ’ r ’ )

15 x l a b e l ( ’ T ime t ’ )

16 y l a b e l ( ’ R e l a t i v e p u l s e a m pl i tu d e P ( t ) ’ )

17 t i t l e ( ’ F ig ur e : 1 4 . 1 0 D e f i n i t i o n s o f p ul se−

s h a p ep a r a m e t e r s ’ )

18 xgrid (1)

19 / / R e s u l t20 // f d B o p t i c a l = 0 . 1 8 7

68

Page 76: Optical_Fiber_Communication

8/7/2019 Optical_Fiber_Communication

http://slidepdf.com/reader/full/opticalfibercommunication 76/76

Figure 14.1: Performance Measurement and Monitoring

21 // f d B e l e c t r i c a l = 0 . 1 33