341 matlab project report

13
MATLAB PROJECTS Signals and Systems Due Date:-December 10 th 2010 Name: - Raju Maharjan Tech Id: - 00917131 EE 341 Minnesota State University, Mankato Electrical Engineering

Upload: raju-maharjan

Post on 03-Apr-2015

2.926 views

Category:

Documents


13 download

TRANSCRIPT

Page 1: 341 matlab project report

MATLAB PROJECTS

Signals and Systems

Due Date:-December 10th 2010

Name: - Raju Maharjan

Tech Id: - 00917131

EE 341

Minnesota State University, Mankato

Electrical Engineering

Page 2: 341 matlab project report

Objective:-

The objective of this project is to study the Nonlinear Schrodinger equation (NLSE), which governs the propagation of optical pulses through a single mode optical fiber and use matlab to learn how to find the solution in the frequency domain and how to make use of the Fourier transform to solve the equation and represent in time domain solution.

Theory:-

The Nonlinear Schrodinger equation (NLSE), which governs the propagation of optical pulses through a single mode optical fiber [1-2], can be written as

A(z,t)/ t = (L+N(A(z,t)))A(z,t) - (1)

Where operator L is equal to

Where L and N are the linear and nonlinear operators respectively, A (z, t) is the complex envelope of slowly time-varying optical pulse. Note that D denotes dispersion operator. Parameters β2, β3, α and γ represent fiber group velocity dispersion (GVD) GVD slope, attenuation, and nonlinearity, respectively. Please note that z is propagation distance and t = τ – z/vg is the retarded time, where τ is physical time and vg is the group velocity. Eq.1 is derived using an electrical engineering notation for complex envelop and Fourier transform, denoted by Equation 2 and equation 3 respectively.

E (t, z) =Re [A (t, z) e^iωct] (2)

à (ω, z) =∫−∞

A (t , z ) e−iωtdt (3)

Where in Eq. (2), E (t, z) is the normalized scalar electrical field with a unit of√ watt .

Page 3: 341 matlab project report

Answer to the theory question:-

Let’s consider the linear effect only, i.e., in the absence of nonlinearity, integration of equation (1) in the frequency domain yields equation (4)A (ω, zf) =H (ω) A (ω, zt) (4)Where H(ω)=exp((-α/2-i/2*β2*w.^2-i/6*β3*w.^3)*t) and is fiber’s frequency response, A(ω,zf)=)and A(ω,zt) are the Fourier transforms of the fiber’s input and output, respectively. Hence, basically, first we integrate the linear part of NLSE or use Fourier transform in frequency domain which results in equation (4). Then we got simple form of equation in multiplication form. We can do either convert this to t-domain and do convolution or just multiply in frequency domain. And then does inverse Fourier transform to get t-domain.

Matlab code:-

clear all;close all;

%%% single pulse Ts=0.25; t=[-16:Ts:16-Ts];T0=2;p=exp(-t.^2/T0);figure(1);plot(t, p)

P=fftshift(fft(p));figure(2);plot(abs(P))

Fs=1/32; N=length(t);f=[-N/2*Fs:Fs:N/2*Fs-Fs];w=2*pi*f;

alpha=0.001;b2=0.005;

Page 4: 341 matlab project report

b3=0.003;H=exp((-alpha/2-i/2*b2*w.^2-i/6*b3*w.^3)*1000);

PP=P.*H;pp=ifft(fftshift(PP));

figure(1);hold on;plot(t, pp, 'r-');legend('transmitted pulse', 'received pulse')

%%% a pulse train: 1101 followed by 4 padded zeros: 11010000Tb=8; N_bits=8; T=N_bits*Tb; N_samples_perbit=Tb/Ts; N_samples=T/Ts; pulse_train=zeros(1, N_samples); pulse_train(1:N_samples_perbit:end)=[1 1 0 1 0 0 0 0]; pulse_train_tx_temp=conv(pulse_train, p); pulse_train_tx=pulse_train_tx_temp(1:N_samples);

tt=[0:Ts:T-Ts];

figure(3); plot(tt, pulse_train_tx)

PTrain=fftshift(fft(pulse_train_tx));figure(4);plot(abs(PTrain))

Fs=1/32; N=length(tt);f=[-N/2*Fs:Fs:N/2*Fs-Fs];w=2*pi*f;

alpha=0.001;b2=0.005;b3=0.003;H=exp((-alpha/2-i/2*b2*w.^2-i/6*b3*w.^3)*100);

PPTrain=PTrain.*H;ppTrain=ifft(fftshift(PPTrain));

figure(3);hold on;plot(tt, ppTrain, 'r-');legend('transmitted pulse', 'received pulse')

figure(4);hold on;plot(tt, PPTrain, 'r-');legend('transmitted pulse', 'received pulse')

Page 5: 341 matlab project report

Graphs for the first part of matlab code:-

Figure2: - single pulse Figure3: - FFt (single pulse)

Figure4:-the final graph for the original code provided

Page 6: 341 matlab project report

Figure5:-When alpha is increased Figure6:-When beta 2 is increased

Figure7:-When beta 3 is increased

Page 7: 341 matlab project report

Graphs of Second part with added code:

Figure8: - graph of pulse train Figure9:- graph of pulse train

0 10 20 30 40 50 60 70-15

-10

-5

0

5

10

15

20

25

30

transmitted pulse

received pulse

Figure: in time domain Figure: in frequency domain

Page 8: 341 matlab project report

Figure10:-the final graph for the pulse train code

Figure11:-When alpha is increased Figure12:-when beta 2 is increased

Figure13:-When beta 3 is increased

Page 9: 341 matlab project report

Results and discussions:-

Before simulating code:-

1. The single pulse p=exp (-t. ^2/T0) is used with sampling period of T= 0.25s in the time domain and plotted using plot (t, p) code on the first part of the Matlab code.

2. The Fourier transform of this single pulse is found using P= fftshift (fft (p)) code where p is the p is in t domain and P is frequency domain.

3. Then this frequency domain pulse is sampled by using sampling frequency =1/32 and where ω= 2πf and then we find the solution in frequency domain by multiplying Fourier transform of single pulse and H (w) =exp ((-alpha/2-i/2*b2*w.^2-i/6*b3*w.^3)*1000) in which we choose the value for alpha, beta2, beta3.

4. Then to get the solution in time domain, we just used inverse Fourier transform Matlab code i.e. pp=ifft (fftshift (PP)). Then plotted the graph of figure 1 as transmitted pulse and this figure as received pulse together on same graph.

5. Then by the reading the first part we could know that in the second part, we are doing same process as above except we are using a pulse train: 1101 followed by 4 padded zeros: 11010000 using Tb=8s of time domain function. Then we perform Fourier transform to get frequency domain as above and then we repeated the same steps that we used as above code.

After configuring and running the code:-

1. Now, after configuring and running the code we learned to know that the single pulse we used were the Gaussian pulse is used. We also learn that the Gaussian pulse was used because the optical sources have a distribution of power with wavelength that is approximately Gaussian distribution in form, as shown in figure.

Page 10: 341 matlab project report

Figure: single pulse Figure: FFt of single pulseFigure: Gaussian pulse.

2. Then we also learn that do the shape of the Fourier transform Gaussian pulse is same as t-domain but there bandwidth is different.

3. Hence, we learned that in this simulation, Gaussian pulse has taken as an input signal and studies all effects that change its shape due to attenuation, dispersion and nonlinearly. In the first example the output taken at a certain distance, while in the second example the output is taken at a farther distance. Figures (4)-(7), and figures (10)-(13) illustrate the effects of attenuation, dispersion, and nonlinearity of the fiber for the two examples.

4. It is clear from the comparison between the results of the examples that the attenuation, the dispersion and the nonlinearly effects increase when the distance of communication through the fiber optics is increase. Therefore, repeaters are necessary for long-distances fiber optic systems when the signals be very weak.

5. Hence, from the graphs, we also learn that we need some kind of amplifiers must be used as repeaters for compensating the attenuation affects and again the amplifiers add noise, so it is necessary to use filters after the amplification of the signal. The filter removes the effects of the noise.

Conclusion:-

In this way, from this matlab project, we learn how simulation is presented on a Single

mode optical fiber link system, using matlab. The single pulse and pulse train was used as inputs,

to learn how we use the Fourier transform and inverse Fourier transform to get the output pulse

as we needed and also we studied the effects of attenuation, dispersion, and nonlinear through

the fiber optic length by numerical simulations. The results indicate that these effects increase

with increasing the distance through the fiber optic length.

Page 11: 341 matlab project report