Home Forums SYSTEM modelig optical fiber attenuation and dispersion using matlab

Viewing 5 reply threads
  • Author
    Posts
    • #20106
      mohammed hosni
      Participant

      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

    • #20221
      Dr Rk Sethi
      Participant

      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
      end

      Regards,

    • #20222
      mohammed hosni
      Participant

      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

    • #20227
      Dr Rk Sethi
      Participant

      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 ;

    • #20257
      mohammed hosni
      Participant

      how the m.file code would be??

    • #20271
      Dr Rk Sethi
      Participant

      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.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.