Home Forums SYSTEM how to export the data from optisystem to matlab

how to export the data from optisystem to matlab

Profile Photo
(joined October 2014)
Participant

hi everybody.i want to know how can i export the data from optisystem to matlab.i want to calculate the SNR as i signed from the picture i attached.by the way, how can i extinguish the signal and noise if i select “convert to noise bin”.thank you all of you in advance.

Attachments:

Responses (16):

    • #16676
      Profile Photo
      Joseph Jiang
      Participant

      hi everybody.i want to know how can i export the data from optisystem to matlab.i want to calculate the SNR as i signed from the picture i attached.by the way, how can i extinguish the signal and noise if i select “convert to noise bin”.thank you all of you in advance.

      Attachments:
    • #16696
      Profile Photo
      Ravil
      Participant

      Hi Joseph, the best way to do it is to add a signal fork at the location at which you would like to retrieve the data. This fork should be connected to Matlab component. A Matlab file will be created.

      • #16701
        Profile Photo
        Joseph Jiang
        Participant

        hi,ravil,thankyou for your reply!what i really want to know is how to write the matlab code to export the data to calculate the SNR!

        • #16703
          Profile Photo
          Ravil
          Participant

          In my opinion, you can create an m-file that reads in an your signal and horizontally concatenates the vector (from each sweep) to an array (thus creating a large signal array representing all the sweeps). For example, a “SweepNum” parameter is first setup in the global parameters (from 1 to N), followed by the “Amplitude” of your Oscilloscope Visualizer…

        • #16718
          Profile Photo
          Joseph Jiang
          Participant

          dear ravil.i understand you,however i am not familar the matlab code in cosimulation in optisystem and matlab especially the interface between optisystem and matlab.can you help me?thank you!

        • #16720
          Profile Photo
          Damian Marek
          Participant

          Your first step should be to understand how the co-simulation works! Although not hard it can be a bit confusing. Two things I would suggest is first reading about data structures in Matlab in the help section and searching the forum here for Matlab examples.

          There is also a youtube video we made about the process:

          Matlab Binary Switch

          Regards

          +1
        • #16723
          Profile Photo
          Joseph Jiang
          Participant

          hi DAMIAN,I HAVE TRIED ALL you said including searching all about cosimulation between optisystem and matlab in the forum and i can understand all the examples in the help doc.however if i tried to write matlab code to export data to matlab,i found it is a little hard.and i have another question is that how can i calculate the SNR if i had export the data when the global parameter setting “convert noise bin”.thank you!

    • #16697
      Profile Photo
      Ravil
      Participant

      If you are working with multiple sweeps a signal-vector array will be created. Matlab file will be linked to the name of your visualizer…

    • #16698
      Profile Photo
      Ravil
      Participant

      According to your 2nd question, did you consider the ‘Signal’ and ‘Noise’ tabs of your visualizer screen?

      • #16702
        Profile Photo
        Joseph Jiang
        Participant

        RAVIL,AS you know,if we select the global parameter,the signal and noise would transmitted together,so it is necessary to extinguish what is signal and what is noise to get the SNR as i refered to.

    • #16726
      Profile Photo
      Ravil
      Participant

      Joseph, as an example, here is the matlab code which I used for multiple sweeps of pulse generator (with the parameters I defined above)

      i = SweepNum;
      SignalVector = InputPort1.Sampled.Signal’;
      if i == 1
      TotalSignal = SignalVector;
      else
      TotalSignal = horzcat(TotalSignal,SignalVector);
      end

      If I get the code for your case I’ll let you know. Good luck!

      • #16727
        Profile Photo
        Joseph Jiang
        Participant

        thank you RAVIL.

      • #38882
        Profile Photo
        Jamal
        Participant

        Ravil,
        I tried this code, it works fine for one iteration, but for the next, it is giving me the error of mismatched matrix dimensions.
        Any solution for that ?

    • #33194
      Profile Photo
      Jamal
      Participant

      Joseph Jiang, I’d like to know if you were able to find the snr in matlab.

    • #33200
      Profile Photo
      SAHIL SINGH
      Participant

      Hi Ravil and Damian,

      Thanks for such a valuable information…

      Regards

      Sahil Singh

    • #33299
      Profile Photo
      MHD NA
      Participant

      you can create an m-file that reads in an your signal and horizontally concatenates the vector (from each sweep) to an array (thus creating a large signal array representing all the sweeps). For example, a “SweepNum” parameter is first setup in the global parameters (from 1 to N), followed by the “Amplitude” of your Oscilloscope Visualizer.

    • #38895
      Profile Photo
      Rajguru M. Mohan
      Participant

      Hi Jiseph,
      I don’t think that we could export data from optisystem to MATLAB.
      Although i could design the networks using MAtlab code.

      Thanks,

      +4

Login You must be logged in to reply to this topic.