'sparameters' function showing error to read S-parameter data from touchstone file

31 Ansichten (letzte 30 Tage)
I am trying to read S-parameter data from touchstone file using the following option:
sobj = sparameters(filename)
But getting the following errors
"Error using rf.file.touchstone.Data/read
Data is inconsistent with the Touchstone format.
Error in rf.file.touchstone.Data
Error in rf.internal.netparams.AllParameters/readRFFile
Error in rf.internal.netparams.AllParameters
Error in rf.internal.netparams.ScatteringParameters
Error in sparameters (line 80)
obj = obj@rf.internal.netparams.ScatteringParameters(varargin{:});"
The touchstone file is in DB/angle format
! ...
# GHz S DB R 50
!
Is that an issue or the problem is somewhre else?
Note that I can read the touchstone file without any issue in other commercial software.
  2 Kommentare
Vu Hoang Thang Chau
Vu Hoang Thang Chau am 8 Mai 2024
Hi Muhammad,
I have the same problem trying to import my .s2p files from Minicircuit.
@MathWorks Support Team Is there any explanation?
S= sparameters('AVA-183A+_5.25V_Plus25degC.s2p');
The error that I got
Error using ibisTschk2
Invalid character '�'.
Error in rf.file.touchstone.Data
Error in rf.internal.netparams.AllParameters/readRFFile
Error in rf.internal.netparams.AllParameters
Error in rf.internal.netparams.ScatteringParameters
Error in sparameters (line 91)
obj = obj@rf.internal.netparams.ScatteringParameters(varargin{:});
Regards,
Vu.
Shawn Hineline
Shawn Hineline am 18 Mai 2024
Hi All,
I have the same issue importing Minicircuits .s2p files. The import worked with a previous version of Matlab. With the current version of matlab (R2024a, Update 2) I had to remove the degrees symbol from the file for the import to work.
For example:
!TEST CONDITIONS: Z:50 OHM SYSTEM, INPUT POWER = 0dBm, TEMP:25C
reads in correctly,
!TEST CONDITIONS: Z:50 OHM SYSTEM, INPUT POWER = 0dBm, TEMP:25°C
gives an error.
Note the whole line is commented out so matlab should ignore everything in the line and not give a read error
Thanks,
Shawn

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Mark
Mark am 11 Feb. 2025
Bearbeitet: Mark am 11 Feb. 2025
Unfortunately, the official Touchstone 2.0 reader pays attention to non-US-ascii characters even if they are in comments.
>> setTouchstoneReader('IgnoreComments',false) % to enable reading "bad" files
>> setTouchstoneReader('ParseComments',false) % to go back to strict behavior
This uses MATLAB settings, so please be careful to include the "false" so that your setting isn't persistent.
The documentation for setTouchstoneReader is at setTouchstoneReader.
Best,
Mark
  4 Kommentare
Mark
Mark am 11 Feb. 2025
I agree with you.
I'm not a fan of the settings solution. It's not name-value pairs.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Import and Network Parameters finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by