- This topic has 5 replies, 2 voices, and was last updated 9 years, 7 months ago by Dr Rk Sethi.
-
AuthorPosts
-
-
April 24, 2015 at 1:23 pm #20106mohammed hosniParticipant
i need to know the error with the attached m file matlab which is modeling attenuation and dispersion for optical fiber and use it in optisystem
-
April 29, 2015 at 4:44 pm #20221Dr Rk SethiParticipant
Mohammed Hosni HI!
can you explain what error, are you getting during the simulation of the same?% Create an output structure similar to the input
OutputPort1 = InputPort1;
% Attenuation constant
A = Parameter0;%attenuation of fiber db/km
L=Parameter1;%Length of fiber in km
D=Parameter2;%dispersion of fiber
% calculate the optical signal attenuation
if strcmp(InputPort1.TypeSignal ,’Optical’)
% verify how many sampled signals are in the structure
[ls, cs] = size(InputPort1.Sampled);
if( ls > 0 )
% calculate the attenuation at each signal
for counter1=1:cs
OutputPort1.Sampled(1, counter1).Signal = InputPort1.Sampled(1, counter1).Signal * 10^((-1 * A*L) / 10);
end
end
[lp, cp] = size(InputPort1.Parameterized);
if( lp > 0 )
OutputPort1.Parameterized.Linewidth = InputPort1.Parameterized.Linewidth .*L*D ;
OutputPort1.Parameterized.Power = InputPort1.Parameterized.Power .*(10^((-A*L)/10)) ;end
endRegards,
-
April 29, 2015 at 5:21 pm #20222mohammed hosniParticipant
the erorr in
OutputPort1.Parameterized.Linewidth = InputPort1.Parameterized.Linewidth .*L*D ;
as in the Parameriezed optical signal structure launched into matlab there isn’t linewidth -
April 29, 2015 at 6:12 pm #20227Dr Rk SethiParticipant
Mohammed Hosni HI!
I think you are missing some parameter before *L*D in the following line:
OutputPort1.Parameterized.Linewidth = InputPort1.Parameterized.Linewidth .*L*D ; -
May 1, 2015 at 9:31 am #20257mohammed hosniParticipant
how the m.file code would be??
-
May 1, 2015 at 11:35 pm #20271Dr Rk SethiParticipant
Mohammed Hosni HI!
As I said in previous post that you are missing some parameter before *L*D in the following line:
OutputPort1.Parameterized.Linewidth = InputPort1.Parameterized.Linewidth .*L*D ;the m.file code will depend on the equations you are using for the modeling of attenuation and dispersion for optical fiber.
what equations are you using for the same?
Regards.
-
-
AuthorPosts
- You must be logged in to reply to this topic.