You are on page 1of 76

Scilab Code for Optical Fiber Communication by Gerd Keiser 1

Created by Prof. R. Senthilkumar Institute of Road and Transport Technology rsenthil signalprocess@in.com Cross-Checked by Prof. Saravanan Vijayakumaran, IIT Bombay sarva@ee.iitb.ac.in 11 January 2011

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

1 Funded

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

Scilab numbering policy used in this document and the relation to the above book. Exa Example (Solved example) Fig Code for Figure(Scilab code that is used for plotting the respective gure of the above book ) For example, Exa 4.56 means solve example 4.56 of the above book.

Contents
List of Scilab Codes 1 First chapter 2 Second chapter 3 Third chapter 4 Fourth chapter 5 Fifth chapter 6 Sixth chapter 7 Seventh chapter 8 Eight chapter 9 Ninth chapter 10 Tenth chapter 11 Eleventh chapter 12 Twelve chapter 13 Thirteen chapter 14 Fourteen chapter 4 2 7 11 16 22 26 31 35 40 46 54 59 64 68

List of Scilab Codes


Exa Exa Exa Exa Exa Exa 1.1 1.2 1.4 1.5 1.6 1.7 Program to calculate time period and phase shift . . . Example 1.2 . . . . . . . . . . . . . . . . . . . . . . . Shannon Channel Capacity formula . . . . . . . . . . Capacity of a channel using Shannons formula . . . . Program to calculate attenuation loss of power . . . . Power gain calculation for a signal travelling from one point to another point . . . . . . . . . . . . . . . . . . Critical Angle of incidence . . . . . . . . . . . . . . . Finding Critical angle, numerical aperture, acceptance angle . . . . . . . . . . . . . . . . . . . . . . . . . . . Program to Calculate NORMALIZED FREQUENCY V and Numerical Aperture . . . . . . . . . . . . . . . Power ow in the core and cladding of step index ber Program to calculate Fiber Birefringence Betaf . . . Program to Find Attenuation in dB/km . . . . . . . To calculate input and output power in dBm . . . . . Rayleigh scattering loss . . . . . . . . . . . . . . . . . Program to calculate percent in decrease of number of modes . . . . . . . . . . . . . . . . . . . . . . . . . . . Calculation of pulse broadening . . . . . . . . . . . . Calculation of bandwidth distance . . . . . . . . . . . Program to Find out the Material Dispersion . . . . . Program to Find out Waveguide Dispersion . . . . . . Program to nd intrinsic carrier concentration . . . . Finding Enegy gap and Wavelength . . . . . . . . . . Finding Enegy gap and Wavelength . . . . . . . . . . To nd out the Internal Quantum Eciency and Internal Power level of LED source . . . . . . . . . . . . . . 4 2 3 3 4 5 5 7 7 8 8 9 11 11 12 12 13 14 14 15 16 16 17 17

Exa 2.1 Exa 2.2 Exa 2.3 Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa 2.4 2.5 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 4.1 4.3 4.4 4.5

Exa 4.6 Exa 4.7 Exa 4.8 Exa 4.9 Exa 5.1 Exa 5.2

Exa 5.3 Exa 5.4 Exa 5.5 Exa 5.6 Exa Exa Exa Exa Exa Exa 6.1 6.2 6.3 6.4 6.5 6.6

Exa 6.7 Exa 7.1 Exa 7.2 Exa 7.3 Exa 7.4 Exa Exa Exa Exa Exa Exa Exa Exa 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8

External Quantum Eciency in percentage . . . . . . Program to nd Lasing Threshold gain . . . . . . . . Program TO Calculate Frequency Spacing and Wavelength Spacing . . . . . . . . . . . . . . . . . . . . . . Calculation of number of half-wavelengths and wavelength spacing between lasing modes . . . . . . . . . . Calculation of Lateral power distribution coecient . Program to Calculate Optical Power Emitted from the Light source and Optical power coupled to step-index ber . . . . . . . . . . . . . . . . . . . . . . . . . . . . Fresnel reection, power coupled and power loss . . . Power coupled between two graded index bers . . . . Loss between single mode bers due to Lateral misalignment . . . . . . . . . . . . . . . . . . . . . . . . . Loss between single mode bers due to angular misalignment . . . . . . . . . . . . . . . . . . . . . . . . . Cut-o wavelength of photodiode . . . . . . . . . . . Calculation of Quantum eciency . . . . . . . . . . . Calculation of photocurrent . . . . . . . . . . . . . . Calculation of Responsivity of photodiode . . . . . . To nd primary photocurrent and multiplication factor Mean-square shot noise current, Mean-square dark current and Mean-Square thermal noise current . . . . . . Circuit bandwidth of a photodiode . . . . . . . . . . To nd optimum decision threshold . . . . . . . . . . To nd out signal-to-noise ratio and probability of error for given Q . . . . . . . . . . . . . . . . . . . . . . . Plotting Bit Error Rate versus Q factor . . . . . . . . To nd the energy of the photon incident on photodiode and Minimum incident optical power . . . . . . . . . . Program to calculate the Total Optical Power loss . . Program to calculate the system margin . . . . . . . Program to calculate link rise time . . . . . . . . . . Program to calculate link rise time . . . . . . . . . . Calculation of Number of bits aected by a burst error Program to nd coecients of generator polynomial . Program to nd CRC(Cyclic Redundancy Check) . . Program to percentage of burst error detected by CRC 5

18 19 19 20 22

22 23 24 24 25 26 26 27 27 28 29 30 31 31 33 34 35 35 36 36 37 37 38 39

Exa 8.9 Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa 9.1 9.2 10.1 10.2 10.3 10.5 10.6 10.7 10.8 10.9

Exa 10.10 Exa 10.11 Exa 10.12 Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa 11.1 11.2 11.3 11.6 11.7 11.8 11.9 11.10 12.1 12.2

Exa 12.3 Exa 12.4 Exa 12.5 Exa 12.6

Percent overhead to the information stream Using ReedSolomon code for error correction . . . . . . . . . . . . Program to nd Relative Intensity Noise (RIN) . . . . Program to Find limiting conditions for pin-photodiode Finding the center wavelength . . . . . . . . . . . . . Finding mean frequency spacing . . . . . . . . . . . . Program to nd coupling ratio, Excess loss, Insertion loss, Return loss of 2x2 Fiber coupler . . . . . . . . . . Finding output powers at output port of 2x2 coupler Program to nd waveguide length . . . . . . . . . . . Program to nd Excess loss, Splitting loss and total loss Program to Waveguide Length dierence . . . . . . . Fiber Bragg Grating: Peak Reectivity, Coupling coefcient, full-bandwidth . . . . . . . . . . . . . . . . . . Phased-Array-Based-Devices: Channel spacing in terms of wavelength and path-length dierence . . . . . . . . Phased-Array-Based Devices: Length dierence between adjacent array waveguides . . . . . . . . . . . . . . . . Maximum number of channels that can be placed in the tuning range . . . . . . . . . . . . . . . . . . . . . Program to calculate Photon density . . . . . . . . . Pumping rate and zero-signal gain . . . . . . . . . . . Maximum input power and maximum output power . Optical Signal-to-noise ratio (OSNR) . . . . . . . . . Pump power of EDFA . . . . . . . . . . . . . . . . . OSNR for dierent ASE noise level . . . . . . . . . . Noise penalty factor . . . . . . . . . . . . . . . . . . . Upper bound on input optical signal power . . . . . . Eective length of ber . . . . . . . . . . . . . . . . . Calculation of Stimulated Brillouin Scattering (SBS) threshold power . . . . . . . . . . . . . . . . . . . . . Four-wave mixing-calculation of power generated due to the interaction of signals at dierent frequencies . . Full-width Half-Maximum (FWHM) soliton pulse normalized time . . . . . . . . . . . . . . . . . . . . . . . Calculation of normalized distance parameter for dispersion shifted ber . . . . . . . . . . . . . . . . . . . Program to calculate soliton peak power . . . . . . . 6

39 40 40 46 46 47 48 48 49 49 50 51 52 53 54 54 55 56 56 57 57 58 59 59 60 61 61 62

Exa 12.7

FWHM soliton pulse width and fraction of bit slot occupied by a soliton . . . . . . . . . . . . . . . . . . . . Exa 13.1 Calculation of power budget for optical link . . . . . . Exa 13.2 Calculation of Number stations for given loss . . . . . Exa 13.3 Calculation of worst case Dynamic Range . . . . . . . Exa 13.4 Calculation of power margin between transmitter and receiver for Star architectures . . . . . . . . . . . . . . Exa 13.5 Determination of maximum length of multimode ber link . . . . . . . . . . . . . . . . . . . . . . . . . . . . Fig 14.10 Performance Measurement and Monitoring for sce . .

62 64 65 66 66 67 68

Chapter 1 First chapter


Scilab code Exa 1.1 Program to calculate time period and phase shift
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

// C a p t i o n : Program t o c a l c u l a t e t i m e p e r i o d and p h a s e shift // Example1 . 1 // Page 8 clear ; clc ; close ; f1 = 10^5; // f 1 = 100KHz f2 = 10^9; // f 2 = 1GHz T1 = 1/ f1 ; T2 = 1/ f2 ; phi = (1/4) *360; phi_rad = phi /57.3; disp ( T1 , Time p e r i o d o f s i n e wave w i t h f r e q u e n c y = 100 KHZ ) disp ( T2 , Time p e r i o d o f s i n e wave w i t h f r e q u e n c y = 1 GHZ ) disp ( phi , p h a s e s h i f t i n d e g r e e s ) ; disp ( phi_rad , p h a s e s h i f t i n r a d i a n s ) ; // R e s u l t // Time p e r i o d o f s i n e wave w i t h f r e q u e n c y = 100 KHZ // 0.00001 // Time p e r i o d o f s i n e wave w i t h f r e q u e n c y = 1GHZ 2

21 22 23 24 25

// 1 . 0 0 0D09 // p h a s e s h i f t i n d e g r e e s // 90. // p h a s e s h i f t i n r a d i a n s // 1.5706806 Scilab code Exa 1.2 Example 1.2

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

// C a p t i o n : Program t o c a l c u l a t e t i m e p e r i o d and p h a s e shift // Example1 . 1 // Page 8 clear ; clc ; close ; f1 = 10^5; // f 1 = 100KHz f2 = 10^9; // f 2 = 1GHz T1 = 1/ f1 ; T2 = 1/ f2 ; phi = (1/4) *360; phi_rad = phi /57.3; disp ( T1 , Time p e r i o d o f s i n e wave w i t h f r e q u e n c y = 100 KHZ ) disp ( T2 , Time p e r i o d o f s i n e wave w i t h f r e q u e n c y = 1 GHZ ) disp ( phi , p h a s e s h i f t i n d e g r e e s ) ; disp ( phi_rad , p h a s e s h i f t i n r a d i a n s ) ; // R e s u l t // Time p e r i o d o f s i n e wave w i t h f r e q u e n c y = 100 KHZ // 0.00001 // Time p e r i o d o f s i n e wave w i t h f r e q u e n c y = 1GHZ // 1 . 0 0 0D09 // p h a s e s h i f t i n d e g r e e s // 90. // p h a s e s h i f t i n r a d i a n s // 1.5706806

2 3 4 5 6 7 8 9 10 11 12

Scilab code Exa 1.4 1 // C a p t i o n : Shannon Channel C a p a c i t y f o r m u l a // Example1 . 4 // p a g e 12 clear ; clc ; close ; B = 10^6; // Bandwidth o f n o i s y c h a n n e l 10MHZ S_N = 1; // s i g n a l to n o i s e r a t i o n i s 1 C = B * log2 (1+ S_N ) ; disp (C , The maximum c a p a c i t y f o r t h i s c h a n n e l i n bits / sec C =) // R e s u l t // The maximum c a p a c i t y f o r t h i s c h a n n e l i n b i t s / s e c C = 1000000.

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Scilab code Exa 1.5 // C a p t i o n : C a p a c i t y o f a c h a n n e l 1 u s i n g shannon s f o r m u l a // Example1 . 5 // p a g e 12 clear ; clc ; close ; fLow = 3*(10^6) ; // low f r e q u e n c y = 3MHz fHigh = 4*(10^6) ; // h i h g f r e q u e n c y = 4MHz S_N_dB = 20; // s i g n a l to n o i s e r a t i o 20 dB S_N = 10^( S_N_dB /10) ; B = fHigh - fLow ; C = B * log2 (1+ S_N ) ; disp (B , Bandwidth i n Hz B = ) disp (C , C a p a c i t y o f a c h a n n e l i n b i t s / s e c s C = ) disp ( S_N , s i g n a l t o n o i s e r a t i o S /N = ) // R e s u l t // Bandwidth i n Hz B = 1000000. // C a p a c i t y o f a c h a n n e l i n b i t s / s e c s C = 6658211.5 // s i g n a l t o n o i s e r a t i o S /N = 100. 4

2 3 4 5 6 7 8 9 10 11 12 13 14 15

Scilab code Exa 1.6 // C a p t i o n : Program t o c a l c u l a t e 1 a t t e n u a t i o n ( o r ) l o s s o s power // Example 1 . 6 // p a g e 14 clear ; clc ; close ; P1 =1; // one w a t t P2 = P1 /2; // r e d u c e d by h a l f v a l u e Atten_dB = 10* log10 ( P2 / P1 ) ; disp ( Atten_dB , A t t e n u a t i o n i n dB = ) ; power_lost = 10^( Atten_dB /10) disp ( power_lost , The amount o f power l o s t = ) ; // R e s u l t // A t t e n u a t i o n i n dB = 3.0103 // The amount o f power l o s t = 0.5

2 3 4 5 6 7 8 9 10 11 12

13

Scilab code Exa 1.7 // C a p t i o n : Power g a i n c a l c u l a t i o n 1 f o r a s i g n a l t r a v e l l i n g from // one p o i n t t o a n o t h e r p o i n t // Example 1 . 7 // p a g e 14 clear ; clc ; close ; Loss_line1 = -9; //9 dB Amp_gain2 = 14; // 14 dB Loss_line3 = -3; //3 dB dB_at_line4 = Loss_line1 + Amp_gain2 + Loss_line3 ; disp ( dB_at_line4 , The amount o f power g a i n e d by 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 = ) // R e s u l t

14

// The amount o f power g a i n e d by 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.

Chapter 2 Second chapter


Scilab code Exa 2.1 1 // C a p t i o n : C r i t i c a l // Example 2 . 1 // p a g e 37 clear ; close ; clc ; n1 = 1.48; n2 = 1.00; phic = asin ( n2 / n1 ) ; disp ( phic *57.3 , T o t a l : c r i t i c a l angle of // R e s u l t // T o t a l I n t e r f l e c t i o n angle of incidence

Angle o f i n c i d e n c e

2 3 4 5 6 7 8 9 10 11 12

I n t e r f l e c t i o n r e f l e c t i o n angle incidence in degrees ) r e f l e c t i o n angle : c r i t i c a l 42.509773

2 3 4 5 6

Scilab code Exa 2.2 // C a p t i o n : F i n d i n g C r i t i c a l a n g l e , 1 numerical aperture , acceptance angle // Example 2 . 2 // p a g e 45 clear ; close ; clc ; 7

7 n1 = 1.48; // c o r e r e f r a c t i v e i n d e x 8 n2 = 1.46; // c l a d d i n g i n d e x 9 phic = asin ( n2 / n1 ) *57.3; 10 NA = sqrt ( n1 ^2 - n2 ^2) ; 11 phi0 = asin ( NA ) *57.3; 12 disp ( phic , C r i t i c a l a n l g e ) 13 disp ( NA , n u m e r i c a l a p e r t u r e ) 14 disp ( phi0 , a c c e p t a n c e a n g e l i n a i r ) 15 // R e s u l t 16 // C r i t i c a l a n l g e 17 // 80.575927 18 // n u m e r i c a l a p e r t u r e 19 // 0.2424871 20 // a c c e p t a n c e a n g e l i n a i r 21 // 14.034412

2 3 4 5 6 7 8 9 10 11 12 13 14 15

Scilab code Exa 2.3 // C a p t i o n : Program t o C a l c u l a t e 1 NORMALIZED FREQUENCY V and N u m e r i c a l A p e r t u r e // Example2 . 3 // Page 58 clear all ; close ; clc ; a = 25 e -06; Lambda =1300 e -09; V = 26.6; Numerical_Aperture = V * Lambda /(2* %pi * a ) disp ( Numerical_Aperture , N u m e r i c a l A p e r t u r e i s ) ; disp ( M = ( V ^2) /2 , T o t a l number o f modes M e n t e r i n g the f i b e r i s : ) // R e s u l t // N u m e r i c a l A p e r t u r e i s : 0.2201431 // T o t a l number o f modes M e n t e r i n g t h e f i b e r i s : 353.78

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Scilab code Exa 2.4 // C a p t i o n : Power f l o w i n t h e c o r e and 1 c l a d d i n g o f s t e p i n d e x f i b e r // Example 2 . 4 // p a g e 62 clear ; close ; clc ; V = [22 ,39]; M = V ^2/2; Pcladd_P = (4/3) *( M .^( -0.5) ) ; Pcore_P = 1 - Pcladd_P ; disp (M , T o t a l number o f modes ) disp ( Pcladd_P *100 , P e r c e n t a g e o f power p r o p a g a t e s i n the cladding ) // R e s u l t // T o t a l number o f modes // 242. 760.5 // P e r c e n t a g e o f power p r o p a g a t e s i n t h e c l a d d i n g // 8.5709913 4.8349182

2 3 4 5 6 7 8 9 10 11 12 13

Scilab code Exa 2.5 // C a p t i o n : Program t o c a l c u l a t e 1 F i b e r B i r e f r i n g e n c e BETA f // Example2 . 5 // p a g e 65 clear all ; close ; clc ; Lambda = input ( E n t e r t h e w a v e l e n g t h o f O p t i c a l S i g n a l ); Lp = input ( Beat Length ) ; BETA_f_FORMULA1 = 2* %pi / Lp ; 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 s i n g formula 1); BETA_f_FORMULA2 = Lambda / Lp ; 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 s i n g formula 2); // R e s u l t 9

14 15 16

// E n t e r t h e w a v e l e n g t h o f O p t i c a l S i g n a l 1 3 0 0 e 09 // Beat Length 8 e 02 // The f i b e r b i r e f r i e n g e n c e u s i n g f o r m u l a 1 78.539816 17 // The f i b e r b i r e f r i e n g e n c e u s i n g f o r m u l a 2 0.0000162

10

Chapter 3 Third chapter


Scilab code Exa 3.1 1 // C a p t i o n : Program t o Find A t t e n u a t i o n i n dB/km // Example3 . 1 // p a g e 91 clear ; clc ; z = [1 2]; // d i a t a n c e s a r e i n k i l o m e t e r alpha_in_dB_per_km = 3; r = ( alpha_in_dB_per_km * z ) /10; P0_Pz = (10^ r ) ; for i = 1: length ( P0_Pz ) Pz_P0 ( i ) = 1 -(1/ P0_Pz ( i ) ) ; end disp ( Pz_P0 *100 , O p t i c a l s i g n a l power d e c r e a s e d by i n percentage ) //RESULT // O p t i c a l s i g n a l power d e c r e a s e d by i n p e r c e n t a g e // 49.881277 // 74.881136

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Scilab code Exa 3.2 // C a p t i o n : To C a l c u l a t e i n p u t and 1 o u t p u t power i n dBm 2 // Example3 . 2 11

3 // p a g e 91 4 clear ; 5 close ; 6 clc ; 7 Pin = 200 e -06; // power l a u n c h e d i n t o t h e f i b e r 8 alpha = 0.4; // a t t e n u a t i o n i n dB p e r KM 9 z = 30; // o p t i c a l f i b e r l e n g t h 30 KM 10 Pin_dBm = 10* log10 ( Pin /1 e -03) ; 11 Pout_dBm = 10* log10 ( Pin /1 e -03) - alpha * z ; 12 Pout = 10^( Pout_dBm /10) 13 disp ( Pin_dBm , Pin dBm ) 14 disp ( Pout_dBm , Pout dBm ) 15 disp ( Pout *1 e -03 , Output power i n w a t t s ) 16 // R e s u l t 17 // Pin dBm = 6.9897 18.9897 18 // Pout dBm = 19 // Output power i n w a t t s = 0 . 0 0 0 0 1 2 6

Scilab code Exa 3.3 // C a p t i o n : R a y l e i g h s c a t t e r i n g l o s s 1 2 // Example3 . 3 3 // p a g e 9 7 4 clear ; 5 close ; 6 clc ; 7 alpha_0 = 1.64; // a t t e n u a t i o n a t Lambda 0 i n dB/KM 8 Lambda_0 = 850 e -09; // w a v e l e n g t h 850 n a n o m e t e r 9 Lambda = 1310 e -09; // w a v e l e n g t h 1 3 5 0 n a n o m e t e r 10 alpha_Lambda = alpha_0 *(( Lambda_0 / Lambda ) ^4) ; 11 disp ( alpha_Lambda , R a y l e i g h s c a t t e r i n g l o s s a l p h a ( Lambda ) = ) 12 // R e s u l t 13 // R a y l e i g h s c a t t e r i n g l o s s a l p h a ( Lambda ) = 0 . 2 9 0 6 9 2 9

Scilab code Exa 3.4 // C a p t i o n : Program t o c a l c u l a t e 1 p e r c e n t i n d e c r e a s e o f number o f modes 12

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

// Example 3 . 4 // p a g e 99 clear ; clc ; alpha = 2; // g r a d e d i n d e x p r o f i l e n2 = 1.5; // c l a d d i n g Lamda = 1.3 e -06; // w a v e l e n g t h R = 0.01; // bend r a d i u s o f c u r v a t u r e a = 25 e -06; // c o r e r a d i u s delta = 0.01; // c o r e c l a d d i n g i n d e x p r o f i l e k = 4.83 e06 ; // p r o p a g a t i o n c o n s t a n t disp (k , k = ) part1 = (2* a / R ) + floor ((3/(2* n2 * k * R ) ) ^(2/3) ) ; part2 = ( alpha +2) /(2* alpha * delta ) ; Neff_Ninf = 1 - part1 * part2 ; disp ( number o f modes d e c r e a s e d by ) disp ( P e r c e n t i n g r a d e d i n d e x f i b e r , Neff_Ninf *100) //RESULTS // number o f modes d e c r e a s e d by 50 P e r c e n t i n graded i n d e x f i b e r

2 3 4 5 6 7 8 9 10 11 12 13 14 15

Scilab code Exa 3.5 1 // C a p t i o n : C a l c u l a t i o n o f p u l s e b r o a d e n i n g // Example3 . 5 // p a g e 103 clear ; clc ; close ; C = 3 e08 ; // f r e e s p a c e v e l o c i t y i n m e t r e / s e c n1 = 1.48; // c o r e r e f r a c t i v e i n d e x n2 = 1.465; // c l a d d i n g r e f r a c t i v e i n d e x delta = 0.01; // i n d e x d i f f e r e n c e L = 10^3; // f i b e r l e n g t h 10KM deltaT = ( L *( n1 ^2) /( C * n2 ) ) * delta ; disp (( deltaT / L ) *10^12 , p u l s e b r o a d e n i n g i n n s /KM ) // R e s u l t // p u l s e b r o a d e n i n g i n n s /KM = 4 9 . 8 3 8 4 5 3 13

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Scilab code Exa 3.6 1 // C a p t i o n : C a l c u l a t i o n o f bandwidth d i s t a n c e // Example3 . 6 // p a g e 104 clear ; clc ; close ; n1 = 1.48; // c o r e r e f r a c t i v e i n d e x n2 = 1.465; // c l a d d i n i g r e f r a c t i v e i n d e x delta = 0.01; // i n d e x d i f f e r e n c e C =3*(10^8) ; // f r e e s p a c e v e l c o t i y BL = ( n2 /( n1 ^2) ) *( C / delta ) ; disp ( BL , Bandwidth d i s t a n c e i n bPS ) M disp ( BL /10^9 , Bandwidth d i s t a n c e i n MbPS KM ) // R e s u l t // Bandwidth d i s t a n c e i n bPS M // 2 . 0 0 6D+10 // Bandwidth d i s t a n c e i n MbPS KM // 20.064828

2 3 4 5 6 7 8 9 10 11 12

Scilab code Exa 3.7 // C a p t i o n : Program t o Find o u t t h e 1 Material Dispersion // Example3 . 7 // p a g e 1 0 7 clear ; clc ; Lamda = 800 e -09; // Wavelength i n m e t e r sigma_Lamda_LED = 40 e -09; // s p e c t r a l w i d t h i n m e t e r s pulse_spread = 4.4 e -12; // p u l s e s p r e a d i n s e c / m e t e r mat_dispersion = pulse_spread / sigma_Lamda_LED disp ( mat_dispersion , m a t e r i a l d i s p e r s i o n i n s e c o n d s / square meter ) // R e s u l t // m a t e r i a l d i s p e r s i o n i n s e c o n d s / s q u a r e m e t e r 14

0.00011

2 3 4 5 6 7 8 9 10 11 12 13 14

Scilab code Exa 3.8 // C a p t i o n : Program t o Find o u t 1 Waveguide D i s p e r s i o n // Example3 . 8 // p a g e 1 1 0 clear ; clc ; n2 = 1.48; // i n d e x o f c l a d d i n g delta = 0.002; // i n d e x d i f f e r e n c e Lamda = 1320 e -09; // Wavelength i n m e t e r s V_dVb_dV = 0.26; // The v a l u e i n s q u a r e b r a c k e t s f o r v = 2.4 C =3 e08 ; // 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 a c e Dwg_Lamda = -((( n2 * delta ) / C ) *(1/ Lamda ) ) * V_dVb_dV disp ( Dwg_Lamda *1 e06 , The w a v e g u i d e d i s p e r s i o n i n p s / nm . km ) ; //RESULTS // The w a v e g u i d e d i s p e r s i o n i n p s /nm . km = 1.9434343

15

Chapter 4 Fourth chapter


Scilab code Exa 4.1 // C a p t i o n : Program t o f i n d i n t r i n s i c 1 carrier concentration // Example4 . 1 // p a g e 1 3 6 clear ; close ; clc ; m = 9.11 e -31; // E l e c t r o n r e s t mass i n kg me = 0.068* m ; // E f f e c t i v e e l e c t r o n mass kg mh = 0.56* m ; // E f f e c t i v e h o l e mass i n kg Eg = 1.42*1.60218 e -19; // bandgap e n e r g y i n v o l t s kB = 1.38054 e -23; // Boltzma s c o n s t a n t T = 300; // room t e m p e r a t u r e i n k e l v i n h = 6.6256 e -34; // Planck s c o n s t a n t K = 2*((2* %pi * kB * T /( h ^2) ) ^1.5) *(( me * mh ) ^0.75) ; // c h a r a c t e r i s t i c constant of material ni = K * %e ^( - Eg /(2* kB * T ) ) ; disp ( ni , 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 c meter ) // R e s u l t // 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 e m e t e r 2 . 5 5 1D+12

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

16

2 3 4 5 6 7 8 9 10 11 12 13 14

Scilab code Exa 4.3 1 // C a p t i o n : F i n d i n g Enegy gap and Wavelength // Example4 . 3 // p a g e 1 4 6 clear ; close ; clc ; x =0.07; // c o m p o s i t i o n a l p a r a m e t e r o f GaAlAs Eg = 1.424+1.266* x +0.266* x ^2; Lamda = 1.240/ Eg ; disp ( Eg , Band Energy gap i n ev ) disp ( Lamda , Wavelength i n m i c r o m e t e r s ) // R e s u l t // Band Energy gap i n ev 1.5139234 // Wavelength i n m i c r o m e t e r s 0 . 8 1 9 0 6 3 9

2 3 4 5 6 7 8 9 10 11 12 13 14

Scilab code Exa 4.4 1 // C a p t i o n : F i n d i n g Enegy gap and Wavelength // Example4 . 4 // p a g e 1 4 6 clear ; close ; clc ; y =0.57; // c o m p o s i t i o n a l p a r a m e t e r o f InGaAsP Eg = 1.35 -0.72* y +0.12*( y ^2) ; Lamda = 1.240/ Eg ; disp ( Eg , Band Energy gap i n ev ) disp ( Lamda , Wavelength i n m i c r o m e t e r s ) // R e s u l t // Band Energy gap i n ev 0 . 9 7 8 5 8 8 // Wavelength i n m i c r o m e t e r s 1 . 2 6 7 1 3 1 8

Scilab code Exa 4.5 1 // C a p t i o n : To f i n d o u t t h e I n t e r n a l Quantum E 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 c e 2 // Example4 . 5 17

3 // p a g e 1 4 9 4 clear ; 5 clc ; 6 tuo_r = 30 e -09; // r a d i a t i v e r e c o m b i n a t i o n i n s e c o n d s 7 tuo_nr =100 e -09; // nonr a d i a t i v e r e c o m b i n a t i o n i n 8 9 10 11 12 13 14 15 16

17 18 19 20 21

22 23

seconds Etta_internal = 1/(1+( tuo_r / tuo_nr ) ) ; // i n t e r n a l quantum e f f i c i e n c y h = 6.6256 e -34; // Plank s c o n s t a n t C = 3 e08 ; // v e l o c i t y i n m/ s e c q = 1.602 e -19; // e l e c t r o n c h a r g e i n c o u l o m b s I = 40 e -03; // d r i v e c u r r e n t i n Amps Lamda = 1310 e -09; // peak w a v e l e n g t h o f InGaAsP LED Pinternal = ( Etta_internal *(( h * C ) / q ) ) *( I / Lamda ) ; // i n t e r n a l power l e v e l disp ( Pinternal , THE INTERNAL POWER GENRATED WITH IN LED SOURCE IN WATTS I S ) ; disp ( Etta_internal , The i n t e r n a l Quantum e f f i c i e n c y f o r t h e g i v e n r a d i a t i v e and nonr a d i a t i v e r e c o m b i n a t i o n time i s ); disp ( Etta_internal *100 , I n t e r n a l Quantum E f f i c i e n c y i n P e r c e n t a g e ); //RESULT //THE INTERNAL POWER GENRATED WITH IN LED SOURCE IN WATTS I S // 0 . 0 2 9 1 4 2 7 // The i n t e r n a l Quantum e f f i c i e n c y f o r t h e g i v e n r a d i a t i v e and nonr a d i a t i v e r e c o m b i n a t i o n t i m e i s 0.7692308 // I n t e r n a l Quantum E f f i c i e n c y i n P e r c e n t a g e // 7 6 . 9 2 3 0 7 7

Scilab code Exa 4.6 // C a p t i o n : E x t e r n a l Quantum 1 Efficiency in percentage 2 // Example 4 . 6 3 // p a g e 1 5 1 4 clear ; 18

5 close ; 6 clc ; 7 n = 3.5; // r e f r a c t i v e i n d e x o f an LED 8 Etta_External = 1/( n *( n +1) ^2) ; 9 disp ( Etta_External *100 , E x t e r n a l E f f i c i e n c y

in

percentage ) 10 // R e s u l t 11 // E x t e r n a l E f f i c i e n c y i n p e r c e n t a g e

1.4109347

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Scilab code Exa 4.7 1 // C a p t i o n : Program t o f i n d L a s i n g T h r e s h o l d g a i n // Example4 . 7 // p a g e 1 5 6 clear ; clc ; L = 500 e -06; // L a s e r d i o d e l e n g t h i n m e t e r s 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 one end ; 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 ; alpha_bar =10/1 e -02; // a b s o r p t i o n c o e f f i c i e n t ; alpha_end = (1/(2* L ) ) * log (1/( R1 * R2 ) ) ; // m i r r o r l o s s in the l a s i n g cavity alpha_threshold = alpha_bar + alpha_end ; // t o t a l l o s s disp ( alpha_threshold , The T h r e s h o l d Gain p e r m e t r e ) alpha_threshold_cm = alpha_threshold /100 disp ( alpha_threshold_cm , The T h r e s h o l d Gain p e r c e n t i m e t r e ); // R e s u l t // The T h r e s h o l d Gain p e r m e t r e 3 2 7 8 . 8 6 8 6 // The T h r e s h o l d Gain p e r c e n t i m e t r e 3 2 . 7 8 8 6 8 6

Scilab code Exa 4.8 // C a p t i o n : Program TO C a l c u l a t e 1 F r e q u e n c y S p a c i n g & Wavelength S p a c i n g 2 // Example4 . 8 3 // p a g e 1 6 0 4 clear ; 19

5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

clc ; Lamda = 850 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 e n = 3.7 // r e f r a c t i v e i n d e x o f LASER d i o d e L = 500 e -6 // l e n g t h o f LASER d i o d e C = 3 e08 // v e l o c i t y o f L i g h t i n f r e e s p a c e delta_frequency = C /((2* L ) * n ) ; delta_Lamda = ( Lamda ^2) /((2* L ) * n ) ; Half_power = 2e -09; // h a l f power p o i n t 3 n a n o m e t e r sigma = sqrt ( -( Half_power ^2) /(2* log (0.5) ) ) ; disp ( delta_frequency , E n t e r t h e f r e q u e n c y s p a c i n g i n Hertz ); disp ( delta_Lamda , E n t e r t h e w a e l e n g t h s p a c i n g i n metres ); disp ( sigma , s p e c t r a l w i d t h o f t h e g a i n ) ; //RESULT // E n t e r t h e f r e q u e n c y s p a c i n g i n H e r t z // 8 . 1 0 8D+10 // E n t e r t h e w a e l e n g t h s p a c i n g i n m e t r e s // 1 . 9 5 3D10 // s p e c t r a l w i d t h o f t h e g a i n // 1 . 6 9 9D09

2 3 4 5 6 7 8 9 10 11

Scilab code Exa 4.9 // C a p t i o n : C a l c u a l t i o n o f number o f 1 h a l f w a v e l e n g t h s and w a v e l e n g t h s p a c i n g b e t w e e n l a s i n g modes // Example4 . 9 // p a g e 1 6 1 clear ; clc ; close ; Lambda = 900 e -09; // w a v e l e n g t h o f l i g t h e m i t t e d by l a s e r dioda L = 300 e -06; // l e n g t h o f l a s e r c h i p n = 4.3; // r e f r a c t i v e i n d e x o f t h e l a s e r m a t e r i a l m = 2* L * n / Lambda ; // number o f h a l f w a v e l e n g t h s delta_Lambda = ( Lambda ^2) /(2* L * n ) ; // w a v e l e n g t h spacing 20

12 13 14 15 16

disp (m , number o f h a l f w a v e l e n g t h s s p a n n i n g t h e r e g i o n between m i r r o r s u r f a c e s ) disp ( delta_Lambda , s p a c i n g b e t w e e n l a s i n g modes i s ) // R e s u l t // number o f h a l f w a v e l e n g t h s s p a n n i n g t h e r e g i o n between m i r r o r s u r f a c e s 2866.6667 // s p a c i n g b e t w e e n l a s i n g modes i s 3 . 1 4 0D10

21

Chapter 5 Fifth chapter


Scilab code Exa 5.1 // C a p t i o n : C a l c u l a t i o n o f L a t e r a l 1 power d i s t r i b u t i o n c o e f f i c i e n t // Example5 . 1 // p a g e 1 9 2 clear ; clc ; close ; phi = 0; // l a t e r a l c o o r d i n a t e Half_power = 10; // h a l f power beam w i d t h teta = Half_power /2; teta_rad = teta /57.3; L = log (0.5) / log ( cos ( teta_rad ) ) ; disp (L , L a t e r a l power d i s t r i b u t i o n c o e f f i c i e n t L= ) // R e s u l t // L a t e r a l power d i s t r i b u t i o n c o e f f i c i e n t L = 181.83303

2 3 4 5 6 7 8 9 10 11 12 13 14

Scilab code Exa 5.2 // C a p t i o n : Program t o 1 Calcualte O p t i c a l Power E m i t t e d from t h e L i g h t s o u r c e and O p t i c a l power c o u p l e d t o s t e p i n d e x f i b e r 2 // Example5 . 2 3 // p a g e 1 9 4 4 clear ; 22

5 close ; 6 clc ; 7 rs = 35 e -06; // t h e s o u r c e r a d i u s i n m e t e r 8 a = 25 e -06; // t h e c o r e r a d i i o f s t e p i n d e x 9 10 11 12 13 14 15 16 17 18 19 20 21

fiber meter NA = 0.20; // t h e n u m e r i c a l a p e r t u r e v a l u e Bo = 150 e04 ; // r a d i a n c e i n W/ s q u a r e m e t e r . s r Ps = (( %pi ^2) *( rs ^2) ) * Bo ; // power e m i t t e d by t h e source if ( rs <= a ) then PLED_step = Ps *( NA ^2) ; elseif ( rs > a ) then PLED_step = ((( a / rs ) ^2) * Ps ) *( NA ^2) ; end disp ( Ps , O p t i c a l power e m i t t e d by LED l i g h t s o u r c e Ps = ) disp ( PLED_step , O p t i c a l Power c o u p l e d i n t o s t e p i n d e x f i b e r i n Watts PLED step = ) ; //RESULT // O p t i c a l power e m i t t e d by LED l i g h t s o u r c e Ps = 0.0181354 // O p t i c a l Power c o u p l e d i n t o s t e p i n d e x f i b e r i n Watts PLED step = 0.0003701

2 3 4 5 6 7 8 9 10 11 12

Scilab code Exa 5.3 // C a p t i o n : F r e s n e l r e f l e c t i o n , power 1 c o u p l e d and power l o s s // Example5 . 3 // p a g e 1 9 4 clear ; clc ; close ; n1 =3.6; // r e f r a c t i v e i n d e x o f o p t i c a l s o u r c e n = 1.48; // r e f r a c t i v e i n d e x o f s i l i c a f i b e r R = (( n1 - n ) /( n1 + n ) ) ^2; L = -10* log10 (1 - R ) ; disp (L , Power l o s s i n dB L = ) // R e s u l t 23

13

// Power l o s s i n dB L = 0 . 8 3 1 0 3 2 2

2 3 4 5 6 7 8 9 10 11 12 13

Scilab code Exa 5.4 // C a p t i o n : Power c o u p l e d b e t w e e n two 1 graded index f i b e r s // Example5 . 4 // p a g e 2 0 5 clear ; clc ; close ; a =1 e -06; // c o r e r a d i i i n m e t e r s d = 0.3* a ; // a x i a l o f f s e t PT_P = (2/ %pi ) *( acos ( d /(2* a ) ) -(1 -( d /(2* a ) ) ^2) ^0.5*( d /(6* a ) ) *(5 -0.5*( d / a ) ^2) ) ; PT_P_dB = 10* log10 ( PT_P ) disp ( PT_P_dB , O p t i c a l power c o u p l e d from f i r s t f i b e r i n t o s e c o n d f i b e r i n dB i s = ) // R e s u l t // O p t i c a l power c o u p l e d from f i r s t f i b e r i n t o s e c o n d f i b e r i n dB i s = 1.2597813

2 3 4 5 6 7 8 9 10 11 12 13 14

Scilab code Exa 5.5 // C a p t i o n : L o s s b e t w e e n 1 s i n g l e mode f i b e r s due t o L a t e r a l m i s a l i g n m e n t // Example5 . 5 // p a g e 211 clear ; clc ; close ; V = 2.405; // n o r m a l i z e d f r e q u e n c y n1 =1.47; // c o r e r e f r a c t i v e i n d e x n2 = 1.465; // c l a d d i n g r e f r a c t i v e i n d e x a = (9/2) *10^ -06; // c o r e r a d i i i n m e t e r s d = 1e -06; // l a t e r a l o f f s e t i n m e t e r s W = a *(0.65+1.619* V ^( -1.5) +2.879* V ^ -6) ; Lsm = -10* log10 ( exp ( -( d / W ) ^2) ) ; disp (W , mode f i e l d d i a m e t e r i n m e t e r s W = ) ; 24

disp ( Lsm , L o s s b e t w e e 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 = ) 16 // R e s u l t 17 // mode f i e l d d i a m e t e r i n m e t e r s W = 0 . 0 0 0 0 0 4 9 18 // L o s s b e t w e e 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 . 1 7 7 5 7 9 7


15

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

Scilab code Exa 5.6 // C a p t i o n : L o s s b e t w e e n s i n g l e mode 1 f i b e r s due t o a n g u l a r m i s a l i g n m e n t // Example5 . 6 // p a g e 2 1 2 clear ; clc ; close ; clear ; clc ; close ; V = 2.405; // n o r m a l i z e d f r e q u e n c y n1 =1.47; // c o r e r e f r a c t i v e i n d e x n2 = 1.465; // c l a d d i n g r e f r a c t i v e i n d e x a = (9/2) *10^ -06; // c o r e r a d i i i n m e t e r s d = 1e -06; // l a t e r a l o f f s e t i n m e t e r s W = a *(0.65+1.619* V ^( -1.5) +2.879* V ^ -6) ; // mode f i e l d diameter teta = 1; // i n d e g r e e s teta = 1/57.3; // i n r a d a i a n s Lambda = 1300 e -09; // w a v e l e n g t h i n m e t e r s Lsm_ang = -10* log10 ( exp ( -( %pi * n2 * W * teta / Lambda ) ^2) ) ; disp ( Lsm_ang , L o s s b e t w e e n s i n g l e mode f i b e r s due t o a n g u l a r m i s a l i g n m e n t Lsm ang = ) // R e s u l t // L o s s b e t w e e n s i n g l e mode f i b e r s due t o a n g u l a r m i s a l i g n m e n t Lsm ang = 0 . 4 0 5 4 6 5 8

25

Chapter 6 Sixth chapter


Scilab code Exa 6.1 1 // C a p t i o n : Cut o f f w a v e l e n g t h o f p h o t o d i o d e // Example6 . 1 // p a g e 2 2 4 clear ; clc ; close ; h = 6.625*(10^ -34) ; // p l a n k s c o n s t a n t C = 3*(10^8) ; // f r e e s p a c e v e l o c i t y Eg = 1.43*1.6*(10^ -19) ; // j o u l e s LambdaC = h * C / Eg ; disp ( LambdaC , Cut o f f Wavelength o f p h o t o d i o d e i n meters = ) // R e s u l t // Cut o f f Wavelength o f p h o t o d i o d e i n m e t e r s= 0.0000009

2 3 4 5 6 7 8 9 10 11 12 13

2 3 4 5

Scilab code Exa 6.2 1 // C a p t i o n : C a l c u l a t i o n o f Quantum e f f i c i e n c y // Example6 . 2 // p a g e 226 clear ; clc ; 26

6 7 8 9 10 11 12 13 14

close ; Ip_q = 5.4*(10^6) ; // e l e c t r o n h o l e p a i r s g e n e r a t e d Pin_hv = 6*(10^6) ; // number o f i n c i d e n t p h o t o n s etta = Ip_q / Pin_hv ; disp ( etta , Quantum e f f i c i e n c y = ) disp ( etta *100 , Quantum e f f i c i e n c y i n p e r c e n t a g e = ) // R e s u l t // Quantum e f f i c i e n c y = 0 . 9 // Quantum e f f i c i e n c y i n p e r c e n t a g e = 9 0 .

2 3 4 5 6 7 8 9 10 11 12

Scilab code Exa 6.3 1 // C a p t i o n : C a l c u l a t i o n o f p h o t o c u r r e n t // Example6 . 3 // p a g e 2 2 6 clear ; clc ; close ; R = 0.65; // R e s p o n s i v i t y o f p h o t o d i o d e Pin = 10*(10^ -6) ; // O p t i c a l power l e v e l i n w a t t s Ip = R * Pin ; disp ( Ip *10^6 , The amount o f p h o t o c u r r e n t g e n e r a t e d i n uA = ) // R e s u l t // The amount o f p h o t o c u r r e n t g e n e r a t e d i n uA = 6 . 5

2 3 4 5 6 7 8 9 10

Scilab code Exa 6.4 // C a p t i o n : C a l c u l a t i o n o f 1 Responsivity of photodiode // Example6 . 4 // p a g e 2 2 7 clear ; clc ; close ; Lambda = 1300 e -09; // w a v e l e n g t h i n m e t e r s C = 3*(10^8) ; // f r e e s p a c e v e l o c i t y v = C / Lambda ; // f r e q u e n c y i n Hz q = 1.6*(10^ -19) ; // Change i n c o u l o m b s 27

11 etta = 0.9; // quantum e f f i c i e n c y 90% 12 h = 6.625*10^ -34; // p l a n k s c o n s t a n t 13 R = ( etta * q ) /( h * v ) ; // R e s p o n s i v i t y 14 disp (R , 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 3 0nm i n A/W 15 16 17 18 19 20

R = ) Eg = 0.73; // e n e r g y gap i n e l e c t r o n v o l t s LambdaC = 1.24/ Eg ; // cut o f f w a v e l e n g t h i n m e t e r s disp ( LambdaC , cut o f f w a v e l e n g t h i n m e t e r s = ) // R e s u l t // 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 3 0nm i n A/W R = 0.9418868 // cut o f f w a v e l e n g t h i n m e t e r s = 1 . 6 9 8 6 3 0 1

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Scilab code Exa 6.5 // C a p t i o n : To f i n d p r i m a r y 1 p h o t o c u 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 // Example6 . 5 // p a g e 2 3 0 clear ; clc ; close ; etta = 0.65; // quantum e f f i c i e n c y o f s i l i c o n qavalanche photodiode C = 3*(10^8) ; // f r e e s p a c e v e l o c i t y i n m/ s Lambda = 900 e -09; // w a v e l e n g t h i n m e t e r s q = 1.6*(10^ -19) ; // c h a r g e i n c o u l o m b s h = 6.625*(10^ -34) ; // p l a n k s c o n s t a n t v = C / Lambda ; // f r e q u n e c y i n Hz Pin = 0.5*10^ -06; // o p t i c a l power Ip = (( etta * q ) /( h * v ) ) * Pin ; Im = 10*(10^ -06) ; // m u l t i p l i e d p h o t o c u r r e n t M = Im / Ip ; // m u l t i p l i c a t i o n f a c t o r disp ( Ip *10^6 , Primary p h o t o c u r r e n t i n uAmps I p= ) disp ( ceil ( M ) , Primary p h o t o c u r r e n t i s m u l t i p l i e d by a factor of M =) // R e s u l t // Primary p h o t o c u r r e n t i n uAmps I p = 0.2354717 28

21

// Primary p h o t o c u r r e n t i s m u l t i p l i e d by a f a c t o r o f M = 43.

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

Scilab code Exa 6.6 // C a p t i o n : Means q u a r e s h o t n o i s e 1 c u r r e n t , Means q u a r e d a r k c u r r e n t and MeanS q u a r e thermal noise current // Example6 . 6 // p a g e 234 clear ; clc ; close ; Lambda = 1330 e -09; // w a v e l e n g t h i n m e t e r s ID = 4e -09; // p h o t o d i o d e c u r r e n t etta = 0.90; // quantum e f i c i e n c y RL = 1000; // Load r e s i s t a n c e 1 0 0 0 ohms Pin = 300 e -09; // i n c i d e n t o p t i c a l power i s 300 nano watts Be = 20*(10^6) ; // r e c e i v e r bandwidth q = 1.6*(10^ -19) ; // c h a r g e i n c o u l o m b s h = 6.625*10^ -34; // p l a n k s c o n s t a n t v = (3*10^8) / Lambda ; // f r e q u e n c y i n Hz Ip = ( etta * q * Pin ) /( h * v ) ; // p r i m a r y p h o t o c u r r e n t Ishot = 2* q * Ip * Be ; // s h o t n o i s e c u r r e n t Ishot = sqrt ( Ishot ) ; IDB = 2* q * ID * Be ; // d a r k c u r r e n t IDB = sqrt ( IDB ) ; T = 283; // room t e m p e r a t u r e i n k e l v i n KB = 1.38*10^ -23; // boltzmann s c o n s t a n t RL = 1000; // l o a d r e s i s t a n c e IT = (4* KB * T ) * Be / RL ; // Thermal n o i s e c u r r e n t IT = sqrt ( IT ) ; disp ( Ip *10^6 , p r i m a r y p h o t o c u r r e n t i n uA IP = ) disp ( Ishot *10^9 , means q u a r e s h o t n o i s e c u r r e n t f o r a p i n p h o t o d i o d e i n nA I s h o t = ) disp ( IDB *10^9 , means q u a r e d a r k c u r r e n t i n nA IDB= ) disp ( IT *10^9 , means q u a r e t h e r m a l n o i s e c u r r e n t f o r t h e r e c e i v e r i n nA IT = ) 29

// R e s u l t // p r i m a r y p h o t o c u r r e n t i n uA IP = 0 . 2 8 9 0 8 6 8 // means q u a r e s h o t n o i s e c u r r e n t f o r a p i n p h o t o d i o d e i n nA I s h o t = 1 . 3 6 0 2 0 4 2 33 // means q u a r e d a r k c u r r e n t i n nA IDB = 0 . 1 6 34 // means q u a r e t h e r m a l n o i s e c u r r e n t f o r t h e r e c e i v e r i n nA IT = 1 7 . 6 7 5 7 4 6


30 31 32

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Scilab code Exa 6.7 1 // C a p t i o n : c i r c u i t bandwidth o f a p h o t o d i o d e // Example6 . 7 // p a g e 239 clear ; clc ; close ; CP = 3*10^ -12; // p h o t o d i o d e c a p a c i t a n c e i s 3 p i c o farad CA = 4*10^ -12; // a m p l i f i e r c a p c i t a n c e i s 4 p i c o f a r a d CT = CP + CA ; // t o t a l c a p a c i t a n c e RT1 = 1000; // p h o t o d i o d e l o a d r e s i s t a n c e BC1 = 1/(2* %pi * RT1 * CT ) ; // c i r c u i t bandwidth RT2 = 50; // p h o t o d i o d e l o a d r e s i s t a n c e BC2 = 1/(2* %pi * RT2 * CT ) ; // c i r c u i t bandwidth disp ( BC1 , C i r c u i t bandwidth 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 = ) disp ( BC2 , C i r c u i t bandwidth f o r 50 ohm p h o t o d i o d e r e s i s t a n c e BC2 = ) // R e s u l t // C i r c u i t bandwidth 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 3 6 4 2 0 . // C i r c u i t bandwidth f o r 50 ohm p h o t o d i o d e r e s i s t a n c e BC2 = 4 . 5 4 7D+08

30

Chapter 7 Seventh chapter


Scilab code Exa 7.1 1 // C a p t i o n : To f i n d optimum d e c i s i o n t h r e s h o l d // Example7 . 1 // Page 258 clear ; clc ; close ; bon = 1; boff =0; sigma_on = 1; sigma_off = 1; Q = ( bon - boff ) /( sigma_on + sigma_off ) Vth = bon - Q * sigma_on disp (Q , Q p a r a m e t e r v a l u e = ) disp ( Vth , optimum d e c i s i o n t h r e s h o l d Vth = ) // R e s u l t //Q p a r a m e t e r v a l u e = 0 . 5 // optimum d e c i s i o n t h r e s h o l d Vth = 0 . 5

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Scilab code Exa 7.2 1 // C a p t i o n : To f i n d o u t s i g n a l to n o i s e r a t i o and p r o b a b i l i t y o f e r r o r f o r g i v e n Q 2 // Example7 . 2 31

Figure 7.1: Figure for Example7.3

3 // Page 258 4 clear ; 5 clc ; 6 close ; 7 Q = 6; 8 Pe = (1/2) *(1 - erf ( Q / sqrt (2) ) ) ; 9 S_N_dB = 10* log10 (2* Q ) ; 10 disp ( Pe , 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 t 13 // P r o b a b i l i t y o f e r r o r Pe (Q) = 9 . 8 6 6D10 14 // S i g n a l to n o i s e r a t i o i n dB S/N = 1 0 . 7 9 1 8 1 2

32

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

Scilab code Exa 7.3 1 // C a p t i o n : P l o t t i n g B i t E r r o r Rate v e r s u s Q f a c t o r // Example7 . 3 // p a g e 259 clear ; clc ; close ; Q = 0:0.01:8; Pe = (1/2) *(1 - erf ( Q ./ sqrt (2) ) ) ; a = gca () ; a . data_bounds =[0 ,1 e -16;8 ,0.5]; plot (Q , Pe , r ) xlabel ( Q ) ylabel ( Pe ) title ( BER( Pe ) v e r s u s t h e f a c t o r Q ) disp ( Pe (1) , P r o b a b i l i t y o f e r r o r a t Q =0 ) disp ( Pe (101) , P r o b a b i l i t y o f e r r o r a t Q =1 ) disp ( Pe (201) , P r o b a b i l i t y o f e r r o r a t Q =2 ) disp ( Pe (301) , P r o b a b i l i t y o f e r r o r a t Q =3 ) disp ( Pe (401) , P r o b a b i l i t y o f e r r o r a t Q =4 ) disp ( Pe (501) , P r o b a b i l i t y o f e r r o r a t Q =5 ) disp ( Pe (601) , P r o b a b i l i t y o f e r r o r a t Q =6 ) disp ( Pe (701) , P r o b a b i l i t y o f e r r o r a t Q =7 ) disp ( Pe (801) , P r o b a b i l i t y o f e r r o r a t Q =8 ) // R e s u l t // P r o b a b i l i t y o f e r r o r a t Q =0 // 0.5 // P r o b a b i l i t y o f e r r o r a t Q =1 // 0.1586553 // P r o b a b i l i t y o f e r r o r a t Q =2 // 0.0227501 // P r o b a b i l i t y o f e r r o r a t Q =3 // 0.0013499 // P r o b a b i l i t y o f e r r o r a t Q =4 // 0.0000317 // P r o b a b i l i t y o f e r r o r a t Q =5 // 0.0000003 // P r o b a b i l i t y o f e r r o r a t Q =6 33

38 39 40 41 42

// 9 . 8 6 6D10 // P r o b a b i l i t y o f e r r o r a t Q =7 // 1 . 2 8 0D12 // P r o b a b i l i t y o f e r r o r a t Q =8 // 6 . 1 0 6D16

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Scilab code Exa 7.4 // C a p t i o n : To f i n d t h e e n e r g y o f t h e 1 p h o t o n i n c i d e n t on p h o t o d i o d e // and Minimum i n c i d e n t o p t i c a l power // Example7 . 4 // p a g e 262 clear ; clc ; close ; h = 6.626 e -34; // p l a n k s c o n s t a n t J / s C = 3 e08 ; // f r e e s p a c e v e l o c i t y i n m/ s B = 10 e06 ; // d a t a r a t e 10 Mb/ s e c tuo = 2/ B ; // 1/ t u o = h a l f t h e d a t a r a t e B Lambda = 850 e -09; // o p e r a t i n g w a v e l e n g t h i n nm E = 20.7* h * C / Lambda ; Pi = E / tuo ; disp (E , Energy o f t h e i n c i d e n t p h o t o n E = ) disp ( Pi , minimum i n c i d e n t o p t i c a l power Pi = ) disp (10* log10 ( Pi *1000) , minimum i n c i d e n t o p t i c a l power i n dBm = ) // R e s u l t // Energy o f t h e i n c i d e n t p h o t o n E = 4 . 8 4 1D18 // minimum i n c i d e n t o p t i c a l power Pi = 2 . 4 2 0D11 // minimum i n c i d e n t o p t i c a l power i n dBm = 76.161059

34

Chapter 8 Eight chapter


Scilab code Exa 8.1 // C a p t i o n : Program t o c a l c u l a t e t h e 1 T o t a l O p t i c a l Power l o s s // Example8 . 1 // p a g e 287 clear ; clc ; close ; system_margin = 6; // i n dB alpha = 3.5; // a t t e n u a t i o n i n dB/Km L =6; // Length o f t r a n s m i s s i o n p a t h i n Km lc = 1; // c o n n e c t o r l o s s i n dB PT = 2* lc + alpha * L + system_margin ; disp ( PT , The t o t a l o p t i c a l power l o s s i n dB PT = ) // R e s u l t // The t o t a l o p t i c a l power l o s s i n dB PT = 2 9 .

2 3 4 5 6 7 8 9 10 11 12 13 14

2 3 4 5 6

Scilab code Exa 8.2 1 // C a p t i o n : Program t o c a l c u l a t e t h e s y s t e m m a r g i n // Example8 . 2 // p a g e 288 clear ; clc ; close ; 35

7 8 9 10 11 12 13 14 15 16 17 18 19

Ps = 3; // l a s e r o u t p u t i n dBm APD_sen = -32; //APD s e n s i t i v i t y i n dBm Allowed_Loss = Ps - APD_sen ; // i n dB lsc = 1; // s o u r c e c o n n e c t o r l o s s i n dB ljc = 2*4; // two ( jumper+c o n n e c t o r l o s s ) i n dB alpha = 0.3; // a t t e n u a t i o n i n dB/Km L = 60; // c a b l e l e n g t h i n Km cable_att = alpha *60; // c a b l e a t t e n u a t i o n i n dB lrc = 1; // r e c e i v e r c o n n e c t o r l o s s i n dB system_margin = Allowed_Loss - lsc - ljc - cable_att - lrc ; disp ( system_margin , The F i n a l Margin i n dB = ) // R e s u l t // The F i n a l Margin i n dB = 7 .

2 3 4 5 6 7 8 9 10 11 12 13 14

Scilab code Exa 8.3 1 // C a p t i o n : Program t o c a l c u l a t e l i n k r i s e t i m e // Example8 . 3 // p a g e 291 clear ; clc ; close ; t_tx = 15 e -09; // t r a n s m i t t e r r i s e t i m e t_mat = 21 e -09; // m a t e r i a l d i s p e r s i o n r e l a t e d r i s e time t_mod = 3.9 e -09; // r i s e t i m e r e s u l t i n g from modal dispersion t_rx =14 e -09; // r e c e i v e r r i s e t i m e tsys = sqrt ( t_tx ^2+ t_mat ^2+ t_mod ^2+ t_rx ^2) disp ( tsys *1 e09 , l i n k r i s e t i m e i n nano s e c o n d s t s y s =) // R e s u l t // l i n k r i s e t i m e i n nano s e c o n d s t s y s = 2 9 . 6 1 7 7 3 1

Scilab code Exa 8.4 1 // C a p t i o n : Program t o c a l c u l a t e l i n k r i s e t i m e 2 // Example8 . 4 36

3 // p a g e 2 9 2 4 clear ; 5 clc ; 6 close ; 7 t_tx = 25 e -12; // t r a n s m i s s i o n r i s e t i m e i n s e c 8 t_GVD = 12 e -12; //GVD r i s e t i m e i n s e c 9 t_rx = 0.14 e -09; // r e c e i v e r r i s e t i m e i n s e c 10 tsys = sqrt ( t_tx ^2+ t_GVD ^2+ t_rx ^2) 11 disp ( tsys *1 e09 , l i n k r i s e t i m e i n nano s e c o n d s

tsys =) 12 // R e s u l t 13 // l i n k r i s e t i m e i n nano s e c o n d s t s y s = 0 . 1 4 2 7 2 0 0

2 3 4 5 6 7 8 9 10 11 12

Scilab code Exa 8.5 // C a p t i o n : C a l c u l a t i o n o f Number o f 1 b i t s a f f e c t e d by a b u r s t e r r o r // Example8 . 5 // p a g e 306 clear ; clc ; close ; bit_error_dur = 1e -03; // b i t c o r r u p t i n g b u r s t n o i s e d u r a t i o n i n msec B = 10 e03 ; // d a t a r a t e 10 kb / s e c N = B * bit_error_dur ; disp (N , Number o f b i t s a f f e c t e d by a b u r s t e r r o r N= ) // R e s u l t // Number o f b i t s a f f e c t e d by a b u r s t e r r o r N = 1 0 .

2 3 4 5

Scilab code Exa 8.6 // C a p t i o n : Program t o f i n d 1 c o e f f i c i e n t s of generator polynomial // Example8 . 6 // p a g e 308 clear ; clc ; 37

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

of generator polynomial

C =) 11 // R e s u l t 12 // C o e f f i c i e n t s o f g e n e r a t o r p o l y n o m i a l C = 1 . 1. 0. 0. 1. 1. 1.

0.

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Scilab code Exa 8.7 // C a p t i o n : Program t o f i n d CRC( 1 C y c l i c Redundancy Check ) // Example8 . 7 // p a g e 308 clear ; clc ; close ; x = poly (0 , x ) ; m = [1 ,1 ,1 ,1 ,0]; G = x ^7+ x ^6+ x ^5+ x ^4+0+0+0+0; D = x ^3+0+ x +1; [R , Q ] = pdiv (G , D ) R = coeff ( R ) ; Q = coeff ( Q ) ; R = abs ( modulo (R ,2) ) ; Q = abs ( modulo (Q ,2) ) ; disp (R , Remainder R = ) disp (Q , Q u o t i e n t Q = ) 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 = ) // R e s u l t // Remainder R = // 1. 0. 1. // Q u o t i e n t Q = // 1. 1. 0. 1. 1. //CRC f o r t h e g i v e n i n f o r m a t i o n CRC = // 1. 1. 1. 1. 0. 1. 0. 1.

38

2 3 4 5 6 7 8 9 10 11

Scilab code Exa 8.8 // C a p t i o n : Program t o p e r c e n t a g e o f 1 b u r s t e r r o r d e t e c t e d by CRC // Example8 . 8 // p a g e 309 clear ; clc ; close ; N =32; Ped = 1 -(1/(2^ N ) ) ; disp ( Ped *100 , P e r c e n t o f b u r s t e r r o r d e t e c t e d by CRC f o r a l e n g t h o f 32 Ped= ) // R e s u l t // P e r c e n t o f b u r s t e r r o r d e t e c t e d by CRC f o r a l e n g t h o f 32 Ped =100.

2 3 4 5 6 7 8 9 10 11 12 13 14 15

Scilab code Exa 8.9 // C a p t i o n : P e r c e n t o v e r h e a d t o t h e 1 i n f o r a m t i o n s t r e a m U s i n g ReedSolomon c o d e f o r error correction // Example8 . 9 // p a g e 309 clear ; clc ; close ; S =8; // ReedSolomon c o d e w i t h 1 b y t e n = (2^ S -1) ; // l e n g t h o f c o d e d s e q u e n c e k = 239; // l e n g t h o f m e s s a g e s e q u e n c e r = n-k; disp (r , number o f r e d u n d a n t b y t e s r = ) disp (( r / k ) *100 , P e r c e n t o v e r h e a d = ) // R e s u l t // number o f r e d u n d a n t b y t e s r = 1 6 . // P e r c e n t o v e r h e a d = 6.6945607

39

Chapter 9 Ninth chapter


Scilab code Exa 9.1 // C a p t i o n : Program t o f i n d R e l a t i v e 1 I n t e n s i t y N o i s e ( RIN ) // Example9 . 1 // p a g e 320 clear ; clc ; close ; IB_Ith = [1.3 ,1.4 ,1.5 ,1.6]; // r a t i o b e t w e e n b i a s c u r r e n t and t h r e s h o l d c u r r e n t f = 100 e06 ; // f r e q u e n c y = 100MHz RIN = (( IB_Ith -1) ^ -3) / f ; RIN_dB = 20* log10 ( RIN ) ; disp ( RIN_dB , R e l a t i v e I n t e n s i t y N o i s e ( RIN ) i n dB/Hz RIN dB = ) // R e s u l t // R e l a t i v e I n t e n s i t y N o i s e ( RIN ) i n dB/Hz RIN dB = // 128.62728 136.1236 141.9382 146.68908

2 3 4 5 6 7 8 9 10 11 12 13 14

Scilab code Exa 9.2 // C a p t i o n : Program t o Find l i m i t i n g 1 c o n d i t i o n s f o r pin p h o t o d i o d e 2 // Example9 . 3 40

Figure 9.1: Figure for Example9.2Preamplier

41

Figure 9.2: Figure for Example9.2quantumnoise

42

Figure 9.3: Figure for Example9.2reectionnoise

43

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

// p a g e 323 clear ; clc ; close ; T =300; // room t e m p e r a t u r e i n k e l v i n kB = 1.38054 e -23; // Boltzmann s c o n s t a n t i n J o u l e s / k m =0.25; // m o d u a l t i o n i n d e x RIN_dB = -143; // R e l a t i v e i n t e n s i t y i n dB/Hz RIN = 10^( RIN_dB /10) ; Pc = (10^(0/10) ) *1 e -3; // power c o u p l e d t o o p t i c a l f i b e r i n dBm R = 0.6; // R e s p o n s i v i t y A/w Be = 10 e06 ; // bandwidth 10MHz ID = 10 e -09; // d a r k c u r r e n t 10nA Req = 750; // e q u i v a l e n t r e s i s t a n c e 750 ohm Ft = 10^(3/10) ; // i n 3 dB 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 i n p h o t o d i o d e R = 0.6; // r e s p o n s i v i t y i n A/m q = 1.602 e -19; // c h a r g e i n c o u l o m b s p = 0: -1: -20; P = (10^( p /10) ) *1 e -3; C_N_1 = 0.5*(( m * R * P ) ^2) /(4* kB * T * Be * Ft / Req ) ; C_N_3 = 0.5* m ^2/( RIN * Be ) ; C_N_2 = 0.5* m ^2* R * P /(2* q * Be ) ; figure plot (p ,10* log10 ( C_N_1 ) , r ) xlabel ( R e c e i v e d O p t i c a l Power (dBm) ) ylabel ( C a r r i e r to n o i s e r a t i o ( dB ) ) title ( C a r r i e r to n o i s e r a t i o 1 ( P r e a m p l i f i e r receiver noise ) ) figure plot (p ,10* log10 ( C_N_2 ) , m ) xlabel ( R e c e i v e d O p t i c a l Power (dBm) ) ylabel ( C a r r i e r to n o i s e r a t i o ( dB ) ) title ( 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 ) ) figure plot (p ,10* log10 ( C_N_3 ) * ones (1 , length ( p ) ) ) xlabel ( R e c e i v e d O p t i c a l Power (dBm) ) 44

39 40

ylabel ( C a r r i e r to n o i s e r a t i o ( dB ) ) title ( 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 s e ) )

45

Chapter 10 Tenth chapter


Scilab code Exa 10.1 1 // C a p t i o n : F i n d i n g t h e c e n t e r w a v e l e n g t h // Example10 . 1 // p a g e 343 clear ; clc ; close ; delta_v = 14 e12 ; // o p t i c a l bandwidth Lambda = 1520; // s p e c t r a l band C = 3 e08 ; // f r e e s p a c e v e l o c i t y delta_Lambda = ( Lambda ^2) * delta_v / C ; disp ( delta_Lambda *1 e -09 , s p e c t r a l band i n nano m e t e r ) // R e s u l t // s p e c t r a l band i n nano m e t e r = 1 0 7 . 8 1 8 6 7

2 3 4 5 6 7 8 9 10 11 12 13

2 3 4 5 6

Scilab code Exa 10.2 1 // C a p t i o n : F i n d i n g mean f r e q u e n c y s p a c i n g // Example10 . 2 // p a g e 343 clear ; clc ; close ; 46

7 C = 3 e08 ; // f r e e s p a c e v e l o c i t y 8 delta_Lambda = 0.8 e -09; // s p e c t r a l band i n m e t e r 9 Lambda = 1550 e -09; // w a v e l e n g t h i n m e t e r 10 delta_v = C * delta_Lambda / Lambda ^2; 11 disp ( ceil ( delta_v *1 e -09) , Mean F r e q u e n c y s p a c i n g i n

GHz = ) 12 // R e s u l t 13 // Mean F r e q u e n c y s p a c i n g i n GHz = 1 0 0 .

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Scilab code Exa 10.3 // C a p t i o n : Program t o f i n d c o u p l i n g 1 r a t i o , E x c e s s l o s s , I n s e r t i o n l o s s , Return l o s s o f 2 x2 F i b e r c o u p l e r // Example10 . 3 // p a g e 348 clear ; clc ; close ; P0 = 200 e -06; // i n p u t o p t i c a l power l e v e l i n w a t t s P1 = 90 e -06; // o u t p u t power a t p o r t 1 P2 = 85 e -06; // o u t p u t power a t p o r t 2 P3 = 6.3 e -09; // o u t p u t power a t p o r t 3 Coupling_ratio = ( P2 /( P1 + P2 ) ) *100; Excess_loss = 10* log10 ( P0 /( P1 + P2 ) ) ; Insertion_loss_0_1 = 10* log10 ( P0 / P1 ) ; Insertion_loss_0_2 = 10* log10 ( P0 / P2 ) ; Return_loss = 10* log10 ( P3 / P0 ) ; disp ( Coupling_ratio , C o u p l i n g r a t i o ) disp ( Excess_loss , E x c e s s l o s s i n dB ) disp ( Insertion_loss_0_1 , I n s e r t i o n l o s s ( p o r t 0 t o p o r t 1 ) i n dB ) disp ( Insertion_loss_0_2 , I n s e r t i o n l o s s ( p o r t 0 t o p o r t 2 ) i n dB ) disp ( Return_loss , Retunr l o s s i n dB ) // R e s u l t // C o u p l i n g r a t i o // 48.571429 // E x c e s s l o s s i n dB 47

25 26 27 28 29 30 31

// 0.5799195 // I n s e r t i o n l o s s ( p o r t 0 t o p o r t 1 ) i n dB // 3.4678749 // I n s e r t i o n l o s s ( p o r t 0 t o p o r t 2 ) i n dB // 3.7161107 // Retunr l o s s i n dB // 45.016894

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Scilab code Exa 10.5 // C a p t i o n : F i n d i n g o u t p u t p o w e r s a t 1 o u t p u t p o r t o f 2 x2 c o u p l e r // Example10 . 5 // p a g e 350 clear ; clc ; close ; S = sqrt (1/2) *[1 , %i ; %i ,1]; // s c a t t e r i n g m a t r i x Ein = [1;0]; Eout = S * Ein ; Pout1 = Eout (1) * conj ( Eout (1) ) ; Pout2 = Eout (2) * conj ( Eout (2) ) ; disp ( Pout1 , Output power a t p o r t 1 Pout1 = ) disp ( Pout2 , Output power a t p o r t 2 Pout2 = ) // R e s u l t // Output power a t p o r t 1 Pout1 = 0 . 5 // Output power a t p o r t 2 Pout2 = 0 . 5

2 3 4 5 6 7 8

Scilab code Exa 10.6 1 // C a p t i o n : Program t o f i n d w a v e g u i d e l e n g t h // Example10 . 6 // p a g e 353 clear ; clc ; close ; 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 i meter m =1; // mode=1 48

9 L = %pi *( m +1) /(2* k ) ; 10 disp ( L *1 e03 , C o u p l i n g Length i n mm L = ) 11 // R e s u l t 12 // C o u p l i n g Length i n mm L = 5 . 2 3 5 9 8 7 8

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

Scilab code Exa 10.7 // C a p t i o n : Program t o f i n d E x c e s s 1 l 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 // Example10 . 7 // p a g e 355 clear ; clc ; close ; Power_Lost = 5/100; FT = 1 - Power_Lost ; // power c o u p l e d N = 32; Excess_Loss = -10* log10 ( FT ^ log2 ( N ) ) ; Splitting_Loss = -10* log10 (1/ N ) ; Total_Loss = Excess_Loss + Splitting_Loss ; disp ( Excess_Loss , E x c e s s L o s s i n dB ) disp ( Splitting_Loss , S p l i t t i n g L o s s i n dB ) disp ( Total_Loss , T o t a l L o s s e x p e r i e n c e d i n S t a r C o u p l e r s i n dB ) // R e s u l t // E x c e s s L o s s // 1.1138197 // S p l i t t i n g L o s s // 15.0515 // T o t a l L o s s e x p e r i e n c e d i n S t a r C o u p l e r s // 16.16532

2 3 4 5

Scilab code Exa 10.8 1 // C a p t i o n : Program t o Waveguide Length d i f f e r e n c e // Example10 . 8 // Page 357 clear ; close ; 49

6 clc ; 7 delta_Lambda = 0.08 e -09; // w a v e l e n g t h s p a c i n g i n 8 9 10 11 12 13 14 15 16 17 18 19 20 21

nano m e t e r s Lambda = 1550 e -09; // w a v e l e n g t h i n m e t e r s neff = 1.5; // e f f e c t i v e r e f r a c t i v e i n d e x i n t h e waveguide C =3 e08 ; // f r e e s p a c e v e l o c i t y delta_v1 = 10 e09 ; // f r e q u e n c y s p a c i n g 1 delta_v2 = 130 e09 ; // f r e q u e n c y s p a c i n g 2 delta_L1 = C /(2* neff * delta_v1 ) ; delta_L2 = C /(2* neff * delta_v2 ) ; disp ( delta_L1 *1 e03 , 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 meters ) disp ( delta_L2 *1 e03 , 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 meters ) // R e s u l t // 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 e t e r s // 10. // 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 e t e r s // 0.7692308

2 3 4 5 6 7 8 9 10 11 12 13 14

Scilab code Exa 10.9 1 // C a p t i o n : F i b e r Bragg G r a t i n g : Peak R e f l e c t i v i t y , C o u p l i n g c o e f f i c i e n t , f u l l bandwidth // Example10 . 9 . a clear ; close ; clc ; kL = [1 ,2 ,3]; Rmax = tanh ( kL ) ^2; // Example10 . 9 . b L =0.5 e -02; Lambda_Bragg = 1530 e -09; neff = 1.48; delta_n = 2.5 e -04; etta = 82/100; k = %pi * delta_n * etta / Lambda_Bragg ; 50

15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

delta_Lambda = ( Lambda_Bragg ^2) *((( k * L ) ^2+ %pi ^2) ^0.5) /( %pi * neff * L ) ; disp ( k /100 , C o u p l i n g c o e f f i c i e n t p e r cm k = ) disp ( delta_Lambda *1 e09 , f u l l bandwidth i n nm = ) disp ( disp ( kL Rmax (%) ) disp ( disp ( kL , kL ) disp ( Rmax *100 , Rmax ) disp ( // R e s u l t // 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 // f u l l bandwidth i n nm = 0.3807652 // // kL Rmax (%) // // kL // // 1. 2. 3. // Rmax // 58.002566 92.934918 99.013396 //

) )

2 3 4 5 6 7 8 9 10

Scilab code Exa 10.10 // C a p t i o n : PhasedArrayBased 1 D e v i c e s : Channel s p a c i n g i n t e r m s o f w a v e l e n g t h and pathl e n g t h d i f f e r e n c e // Example10 . 1 0 // p a g e 372 clear ; clc ; close ; Lambda_c = 1550 e -09; // c e n t r a l d e s i g n w a v e l e n g t h nc = 1.45; // r e f r a c t i v e i n d e x o f g r a t i n g a r r a y waveguide ns = 1.45; // r e f r a c t i v e i n d e x o f t e h s t a r c o u p l e r ng = 1.47; // g r o u p i n d e x o f g r a t i n g a r r a y w a v e g u i d e 51

11 x = 5e -06 ; // c e n t e r to c e n t e r

s p a c i n g between the s p a c i n g between the

input waveguides
12 d = 5e -06 ; // c e n t e r to c e n t e r

output waveguides
13 m =1; 14 Lf = 10 e -03; // d i s t a n c e b e t w e e n t r a n s m i t t e r and 15 16 17 18 19 20 21

object delta_L = m * Lambda_c / nc ; delta_Lambda = ( x / Lf ) *( ns * d / m ) *( nc / ng ) ; disp ( delta_L *1 e06 , Waveguide l e n g t h d i f f e r e n c e i n um =) disp ( delta_Lambda *1 e09 , Channel s p a c i n g i n t e r m s o f w a v e l e n g t h i n nm= ) // R e s u l t // Waveguide l e n g t h d i f f e r e n c e i n um = 1 . 0 6 8 9 6 5 5 // Channel s p a c i n g i n t e r m s o f w a v e l e n g t h i n nm = 3.5756803

2 3 4 5 6 7 8 9 10 11 12 13 14

Scilab code Exa 10.11 1 // C a p t i o n : PhasedArrayBased D e v i c e s : Length d i f f e r e n c e between a d j a c e n t a r r a y waveguides // Example10 . 1 1 // p a g e 373 clear ; close ; clc ; nc = 1.45; // e f f e c t i v e r e f r a c t i v e i n d e x Lambda_C = 1550.5 e -09; // c e n t e r w a v e l e n g t h delta_Lambda = 32.2 e -09; // f r e e s p e c t r a l r a n g e C = 3 e08 ; // f r e e s p a c e v e l o c i t y i n m/ s delta_L = Lambda_C ^2/( nc * delta_Lambda ) ; disp ( delta_L *1 e06 , l e n g t h d i f f e r e n c e b e t w e e n a d j a c e n t a r r a y w a v e g u i d e s i n um = ) // R e s u l t // l e n g t h d i f f e r e n c e b e t w e e n a d j a c e n t a r r a y w a v e g u i d e s i n um = 5 1 . 4 8 9 6 1 8

52

2 3 4 5 6 7 8 9 10 11 12 13 14 15

Scilab code Exa 10.12 // C a p t i o n : Maximum number o f 1 c h a n n e l s t h a t can be p l a c e d i n t h e t u n i n g r a n g e // Example10 . 1 2 // p a g e 383 clear ; clc ; close ; Lambda = 1550 e -09; //DBR l a s e r o p e r a t i n g w a v e l e n g t h delta_neff = 0.0065; //maximum i n d e x c h a n g e delta_Lambda_tune = Lambda * delta_neff ; // t u n i n g range in meters delta_Lambda_signal = 0.02 e -09; // s o u r c e s p e c t r a l width i n meters delta_Lambda_channel = 10* delta_Lambda_signal ; N = delta_Lambda_tune / delta_Lambda_channel ; disp (N , The number c h a n n e l s t h a t can o p e r a t e i n t h i s t u n i n g r a n g e i s N= ) // R e s u l t // The number c h a n n e l s t h a t can o p e r a t e i n t h i s tuning range i s N = 50.375

53

Chapter 11 Eleventh chapter


Scilab code Exa 11.1 1 // C a p t i o n : Program t o c a l c u l a t e Photon d e n s i t y // Example11 . 1 // p a g e 397 clear ; clc ; close ; Vg = 2 e08 ; // g r o u p v e l o c i t y i n m/ s h = 6.625 e -34; // p l a n k s c o n s t a n t C = 3 e08 ; // f r e e s p a c e v e l o c i t y i n m/ s Lamda = 1550 e -09; // o p e r a t i n g w a v e l e n g t h V = C / Lamda ; // f r e q u e n c y i n Hz w = 5e -06; // w i d t h 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 s d = 0.5 e -06; // t h i c k n e s s o f o p t i c a l a m p l i f i e r i n meters Ps = 1e -06; // o p t i c a l s i g n a l o f power Nph = Ps /( Vg * h * V * w * d ) ; disp ( Nph , The p h o t o n d e n s i t y i n p h o t o n s / c u b i c m e t e r i s Nph = ) // R e s u l t // The p h o t o n d e n s i t y i n p h o t o n s / c u b i c m e t e r i s Nph = 1 . 5 6 0D+16

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

54

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Scilab code Exa 11.2 1 // C a p t i o n : Pumping r a t e and z e r o s i g n a l g a i n // Example11 . 2 ( a ) and ( b ) // p a g e 397 clear ; clc ; close ; I = 100 e -03; // b i a s c u r r e n t i n Amps w = 3e -06; // a c t i v e a r e a w i d t h i n m e t e r s L = 500 e -06; // a m p l i f i e r l e n g h t i n m e t e r s d = 0.3 e -06; // a c t i v e a r e a t h i c k n e s s i n m e t e r s q = 1.602 e -19; // c h a r g e i n c o u l o m b s Rp = I /( q * d * w * L ) ; disp ( Rp , The pumping r a t e i n e l e c t r o n s / s . c u b i c m e t e r i s Rp = ) Tuo = 0.3; // t h e c o n f i n e m e n t f a c t o r a = 2e -20; // g a i n c o e f f i c i e n t i n s q u a r e m e t e r 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 meter nth = 1 e24 ; // t h r e s h o l d d e n s i t y p e r c u b i c m e t e r Tuor = 1e -09; // Time c o n s t a n t i n s e c o n d s g0 = Tuo * a * Tuor *(( J /( q * d ) ) -( nth / Tuor ) ) disp ( g0 /100 , The z e r o s i g n a l g a i n p e r cm i s g0 = ) // R e s u l t // The pumping r a t e i n e l e c t r o n s / s . c u b i c m e t e r i s Rp = 1 . 3 8 7D+33 // The z e r o s i g n a l g a i n p e r cm i s g0 = 2 3 . 2 2 9 2 9 7

2 3 4 5 6 7 8

Scilab code Exa 11.3 // C a p t i o n : Maximum i n p u t power and 1 maxmimum o u t p u t power // Example 1 1 . 3 // p a g e 404 clear ; clc ; close ; Lambda_p = 980 e -09; //pump w a v e l e n g t h Lambda_s = 1550 e -09; // s i g n a l w a v e l e n g t h 55

9 Pp_in = 30 e -03; // i n p u t pump power i n w a t t s 10 G = 10^(20/10) ; // g a i n 11 Ps_in = ( Lambda_p / Lambda_s ) * Pp_in /( G -1) 12 disp ( Ps_in *1 e06 , The maximum i n p u t power i n uW i s 13 14 15 16 17 18 19

Ps in =) Ps_out = Ps_in +( Lambda_p / Lambda_s ) * Pp_in ; disp ( Ps_out *1 e03 , The maximum o u t p u t power i n mW i s Ps out = ) disp (10* log10 ( Ps_out *1 e03 ) , The maximum o u t p u t power i n dBm i s P s o u t = ) // R e s u l t // The maximum i n p u t power i n uW i s P s i n = 1 9 1 . 5 9 3 3 5 // The maximum o u t p u t power i n mW i s P s o u t = 19.159335 // The maximum o u t p u t power i n dBm i s P s o u t = 12.823804

2 3 4 5 6 7 8 9 10 11

Scilab code Exa 11.6 1 // C a p t i o n : O p t i c a l S i g n a l to n o i s e r a t i o (OSNR) // Example11 . 6 // p a g e 412 clear ; close ; clc ; Q = 6; //Q f a c t o r o f 6 OSNR = (1/2) * Q *( Q + sqrt (2) ) ; disp (10* log10 ( OSNR ) , O p t i c a l S i g n a l to n o i s e r a t i o i n dB OSNR = ) // R e s u l t // O p t i c a l S i g n a l to n o i s e r a t i o i n dB OSNR = 13.471863

2 3 4

Scilab code Exa 11.7 // C a p t i o n : Pump power o f EDFA 1 // Example11 . 7 // p a g e 413 clear ; 56

5 clc ; 6 close ; 7 Lambda_p = 980 e -09; //pump w a v e l e n g t h i n m e t e r s 8 Lambda_s = 1540 e -09; // s i g n a l w a v e l e n g t h i n m e t e r s 9 Ps_out = 10 e -03; // o u t p u t s i g n a l power 10 Ps_in = 1e -03; // i n p u t s i g n a l power 11 Pp_in = ( Lambda_s / Lambda_p ) *( Ps_out - Ps_in ) 12 disp ( Pp_in *1 e03 , Pump power i n m i l l i w a t t s P p i n = ) 13 // R e s u l t 14 //Pump power i n m i l l i w a t t s P p i n = 1 4 . 1 4 2 8 5 7

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Scilab code Exa 11.8 1 // C a p t i o 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 // Example11 . 8 // p a g e 413 clear ; clc ; close ; P_ASE1 = -22; //ASE l e v e l i n dBm P_ASE2 = -16; //ASE l e v e l i n dBm Pout = 6; // a m p l i f i e d s i g n a l l e v e l i n dBm OSNR1 = Pout - P_ASE1 ; // O p t i c a l SNR i n dBm OSNR2 = Pout - P_ASE2 ; // O p t i c a l SNR i n dBm disp ( OSNR1 , O p t i c a l SNR i n dBm OSNR = ) disp ( OSNR2 , O p t i c a l SNR i n dBm OSNR = ) // R e s u l t // O p t i c a l SNR i n dBm OSNR = 2 8 . // O p t i c a l SNR i n dBm OSNR = 2 2 .

2 3 4 5 6 7

Scilab code Exa 11.9 // C a p t i o n : N o i s e p e n a l t y f a c t o r 1 // Example11 . 9 // p a g e 414 clear ; clc ; close ; G =[10^(30/10) ,10^(20/10) ]; // A m p l i f i e r Gain 57

8 for i = 1: length ( G ) 9 Fpath ( i ) = (1/ G ( i ) ) *(( G ( i ) -1) / log ( G ( i ) ) ) ^2; 10 disp (10* log10 ( Fpath ( i ) ) , N o i s e p e n a l t y f a c t o r

in

dB Fpath = ) ;
11 disp ( G ( i ) , f o r a g a i n o f G = ) ; 12 end 13 // R e s u l t 14 // N o i s e p e n a l t y f a c t o r i n dB Fpath = 1 3 . 2 0 4 5 7 1 15 // f o r a g a i n o f G = 1 0 0 0 . 16 // N o i s e p e n a l t y f a c t o r i n dB Fpath = 6 . 6 4 7 7 9 0 2 17 // f o r a g a i n o f G = 1 0 0 .

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Scilab code Exa 11.10 // C a p t i o n : Upper bound on i n p u t 1 o p t i c a l s i g n a l power // Example11 . 1 0 // p a g e 415 clear ; clc ; close ; etta = 0.65; // Quantum e f f i c i e n c y nsp = 2; // p o p u l a t i o n i n v e r s i o n b e t w e e n two l e v e l s R =50; // l o a d r e s i s t a n c e inohms Lambda = 1550 e -09; // o p e r a t i n g w a v e l e n g t h i n m e t e r s T = 300; // room t e m p e r a t u r e i n k e l v i n s kB = 1.38054 e -23; // boltzmann s c o n s t a n t h = 6.6256 e -34; // p l a n k s c o n s t a n t C = 3 e08 ; // f r e e s p a c e v e l o c i t y i n m/ s V = C / Lambda ; // f r e q u e n c y i n Hz q = 1.602 e -19; // c h a r g e i n c o l u m b s Ps_in = kB * T * h * V /( R * nsp *( etta ^2) *( q ^2) ) ; disp ( Ps_in *1 e06 , Upper bound on i n p u t o p t i c a l s i g n a l power i n m i c r o w a t t s P s i n= ) // R e s u l t // Upper bound on i n p u t o p t i c a l s i g n a l power i n m i c r o watts Ps in = 489.81635

58

Chapter 12 Twelve chapter


Scilab code Exa 12.1 // C a p t i o n : E f f e c t i v e l e n g t h o f f i b e r 1 2 // Example12 . 1 3 // p a g e 432 4 clear ; 5 clc ; 6 close ; 7 L = 75; // a m p l i f i e r s p c a i n g i n k i l o m e t e r 8 alpha = 4.61 e -02; // f i b e r a t t e n u a t i o n p e r Km 9 Leff = (1 - exp ( - alpha * L ) ) / alpha ; 10 disp ( Leff , E f f e c t i v e l e n g t h o f f i b e r i n k i l o m e t e r s Leff =) 11 // R e s u l t 12 // E f f e c t i v e l e n g t h o f f i b e r i n k i l o m e t e r s L e f f = 21.008494

2 3 4 5 6

Scilab code Exa 12.2 1 // C a p t i o n : C a l c u l a t i o n o f S t i m u l a t e d B r i l l o u i n S c a t t e r i n g ( SBS ) t h r e s h o l d power // Example12 . 2 // p a g e 433 clear ; clc ; close ; 59

7 8 9 10 11 12 13 14 15 16

delta_VB = 20 e06 ; // B r i l l o u i n l i n e w i d t h i n Hz Aeff = 55 e -12; // e f f e c t i v e c r o s s s e c t i o n a l a r e a o f t h e p r o p a g a t i n g wave i n s q u a r e m e t e r Leff = 20 e03 ; // e f f e c t i v e l e n g t h b = 2; // p o l a r i z a t i o n f a c t o r gB = 4e -11; // B r i l l o u s g a i n c o e f f i c i e n t m/W delta_Vsource = 40 e06 ; // o p t i c a l s o u r c e l i n e w i d t h i n Hz Pth = 21*( Aeff * b /( gB * Leff ) ) *(1+( delta_Vsource / delta_VB ) ) ; disp ( Pth *1 e03 , SBS t h r e s h o l d power i n m i l l i w a t t s Pth= ) // R e s u l t // SBS t h r e s h o l d power i n m i l l i w a t t s Pth= 8 . 6 6 2 5

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Scilab code Exa 12.3 // C a p t i o n : Fourwave mixing 1 c a l c u l a t i o n o f power g e n e r a t e d due t o t h e // 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 s // Example12 . 3 // p a g e 438 clear ; clc ; close ; chi1111 = 6e -15; // T h i r d o r d e r n o n l i n e a r s u c e p t i b i l i t y c u b i c m e t e r /W. s D =3; // d e g e n e r a t i n g f a c t o r Leff = 22 e03 ; // e f f e c t i v e l e n g t h i n m e t e r s Aeff = 6.4 e -11; // e f f e c t i v e c r o s s s e c t i o n a l a r e a o f the f i b e r i n square meter etta = 0.05; // quantum e f f i c i e n c y Lambda = 1540 e -09; // Wavelength i n s i n g l e mode f i b e r s i n meter C = 3 e08 ; // f r e e s p a c e v e l o c i t y i n m/ s e c alpha =0.0461; // a t t t e n u a t i o n p e r Km L =75; // f i b e r l i n k l e n g t h i n Km P = 1e -03; // e a c h c h a n n e l i n p u t power o f 1 m i l l i watts 60

18 n = 1.48; // r e f r a c t i v e i n d e x 19 k = ((32*( %pi ^3) * chi1111 ) /(( n ^2) * Lambda * C ) ) *( Leff / 20 21

22 23

Aeff ) ; // n o n l i n e a r i n t e r a c t i o n c o n s t a n t P112 = etta *( D ^2) *( k ^2) *( P ^3) * exp ( - alpha * L ) ; disp ( P112 *1 e03 , Power g e n e r a t e d 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 t t s P112 =) // R e s u l t // Power g e n e r a t e d 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 t t s P112= // 5 . 7 9 8D08

2 3 4 5 6 7 8 9 10 11

Scilab code Exa 12.4 // C a p t i o n : F u l l w i d t h H a l f Maximum ( 1 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 m e // Example12 . 4 // p a g e 446 clear ; clc ; close ; Ts = [15 e -12 ,50 e -12]; //FWHM s o l i t o n p u l s e w i d t h To = Ts /1.7627; disp ( To *1 e12 , N o r m a l i z e d t i m 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 o n d s To = ) // R e s u l t // N o r m a l i z e d t i m 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 o n d s To = [ 8 . 5 0 9 6 7 2 7 28.365576]

2 3 4 5 6 7 8

Scilab code Exa 12.5 // C a p t i o n : C a l c u l a t i o n o f n o r m a l i z e d 1 d i s t a n c e parameter 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 // Example12 . 5 // p a g e 446 clear ; clc ; close ; Ts = 20 e -12; //FWHM s o l i t o n p u l s e w i d t h i n s e c o n d s D = 0.5 e -06; // d i s p e r s i o n o f t h e f i b e r p s / (nm . km) 61

9 Lambda = 1550 e -9; // w a v e l e n g t h i n m e t e r 10 C = 3 e08 ; // f r e e s p a c e v e l o c i t y i n m/ s 11 Ldisp = 0.322*2* %pi * C *( Ts ^2) /(( Lambda ^2) * D ) ; 12 disp ( Ldisp /1000 , d i s p e r s i o n l e n g t h i n Km L d i s p = ) 13 // R e s u l t 14 // d i s p e r s i o n l e n g t h i n Km L d i s p = 2 0 2 . 1 0 8 0 4

2 3 4 5 6 7 8 9 10 11 12 13 14

Scilab code Exa 12.6 // C a p t i o n : Program t o c a l c u l a t e 1 s o l i t o n peak power // Example12 . 6 // p a g e 447 clear ; clc ; close ; Lambda = 1550 e -9; // w a v e l e n g t h i n m e t e r s n2 = 2.6 e -20; // power i n s q u a r e m e t e r /w Aeff = 50 e -12; // e f f e c t i v e a r e a i n s q u a r e m e t e r Ldisp = 202 e03 ; // d i s p e r s i o n l e n g t h i n m e t e r s Ppeak = ( Aeff /(2* %pi * n2 ) ) *( Lambda / Ldisp ) ; disp ( Ppeak *1 e03 , S o l i t o n peak power i n m i l l i w a t t s Ppeak = ) // R e s u l t // S o l i t o n peak power i n m i l l i w a t t s Ppeak = 2.3485354

2 3 4 5 6 7 8 9

Scilab code Exa 12.7 // C a p t i o n :FWHM s o l i t o n p u l s e w i d t h 1 and f r a c t i o n o f b i t s l o t o c c u p i e d by a s o l i t o n // Example12 . 7 // p a g e 448 clear ; clc ; close ; // Example12 . 7 . a Ldisp = 100 e03 ; // d i s p e r i s o n l e n g t h i n m e t e r omega = 4682; // o s c i l l a t i o n p e r i o d 62

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

LI = omega * Ldisp ; disp ( LI , i n t e r a c t i o n d i s t a n c e i n m e t e r LI= ) // Example12 . 7 . b D = 0.5 e -06; // d i s p e r i s o n o f f i b e r i n p s /nm . km C = 3 e08 ; // f r e e s p a c e v e l o c i t y S0 = 8; // n o r m a l i z e d s e p a r a t i o n o f n e i g h n o r i n g solitons B = 10 e09 ; // d a t a r a t e 10 Gb/ s e c Lambda = 1550 e -9; // w a v e l e n g t h i n m e t e r s Beta2 = ( Lambda /(2* %pi ) ) ; LT = ( C * exp ( S0 ) ) /(16* D * B ^2*( Beta2 ^2) *( S0 ^2) ) ; disp ( LT *1 e03 , 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 = ) // Example12 . 7 . c Ts = 0.881/( S0 * B ) ; disp ( Ts *1 e12 , FWHM s o l i t o n p u l s e w i d t h i n p i c o s e c o n d s Ts = ) // Example12 . 7 . d Ts_TB = 0.881/ S0 ; disp ( Ts_TB *100 , F r a c t i o n o f t h e b i t s l o t o c c u p i e d by a s o l i t o n i n p e r c e n t a g e Ts TB= ) // R e s u l t // i n t e r a c t i o n d i s t a n c e i n m e t e r LI = 4 . 6 8 2D+08 // 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 0D+11 //FWHM s o l i t o n p u l s e w i d t h i n p i c o s e c o n d s Ts = 11.0125 // F r a c t i o n o f t h e b i t s l o t o c c u p i e 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

Chapter 13 Thirteen chapter


Scilab code Exa 13.1 // C a p t i o n : C a l c u l a t i o n o f power 1 budget f o r o p t i c a l l i n k // Example13 . 1 // p a g e 464 clear ; clc ; close ; N = [5 ,10 ,50]; // number s t a t i o n s alpha = 0.4; // a t t e n u a t i o n i n dB/Km L_tap = 10; // c o u p l i n g l o s s i n dB L_thru = 0.9; // c o u p l e r t h r o u g h p u t i n dB Li = 0.5; // I n t r i n s i c c o u p l e r l o s s i n dB Lc = 1.0; // c o u p l e r to f i b e r l o s s i n dB L = 0.5; // l i n k l e n g t h i n Km fiber_Loss = alpha * L ; // f i b e r l o s s i n dB Pbudget = N *( alpha * L +2* Lc + Li + L_thru ) - alpha *L -2* L_thru +2* L_tap ; disp ( fiber_Loss , f i b e r l o s s i n dB f o r L =500 m ) disp ( Pbudget , power b u d g e t i n dB f o r o p t i c a l l i n k when N = 5 , 1 0 and 50 s t a t i o n s r e s p e c t i v e l y = ) // R e s u l t // f i b e r l o s s i n dB f o r L =500 m // 0.2

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

64

// power b u d g e t i n dB f o r o p t i c a l l i n k when N = 5 , 1 0 and 50 s t a t i o n s r e s p e c t i v e l y = 22 // 36. 54. 198.


21

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Scilab code Exa 13.2 // C a p t i o n : C a l c u l a t i o n o f Number 1 stations for given l o s s // Example13 . 2 // p a g e 465 clear ; clc ; close ; alpha = 0.4; // a t t e n u a t i o n i n dB/Km L_tap = 10; // c o u p l i n g l o s s i n dB L_thru = 0.9; // c o u p l e r t h r o u g h p u t i n dB Li = 0.5; // I n t r i n s i c c o u p l e r l o s s i n dB Lc = 1.0; // c o u p l e r to f i b e r l o s s i n dB L = 0.5; // l i n k l e n g t h i n Km Pbudget_LED = 38; // power l o s s b e t w e e n s o u r c e and r e c e i v e r i n dB f o r LED s o u r c e Pbudget_LASER = 51; // power l o s s b e t w e e n s o u r c e and r e c e i v e r i n dB f o r LASER s o u r c e N_LED = ( Pbudget_LED + alpha *L -2* L_thru -2* L_tap ) /( alpha * L +2* Lc + Li + L_thru ) N_LASER = ( Pbudget_LASER + alpha *L -2* L_thru -2* L_tap ) /( alpha * L +2* Lc + Li + L_thru ) disp ( ceil ( N_LED ) , Number o f s t a t i o n s a l l o w e d f o r g i v e n l o s s o f 38 dB w i t h LED s o u r c e ) disp ( floor ( N_LASER ) , Number o f s t a t i o n s a l l o w e d f o r g i v e n l o s s o f 51 dB w i t h LASER s o u r c e ) // R e s u l t // Number o f s t a t i o n s a l l o w e d f o r g i v e n l o s s o f 38 dB w i t h LED s o u r c e // 5. // Number o f s t a t i o n s a l l o w e d f o r g i v e n l o s s o f 51 dB w i t h LASER s o u r c e // 8.

65

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Scilab code Exa 13.3 // C a p t i o n : C a l c u l a t i o n o f w o r s t 1 c a s e Dynamic Range // Example13 . 3 // p a g e 465 clear ; clc ; close ; N = [5 ,10] ; // number o f s t a t i o n s alpha = 0.4; // a t t e n u a t i o n i n dB/Km L = 0.5; // l i n k l e n g t h i n Km Lc = 1.0; // c o u p l e r to f i b e r l o s s i n dB L_thru = 0.9; // c o u p l e r t h r o u g h p u t i n dB Li = 0.5; // I n t r i n s i c c o u p l e r l o s s i n dB DR = (N -2) *( alpha * L +2* Lc + Li + L_thru ) ; disp ( DR , w o r s t c a s e dyanmic r a n g e i n dB f o r N =5 and 10 r e s p e c t i v e l y DR = ) // R e s u l t // w o r s t c a s e dyanmic r a n g e i n dB f o r N =5 and 10 r e s p e c t i v e l y DR = // 10.8 28.8

2 3 4 5 6 7 8 9 10 11 12 13

Scilab code Exa 13.4 1 // C a p t i o n : C a l c u l a t i o n o f power m a r g i n b e t w e e n t r a n s m i t t e r and r e c e i v e r f o r S t a r a r c h i t e c t u r e s // Example13 . 4 // p a g e 466 clear ; close ; clc ; N = [10 ,50]; // number o f s t a t i o n s alpha = 0.4; // a t t e n u a t i o n i n dB/Km L = 0.5 ; // d i s t a n c e i n Km Lexcess = [0.75 ,1.25]; // e x c e s s l o s s i n dB f o r N =10 and 50 Lc = 1.0; // c o n n e c t o r l o s s i n dB Ps_Pr (1) = Lexcess (1) + alpha *2* L +2* Lc +10* log10 ( N (1) ) ; Ps_Pr (2) = Lexcess (2) + alpha *2* L +2* Lc +10* log10 ( N (2) ) ; 66

14 15 16 17 18

disp ( Ps_Pr (1) , The power m a r g i n i n dB b e t w e e n 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 PsPr = ) disp ( Ps_Pr (2) , The power m a r g i n i n dB b e t w e e n 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 PsPr = ) // R e s u l t // The power m a r g i n i n dB b e t w e e n 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 PsPr = 1 3 . 1 5 // The power m a r g i n i n dB b e t w e e n 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 PsPr = 2 0 . 6 3 9 7

2 3 4 5 6 7 8 9 10 11 12 13 14

Scilab code Exa 13.5 // C a p t i o n : D e t e r m i n a t i o n o f maximum 1 l e n g t h o f multimode f i b e r l i n k // Example13 . 5 // p a g e 477 clear ; clc ; close ; L_OM2 = 40; // l e n g t h o f OM2 f i b e r L_OM3 = 100; // l e n g t h o f OM3 f i b e r BW_OM2 = 500 e06 ; // bandwidth o f OM2 f i b e r BW_OM3 = 2000 e06 ; // bandwidth o f OM3 f i b e r Lmax = L_OM2 *( BW_OM3 / BW_OM2 ) + L_OM3 ; disp ( Lmax , The maximum l i n k l e n g t h i n m e t e r i s Lmax =) // R e s u l t // The maximum l i n k l e n g t h i n m e t e r i s Lmax = 2 6 0 .

67

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 Measurement and M o n i t o r i n g // F i g u r e : 1 4 . 1 0 P l o t t i n g p u l s e s h a p e o f g a u s s i a n distribution // and d e t e r m i n i n g 3dB o p t i c a l and e l e c t r i c a l bandwidth clear ; close ; clc ; sigma = 1; t = -3* sigma :0.01:3* sigma ; p = (1/( sigma * sqrt (2* %pi ) ) ) * exp ( - t ^2./(2* sigma ^2) ) ; fdB_optical = 0.187/ sigma ; fdB_electrical = 0.133/ sigma ; disp ( fdB_optical , f d B o p t i c a l ) disp ( fdB_electrical , f d B e l e c t r i c a l ) plot (t ,p , r ) xlabel ( Time t ) ylabel ( R e l a t i v e p u l s e a m p l i t u d e P( t ) ) title ( F i g u r e : 1 4 . 1 0 D e f i n i t i o n s o f p u l s e s h a p e parameters ) xgrid (1) // R e s u l t // f d B o p t i c a l = 0.187 68

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Figure 14.1: Performance Measurement and Monitoring

21

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

69

You might also like