This example shows the Traveling Wave Laser model's (TWLM) gain curve fitting function by using the script command mczfit. The gain curve data is retrieved from a text file with a certain format. Please refer to the linked page in the See Also section for the implementation details of this command.
The gain curve data is stored in the text file sampleGainData.txt. The format of the data file is shown below:
(1, Nc) carrierdensity_1, carrierdenisty_2, …, carrierdensity_Nc (Ns, Nc+1) freq_1gain_1_1gain_1_2…gain_1_Nc freq_2gain_2_1gain_2_2…gain_2_Nc …………… freq_Nsgain_Ns_1gain_Ns_2…gain_Ns_Nc
where the parameters are:
Nc: |
the number of gain curves |
Ns: |
the number of frequency samples |
carrierdensity_j: |
the carrier density corresponding to the j-th gain curve |
freq_i: |
the i-th frequency sample |
gain_i_j: |
the gain value for the i-th frequency sample in the j-th curve |
Please note that the frequencies must be in ascending order and the gain curves as well as the carrier densities must be in descending order of the carrier density in the file.
Based on the data in the text file, the following command in the script file fitplotBasic.lsf will find the variable gain filter coefficients that fits to the curves:
fit_out=mczfit("sampleGainData.txt","sampleGainData",fc,fs,maxcoef,tol,maxiter,true,rolloff);
The out put fit_out is a struct that contains the following return values:
fit_out: |
a struct with fields |
frequency: |
a column vector of the frequency sample points |
input: |
a matrix with the column vectors containing the input frequency response to be fit for each operating point |
operatingPoint: |
a row vector containing the input operating points corresponding to the input frequency responses in the columns of the input matrix |
operatingPointInterpolated: |
a row vector containing values of the linearly interpolated values of operating points between the input values of operating points |
output: |
a matrix with the column vectors containing the fit frequency response for each input operating point |
outputInterpolated: |
a matrix with the column vectors containing the fit frequency response for each linearly interpolated operating point contained in row vector ‘operatingPointInterpolated’. |
This script function also produces a gain filter coefficients to be used by the TWLM element. The name of the file will be outputfilename.mcfdb. This file can then be loaded into the TWLM element and used to define the laser's gain curves.
The following figure is the fitting result for the file sampleGainData.txt. The solid lines are the gain curves defined in the file and the dashed lines are the fitting results. Great agreements are shown in the figure for the interested central frequency band.
Figure 1
Then the generated file which contains the gain filter coefficients twlmGainFitTest.mcfdb is loaded to the TWLM element in the example file twlmGainFitTest.icp. The circuit in the example file is showing below:
Figure 2
The sweep object "sweep" defined in the project file sweeps the initial carrier densities in the gain material and records the transmission as the result. Since the carrier decay rates and input currents are set to zero, and the Optical Network Analyzer (ONA) sends in an impulse response, the carriers in the TWLM do not change significantly and hence the impulse response of the gain filters can be obtained for comparison with the diagnostic result from the TWLM.
Run the simulation project and the sweep. Open and run the script file plotDiagAndIR.lsf in the project file. The script will retrieve the diagnostic result from the TWLM and compares it to the impulse response result obtained from the sweep. The following figure is the comparison result and great agreement between the diagnostic result and impulse response is shown.
Figure 3
See Also
mczfit, Laser TW (TWLM), Fabry-Perot Laser, DBR Laser, DFB Laser, Ring Vernier Laser