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

Viewing 8 reply threads
  • Author
    Posts
    • #16676
      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
      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
        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
          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
          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
          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

        • #16723
          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
      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
      Ravil
      Participant

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

      • #16702
        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
      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
        Joseph Jiang
        Participant

        thank you RAVIL.

      • #38882
        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
      Jamal
      Participant

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

    • #33200
      SAHIL SINGH
      Participant

      Hi Ravil and Damian,

      Thanks for such a valuable information…

      Regards

      Sahil Singh

    • #33299
      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
      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,

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