📄 fotodiodo.asv
字号:
function curr=fotodiodo(u)
%======================================================
% FOTODIODO
% Esta funcion permite expresar la entrada optica en forma de corriente.
%O sea, llevar la entrada a un nivel electrico.
%
% Sigue la siguiente ecuacion:
%
% I (mA)=R*M*Pot_Rec
%
% Donde: Pot_Rec (mW) = Potencia que llega al fotodetector.Depende del tipo de senal y
% de la longitud de onda.
% R (mW/mA) = Responsividad del Fotodetector. Depende del tipo de material
% de que este hecho el fotodetector.
% M = Factor de Multiplicacion de un fotodiodo APD.
% Se denomina Ganancia APD Promedio.
%
%======================================================
%
% AUTORES : Z. AGUI%O & D. STECKLER
% Universidad de Carabobo
% Valencia edo. Carabobo, VENEZUELA
%
% FECHA : Enero 2004
% VERSION : 1.0
%
%======================================================
% Realizado bajo MATLAB 6.5 Release 13/ Enero 2004 (DZ)
%======================================================
%Obtencion de Parameros del Bloque
% i=1; band=0;
% if band==0
% while i<=50
% if isempty(find_system(gcs,'Name','Fotodetector'))==1
% band=2; %No Encontrado
% else
% band=3; %Encontrado
% Bl=([gcs,'/','Fotodetector']);
% break
% end
% i=i+1;
% end
% else
% end
% %Entra solo si no encontro el nombre 'Fotodetector'
%
% while i<=50
% if isempty(find_system(gcs,'Name',['Fotodetector',int2str(i)]))==1
% band=3;% No Encontrado
% else
% band=4; %Encontrado
% Bl=([gcs,'/','Fotodetector',int2str(i)])
% break
% end
% i=i+1;
% end
%
if isempty(find_system(gcs,'Name','Fotodetector'))~=1
B00=([gcs,'/','Fotodetector']);
R00=str2num(get_param(B00,'R'));
M00=str2num(get_param(B00,'M'));
R_APD00=M00*R00;
set_param(B00,'Gain',num2str(R_APD00));
curr=u(:,:);
else
end
if isempty(find_system(gcs,'Name','Fotodetector1'))~=1
B11=([gcs,'/','Fotodetector1']);
R11=str2num(get_param(B11,'R'));
M11=str2num(get_param(B11,'M'));
R_APD11=M11*R11;
set_param(B11,'Gain',num2str(R_APD11));
curr=u(:,:);
else
end
if isempty(find_system(gcs,'Name','Fotodetector2'))~=1
B22=([gcs,'/','Fotodetector2']);
R22=str2num(get_param(B22,'R'));
M22=str2num(get_param(B22,'M'));
R_APD22=M22*R22;
set_param(B22,'Gain',num2str(R_APD22));
curr=u(:,:);
else
end
if isempty(find_system(gcs,'Name','Fotodetector3'))~=1
B33=([gcs,'/','Fotodetector3']);
R33=str2num(get_param(B33,'R'));
M33=str2num(get_param(B33,'M'));
R_APD33=M33*R33;
set_param(B33,'Gain',num2str(R_APD33));
curr=u(:,:);
else
end
if isempty(find_system(gcs,'Name','Fotodetector4'))~=1
B44=([gcs,'/','Fotodetector4']);
R44=str2num(get_param(B44,'R'));
M44=str2num(get_param(B44,'M'));
R_APD44=M44*R44;
set_param(B44,'Gain',num2str(R_APD44));
curr=u(:,:);
else
end
if isempty(find_system(gcs,'Name','Fotodetector5'))~=1
B55=([gcs,'/','Fotodetector5']);
R55=str2num(get_param(B55,'R'));
M55=str2num(get_param(B55,'M'));
R_APD55=M55*R55;
set_param(B55,'Gain',num2str(R_APD55));
curr=u(:,:);
else
end
if isempty(find_system(gcs,'Name','Fotodetector6'))~=1
B66=([gcs,'/','Fotodetector6']);
R66=str2num(get_param(B66,'R'));
M66=str2num(get_param(B66,'M'));
R_APD66=M66*R66;
set_param(B66,'Gain',num2str(R_APD66));
curr=u(:,:);
else
end
if isempty(find_system(gcs,'Name','Fotodetector7'))~=1
B77=([gcs,'/','Fotodetector7']);
R77=str2num(get_param(B77,'R'));
M77=str2num(get_param(B77,'M'));
R_APD77=M77*R77;
set_param(B77,'Gain',num2str(R_APD77));
curr=u(:,:);
else
end
if isempty(find_system(gcs,'Name','Fotodetector4'))~=1
B44=([gcs,'/','Fotodetector4']);
R44=str2num(get_param(B44,'R'));
M44=str2num(get_param(B44,'M'));
R_APD44=M44*R44;
set_param(B44,'Gain',num2str(R_APD44));
curr=u(:,:);
else
end
if isempty(find_system(gcs,'Name','Fotodetector5'))~=1
B55=([gcs,'/','Fotodetector5']);
R55=str2num(get_param(B55,'R'));
M55=str2num(get_param(B55,'M'));
R_APD55=M55*R55;
set_param(B55,'Gain',num2str(R_APD55));
curr=u(:,:);
else
end
if isempty(find_system(gcs,'Name','Fotodetector6'))~=1
B66=([gcs,'/','Fotodetector6']);
R66=str2num(get_param(B66,'R'));
M66=str2num(get_param(B66,'M'));
R_APD66=M66*R66;
set_param(B66,'Gain',num2str(R_APD66));
curr=u(:,:);
else
end
end
%
%
% i=1; band=0;
% if band==0
% while i<=50
% if isempty(find_system(gcs,'Name','Fotodetector'))==1
% band=2; %No Encontrado
% else
% band=3; %Encontrado
% B.RF=([gcs,'/','Fotodetector'])
% break
% end
% i=i+1;
% end
% else
% end
% %Entra solo si no encontro el nombre 'Fotodetector'
%
% while i<=50
% if isempty(find_system(gcs,'Name',['Fotodetector',int2str(i)]))==1
% band=3;% No Encontrado
% else
% band=4; %Encontrado
% B.RF=([gcs,'/','Fotodetector',int2str(i)])
% break
% end
% i=i+1;
% end
%
%
%
%
% %end
% %
% %
% R.RF=str2num(get_param(B.RF,'R'))
% M.RF=str2num(get_param(B.RF,'M'))
% %;
% %Inicializacion de Variables
% [a b]=size(u);
% Is=zeros(a,b);
% curr=zeros(a,b);
% %
% %======================================================
% %
% %Calculo dependiendo de los parametros obtenidos
% %
% R_APD=M.RF*R.RF;
% for i=1:b
% Is(1,i)=R_APD*u(1,i); %luz(:,:)=Pot_Rec;
% end
% %
% curr=Is(:,:);
% end
% % [EOF] fotodiodo.m
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -