Element "Optical S Parameter" does not function as expected

I am trying to implement a nonreciprocal device using the element “Optical S Parameter”. I loaded the .txt file where I specified the sparameters from 1530nm to 1570nm. The S parameters are generated from MATLAB so I know they are correct by graphing the transmmission:

But when I loaded such txt file into INTERCONNECT, the transmission spectrum looks like:

You can clearly see that the spectrum is shifted to the left by about 1nm.

In addition, the angle of transmission is also not as predicted:

where in my matlab code the plot of phase shift should be:

Here is the txt file I have generated:
Sparameter.txt (1.9 MB)

Could anyone tell me what I did wrong? I found similar issue with the element “Optical N Port S-parameter” also.

In addition, I found that the manual for the element “Optical S parameter” gives the wrong information about the format about the txt file. For example, it is not necessary to put “(number of frequency, number of columns)” at the beginning of the file; and the angle of the s parameters should be in radians instead of what is shown in the demo txt file where the angle is in degree.


Correction to my previous reply, I found out that the spectrum shift is due to the fact that I used 3e8 as the speed of light in my matlab code. If I use the actual speed of light 299 792 458 m/s instead, the magnitude of the two spectrums would agree.

As for the phase plot, my guess is that the INTERCONNECT plot the phase shift in the unit of radians. And the result is not a modulus of 2pi. Is my speculation actually the case?

Here is the result after correcting my code:

matlab plot


1 Like

Hi @z_zhang,

You are right about the angle problem. The angle measured by ONA is the unwrapped angle in radians. If you use the ‘angle’ command to read out the angle directly from the transmission, it will be the wrapped angle in radians. The following script could be used to plot the transmission angle in both degree and radians. You need to save it to the same directory of the ‘Sparameter.txt’ file:


# s-parameter file name
filename = "Sparameter.txt";

# add & set ONA
addelement("Optical Network Analyzer");
set("name", "ONA_1");
setnamed("ONA_1", "input parameter", "start and stop");
setnamed("ONA_1", "start frequency", c/1570e-9);
setnamed("ONA_1", "stop frequency", c/1530e-9);
setnamed("ONA_1", "number of points", 10000);
setnamed("ONA_1", "plot kind", "wavelength");
setposition("ONA_1", -200, -200);

# add Optical S-Parameter & load in data
addelement("Optical S-Parameter");
set("name", "SPAR_1");
setnamed("SPAR_1", "load from file", true);
setnamed("SPAR_1", "s parameters filename", filename);

# make connections
connect("ONA_1", "output", "SPAR_1", "port 1");
connect("ONA_1", "input 1", "SPAR_1", "port 2");

S12Trans = getresult("ONA_1", "input 1/mode 1/transmission");
lambda = S12Trans.wavelength;
S12Trans = S12Trans.%TE transmission%;
S12Angle = angle(S12Trans); # wraped angle in radians

disconnect("ONA_1", "output", "SPAR_1", "port 1");
disconnect("ONA_1", "input 1", "SPAR_1", "port 2");
connect("ONA_1", "output", "SPAR_1", "port 2");
connect("ONA_1", "input 1", "SPAR_1", "port 1");

S21Trans = getresult("ONA_1", "input 1/mode 1/transmission");
S21Trans = S21Trans.%TE transmission%;
S21Angle = angle(S21Trans); # wraped angle in radians

plot(lambda*1e6, S12Angle, S21Angle, "lambda (um)", "angle (rad)");
plot(lambda*1e6, S12Angle*180/pi, S21Angle*180/pi, "lambda (um)", "angle (degree)");   

The angles are plotted as below, which kind of matches your MATLAB simulation result. Another thing to note, the ONA resolution also affects the angle to some minor extent as the angle is very sensitive.

For the s-parameter file format, the (# of frequency, # of column) indeed is optional. Generally, most of the parameters inside brackets are just comments and are optional in the files.

I hope this could help :slight_smile:


My problems are all resolved.

I am trying to make a compound element based on the “optical S parameter” element. I already write the setup script that can generate the transmission spectrum that has isolation at certain wavelength. My only issue is I do not know which script command to use in order for me to access the property I defined in the property editor.

These are the three variables I would like to change and see the effect on the transmission spectrum. Right now their values are hard coded in the setup script so in order to change the spectrum I would have to update the setup script manually. Is there a way to read these values from script? Can you give me an example?

Hi @z_zhang,

You should be able to access the properties you defined in the compound ‘Property Editor’ in the setup script. And you can use them as they are by naming them, no quotation marks needed for number values.

However, the properties that are defined in the compound level (parent level) are just accessible but not editable in the setup script, meaning that you can read out the values and use them as the way you want, but you can not change the values in the setup script. The values defined in the ‘Property Editor’ will be shown in the compound ‘Property View’ window and you can change the values there. Every change to the compound element will trigger the setup script so that the compound will be re-defined accordingly.

You can access and change the properties defined in lower level (children level) in the current compound setup script.

There is an example file compound_element.icp (210.9 KB) in which a Fabry-Perot cavity is defined in a compound, the ‘wg_length’ is a customized property and it is used in the setup script to set the waveguide’s length.

I hope this could help. Let me know if you have further problems :slight_smile:

1 Like