My code does not produce the correct curve.

2 次查看(过去 30 天)
Hey everyone, here is a link which shows what formulas I have used, what parameters I have used, and the correct graph that I should be getting (the green line). Here is the direct link http://imageshack.us/g/17/formulaj.jpg/
Here is my code also:
%%Parameters
H = 6.63e-34;%Plancks constant [J.s]
Lambda = 1550; %wavelength of continuous wave laser (units: nm)
C = 3e5; %speed of light [nm/ps]
V = 3e8/1550e-9; %frequency of the propagating light [Hz]
Gamma = 1.2; %[1/W.km] Fiber non-linear paramter:
D = 17; %[ps/(nm.km)]Chromatic dispersion
N_s = 10; %number of spans (range of 1-200)
alpha = 0.2; %Attenuation [dB/km] (convert dB/km <-> (1/km))
Alpha = alpha*4.343; %[1/km]
L = 80; %fiber length [km]
N_ch = 15; %number of channels
Delta_f = 28.875e9; %[Hz]N-WDM channel spacing (QPSk = 28.875 GHz, QAM-8 = QAM-16 = 28.4375 GHz)
P_tx_db = -8:0.1:3; %[dBm]Launch optical power per channel (convert to W)
P_tx = 10.^( P_tx_db./10).*1e-3; %[W]
I_tx = P_tx./Delta_f;%[W/Hz] % optical launch power density per channel
%%EDFA parameters
G = L*Alpha; %Gain per amplifier
F_db = 4.5; %Amplifier noise figure [dB] convert to W
F = 10^(F_db/10); % [W]Amplifier noise figure
%%Sub Equations
L_eff = ((1-exp(-Alpha*L))/Alpha);%[km]non-linear effective length
B_2 = -(D*(Lambda)^2/2*pi*C);%[ps^2/km]Group velocity dispersion parameter (related to chromatic dispersion)
B = N_ch*Delta_f; %Optical bandwidth [Hz]
I_ase = (G-1)*N_s*F*H*V; % [W/Hz]Amplified spontaneous emission; summation of the white optical amplified spontaneous emission
SNR_wdm = I_tx_wdm.*exp(-(I_tx_wdm./I_01).^2)./(I_ase + I_tx_wdm.*(1 - exp(-(I_tx_wdm/I_01).^2))); %SNR for WDM
%%Poggiolini equation
%N-WDM equation [11]
I_NL1 = (2/3)^3 * N_s*(Gamma)^2*L_eff*log(pi^2*abs(B_2)*L_eff*(B)^2)*(I_tx).^3 / (pi*abs(B_2)) %[km.w^2/Hz^2]
SNR_wdm = I_tx.*exp(-I_NL1./I_tx)./(I_ase+ I_tx.*(1-exp(-I_NL1./I_tx)))
figure(2);
semilogy(P_tx ,SNR_wdm)%plotting optical power against SNR
xlabel('Optical Launch Power [W]','FontSize', 12, 'FontWeight', 'bold');
ylabel('SNR','FontSize', 12, 'FontWeight', 'bold');
hold on;
Please note that the sub equations were from a text book and should be correct. I think my error occurs when I convert from dB to W. I get confused when converting units however I have looked over my conversions and seems to be correct.
The conversions I used were: dB/km - 1/km 0.2 dB/km - 4.343*0.2
The other conversion was from dBm to W On the parameter image, it states that dBm should be a matrix (Ptx-launch power). So I used the relationship: dBm - W -8:0.1:3 - 10^(dBm/10)*1e^-3 (The 1e-3 was because the answer gives dBm - mW so I just converted to W).
now im sure ive messed up with the units but there could be other mistakes. To conclude, I am trying to plot the green graph exactly as shown in the attachment.
  2 个评论
Cezerla Baskaran
Cezerla Baskaran 2012-8-29
Hi... Are you working on WDM PON?? I am also working on same area. Kindly let me know.
Sourav Mondal
Sourav Mondal 2014-1-17
编辑:Sourav Mondal 2014-1-17
How this code will work? There are several undefined variables in the expression for SNR_wdm.Please define them first and then check the code.

请先登录,再进行评论。

回答(3 个)

SYED
SYED 2012-7-16
Undefined function or variable 'I_tx_wdm'.
This is the variable u need to define, looks like you and i have the same area to work on, inbox me your id so we can keep in touch.
  1 个评论
Cezerla Baskaran
Cezerla Baskaran 2012-8-29
Hi... Are you working on WDM PON?? I am also working on same area. Kindly let me know and can u gimme ur mail id??

请先登录,再进行评论。


star
star 2012-9-14
You know.. sometimes it is better to sleep :) Then you can find the right way to follow

Jian Chang
Jian Chang 2012-11-9
Could you tell what is the name of that book. I want to consult with that book

类别

Help CenterFile Exchange 中查找有关 Equivalent Baseband Simulation 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by