📄 regenerator.m
字号:
case '1550'
Nd55=0.25;
Ith55= 0.01;
end
case 'STS-48/STM-16' %2.5 Gbps
switch (frecuencia55)
case '1310'
Nd55=0.25;
Ith55= 0.01;
case '1550'
Nd55=0.22;
Ith55= 0.01;
end
case 'STS-192/STM-64' %10 Gbps
switch (frecuencia55)
case '1310'
Nd55=0.25;
Ith55= 0.009;
case '1550'
Nd55=0.2;
Ith55= 0.015;
end
case 'STS-768/STM-256' %40 Gbps
switch (frecuencia55)
case '1310'
Nd55=0.25;
Ith55= 0.009;
case '1550'
Nd55=0.2;
Ith55= 0.015;
end
end
while j<=b
if (u(1,j)<Id55)
r55(1,j) = Ith55;
else
r55(1,j) = Nd55*(u(1,j)-Ith55);
end
j=j+1;
end
luz=r55;
end
if isempty(find_system(gcs,'Name','Regenerator6'))~=1
Blks66=([gcs,'/','Regenerator6']);
% snr_in_dB66=str2num(get_param(Blks66,'Potencia'));
tiposenal66=get_param(Blks66,'sel');
frecuencia66=get_param(Blks66,'frec');
% En dB
[a b]=size(u);
%SNR=exp((snr_in_dB)*(log(10)/10));
%sigma=(1/sqrt(2*SNR));
%==============================================
% Punto de decision
% Id = I(0)+I(1)/2
Id66=(max(u(:,:))+min(u(:,:)))/2;
%---------------------------------------------
j=1;
r66=zeros(1,b);
%Circuito de Decision
%Salida Optica
%Datasheet LUCENT
switch (tiposenal66)
case 'STS-12/STM-4' %622 Mbps
switch (frecuencia66)
case '1310'
Nd66=0.5;
Ith66= 0.01;
case '1550'
Nd66=0.25;
Ith66= 0.01;
end
case 'STS-48/STM-16' %2.5 Gbps
switch (frecuencia66)
case '1310'
Nd66=0.25;
Ith66= 0.01;
case '1550'
Nd66=0.22;
Ith66= 0.01;
end
case 'STS-192/STM-64' %10 Gbps
switch (frecuencia66)
case '1310'
Nd66=0.25;
Ith66= 0.009;
case '1550'
Nd66=0.2;
Ith66= 0.015;
end
case 'STS-768/STM-256' %40 Gbps
switch (frecuencia66)
case '1310'
Nd66=0.25;
Ith66= 0.009;
case '1550'
Nd66=0.2;
Ith66= 0.015;
end
end
while j<=b
if (u(1,j)<Id66)
r66(1,j) = Ith66;
else
r66(1,j) = Nd66*(u(1,j)-Ith66);
end
j=j+1;
end
luz=r66;
end
if isempty(find_system(gcs,'Name','Regenerator7'))~=1
Blks77=([gcs,'/','Regenerator7']);
% snr_in_dB77=str2num(get_param(Blks77,'Potencia'));
tiposenal77=get_param(Blks77,'sel');
frecuencia77=get_param(Blks77,'frec');
% En dB
[a b]=size(u);
%SNR=exp((snr_in_dB)*(log(10)/10));
%sigma=(1/sqrt(2*SNR));
%==============================================
% Punto de decision
% Id = I(0)+I(1)/2
Id77=(max(u(:,:))+min(u(:,:)))/2;
%---------------------------------------------
j=1;
r77=zeros(1,b);
%Circuito de Decision
%Salida Optica
%Datasheet LUCENT
switch (tiposenal77)
case 'STS-12/STM-4' %622 Mbps
switch (frecuencia77)
case '1310'
Nd77=0.5;
Ith77= 0.01;
case '1550'
Nd77=0.25;
Ith77= 0.01;
end
case 'STS-48/STM-16' %2.5 Gbps
switch (frecuencia77)
case '1310'
Nd77=0.25;
Ith77= 0.01;
case '1550'
Nd77=0.22;
Ith77= 0.01;
end
case 'STS-192/STM-64' %10 Gbps
switch (frecuencia77)
case '1310'
Nd77=0.25;
Ith77= 0.009;
case '1550'
Nd77=0.2;
Ith77= 0.015;
end
case 'STS-768/STM-256' %40 Gbps
switch (frecuencia77)
case '1310'
Nd77=0.25;
Ith77= 0.009;
case '1550'
Nd77=0.2;
Ith77= 0.015;
end
end
while j<=b
if (u(1,j)<Id77)
r77(1,j) = Ith77;
else
r77(1,j) = Nd77*(u(1,j)-Ith77);
end
j=j+1;
end
luz=r77;
end
if isempty(find_system(gcs,'Name','Regenerator8'))~=1
Blks88=([gcs,'/','Regenerator8']);
% snr_in_dB88=str2num(get_param(Blks88,'Potencia'));
tiposenal88=get_param(Blks88,'sel');
frecuencia88=get_param(Blks88,'frec');
% En dB
[a b]=size(u);
%SNR=exp((snr_in_dB)*(log(10)/10));
%sigma=(1/sqrt(2*SNR));
%==============================================
% Punto de decision
% Id = I(0)+I(1)/2
Id88=(max(u(:,:))+min(u(:,:)))/2;
%---------------------------------------------
j=1;
r88=zeros(1,b);
%Circuito de Decision
%Salida Optica
%Datasheet LUCENT
switch (tiposenal88)
case 'STS-12/STM-4' %622 Mbps
switch (frecuencia88)
case '1310'
Nd88=0.5;
Ith88= 0.01;
case '1550'
Nd88=0.25;
Ith88= 0.01;
end
case 'STS-48/STM-16' %2.5 Gbps
switch (frecuencia88)
case '1310'
Nd88=0.25;
Ith88= 0.01;
case '1550'
Nd88=0.22;
Ith88= 0.01;
end
case 'STS-192/STM-64' %10 Gbps
switch (frecuencia88)
case '1310'
Nd88=0.25;
Ith88= 0.009;
case '1550'
Nd88=0.2;
Ith88= 0.015;
end
case 'STS-768/STM-256' %40 Gbps
switch (frecuencia88)
case '1310'
Nd88=0.25;
Ith88= 0.009;
case '1550'
Nd88=0.2;
Ith88= 0.015;
end
end
while j<=b
if (u(1,j)<Id88)
r88(1,j) = Ith88;
else
r88(1,j) = Nd88*(u(1,j)-Ith88);
end
j=j+1;
end
luz=r88;
end
if isempty(find_system(gcs,'Name','Regenerator9'))~=1
Blks99=([gcs,'/','Regenerator9']);
% snr_in_dB99=str2num(get_param(Blks99,'Potencia'));
tiposenal99=get_param(Blks99,'sel');
frecuencia99=get_param(Blks99,'frec');
% En dB
[a b]=size(u);
%SNR=exp((snr_in_dB)*(log(10)/10));
%sigma=(1/sqrt(2*SNR));
%==============================================
% Punto de decision
% Id = I(0)+I(1)/2
Id99=(max(u(:,:))+min(u(:,:)))/2;
%---------------------------------------------
j=1;
r99=zeros(1,b);
%Circuito de Decision
%Salida Optica
%Datasheet LUCENT
switch (tiposenal99)
case 'STS-12/STM-4' %622 Mbps
switch (frecuencia99)
case '1310'
Nd99=0.5;
Ith99= 0.01;
case '1550'
Nd99=0.25;
Ith99= 0.01;
end
case 'STS-48/STM-16' %2.5 Gbps
switch (frecuencia99)
case '1310'
Nd99=0.25;
Ith99= 0.01;
case '1550'
Nd99=0.22;
Ith99= 0.01;
end
case 'STS-192/STM-64' %10 Gbps
switch (frecuencia99)
case '1310'
Nd99=0.25;
Ith99= 0.009;
case '1550'
Nd99=0.2;
Ith99= 0.015;
end
case 'STS-768/STM-256' %40 Gbps
switch (frecuencia99)
case '1310'
Nd99=0.25;
Ith99= 0.009;
case '1550'
Nd99=0.2;
Ith99= 0.015;
end
end
while j<=b
if (u(1,j)<Id99)
r99(1,j) =Ith99;
else
r99(1,j) = Nd99*(u(1,j)-Ith99);
end
j=j+1;
end
luz=r99;
end
if isempty(find_system(gcs,'Name','Regenerator10'))~=1
Blks100=([gcs,'/','Regenerator10']);
% snr_in_dB100=str2num(get_param(Blks100,'Potencia'));
tiposenal100=get_param(Blks100,'sel');
frecuencia100=get_param(Blks100,'frec');
% En dB
[a b]=size(u);
%SNR=exp((snr_in_dB)*(log(10)/10));
%sigma=(1/sqrt(2*SNR));
%==============================================
% Punto de decision
% Id = I(0)+I(1)/2
Id100=(max(u(:,:))+min(u(:,:)))/2;
%---------------------------------------------
j=1;
r100=zeros(1,b);
%Circuito de Decision
%Salida Optica
%Datasheet LUCENT
switch (tiposenal100)
case 'STS-12/STM-4' %622 Mbps
switch (frecuencia100)
case '1310'
Nd100=0.5;
Ith100= 0.01;
case '1550'
Nd100=0.25;
Ith100= 0.01;
end
case 'STS-48/STM-16' %2.5 Gbps
switch (frecuencia100)
case '1310'
Nd100=0.25;
Ith100= 0.01;
case '1550'
Nd100=0.22;
Ith100= 0.01;
end
case 'STS-192/STM-64' %10 Gbps
switch (frecuencia100)
case '1310'
Nd100=0.25;
Ith100= 0.009;
case '1550'
Nd100=0.2;
Ith100= 0.015;
end
case 'STS-768/STM-256' %40 Gbps
switch (frecuencia100)
case '1310'
Nd100=0.25;
Ith100= 0.009;
case '1550'
Nd100=0.2;
Ith100= 0.015;
end
end
while j<=b
if (u(1,j)<Id100)
r100(1,j) = Ith100;
else
r100(1,j) = Nd100*(u(1,j)-Ith100);
end
j=j+1;
end
luz=r100;
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -