Why is Simulink having trouble reading my S2D file?

7 views (last 30 days)
I am trying to model a nonlinear amplifier using the basic example from Simulink: https://www.mathworks.com/help/simrf/ug/effect-of-nonlinear-amplifier-on-16-qam-modulation.html
Using an S2D file directly from Keysight ADS. I had success with using the S2D file from Keysight when I ran the simulation at one frequency, but now I'm trying to do a frequency sweep and Simulink is having trouble reading the S2D file. I am getting the following error:
"There must be 2 format line(s) starting with '%' in GCOMP7 block starting at line 22."
The beginning of the file I am trying to simulate looks like:
BEGIN ACDATA
# AC( MHZ S RI R 50 FC 1 0 )
! small signal s-parameter
% F n11x n11y n21x n21y n12x n12y n22x n22y
800.000000 -4.584471e-02 -0.258631 -2.440988 4.685035 0.108317 7.801435e-02 0.101332 -0.373330
900.000000 0.386185 0.464434 2.178210 0.911711 3.556149e-02 -5.696217e-02 -0.219911 0.533767
1000.000000 0.837261 3.858904e-03 0.585465 -0.465193 -1.116563e-02 -2.083559e-02 0.432280 0.651650
.......................
END ACDATA
BEGIN GCOMP7
#AC ( MHZ S DBM RI R 50 )
% F
800.000000
% PIN n21x n21y
-7.757350e-11 0.988638 1.666646e-02
2.000000 0.984509 2.362618e-02
.......................
Which causes the above error. As far as I can tell this is a perfectly valid S2D format.
The below S2D file example is directly from an ADS example, and this runs perfectly fine in Simulink:
VAR BiasL=1.9
VAR BiasU=5.3
BEGIN ACDATA
# AC( MHZ S RI R 50 FC 1 0 )
! small signal s-parameter
% F n11x n11y n21x n21y n12x n12y n22x n22y
850.000000 -9.081190e-02 0.240237 1.297081 3.478918 0.126314 -2.523062e-02 -0.323639 -3.763416e-02
END ACDATA
BEGIN GCOMP7
#AC ( MHZ S DBM RI R 50 )
% F
850.000000
% PIN n21x n21y
-7.757350e-11 0.999346 2.712170e-03
1.000000 0.998974 3.741319e-03
I don't see what could be causing this issue, since the S2D format of the frequency sweeped version seems valid.

Accepted Answer

Jonathan Scott
Jonathan Scott on 13 Mar 2023
For anyone who Googles out of curiosity, the S2D output from ADS is not recognized by MATLAB. For compression data in the S2D file, you need to repeat the BEGIN GCOMP7, #AC (...), END GCOMP7 wrapper around every frequency/compression curve points.

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!