Home Forums EXCHANGE Matlab OSA

Viewing 2 reply threads
  • Author
    Posts
    • #26513
      Damian Marek
      Participant

      Attached is a Matlab program that displays the spectral content of an OptiSystem Optical Signal.

      Attachments:
    • #26516
      Damian Marek
      Participant

      Matlab code follows:

      %%% Matlab OSA code %%%
      OutputPort1 = InputPort1;
      %%% Defining the amplitude and frequency arrays %%%
      amp = InputPort1.Sampled.Signal;
      freq = InputPort1.Sampled.Frequency;

      %%% Assign default polarization to 1 %%%
      polar = 1;

      %%% Check how many polarizations there are, and then apply the appropriate %%%
      %%% equations to convert to power. %%%

      if (length(amp) > length(freq))
      polar = 2;
      end
      if (polar == 2)
      power = amp(1,:).^2 + amp(2,:).^2;
      else
      power = amp(1,:).^2;
      end

      %%% Convert power to dBm, and plot %%%
      power_dBm = 10*log10(power*1000);
      plot(freq, power_dBm);
      pause(5);

    • #26544
      Alessandro Festa
      Participant

      Thanks again Damian, these examples of Matlab cosimulation that you are posting are very useful!

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