Why do I receive the error 'Incomplete noise parameters' when using the READ function in RF Toolbox 1.1 (R14SP2) to read a Touchstone ".s2p" file with comments or empty lines between data lines?

2 views (last 30 days)
I am trying to read a Touchstone ".s2p" file, which has comments and empty lines between data lines. The execution of the READ command on this file results in the following error:
??? Error using ==> rfdata.data.read>readsnp
Incomplete noise parameters.
Reproduction Steps:
h = read(rfdata.data,'Test.s2p');
where "Test.s2p" is a Touchstone file with comments or empty lines between data lines.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 17 Oct 2017
This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
The ability to use the READ function to read a Touchstone ".s2p" file with comments or empty lines between data lines is not available in RF Toolbox 1.1 (R14SP2).
To work around this issue, you can follow the steps outlined below to change the ".s2p" file to a ".amp" file which can be read by the READ function:
1. Open the ".s2p" file in the MATLAB editor.
2. Replace the original network parameter header, to a AMP-file network parameter header. For example, replace
# GHZ S MA R 50.000000
with
S MA R 50.000000
FREQ GHz.
3. Use "Edit -> Find and Replace" menu to replace all instances of “!” with “*”.
4. Save the file as a ".amp" file and execute the following command:
mydata = read(rfdata.data, 'Test.amp')
where "Test.amp" is the modified version of the".s2p" file. For more information on the AMP-file format, see the following link on the MathWorks support website:

More Answers (0)

Products


Release

R14SP2

Community Treasure Hunt

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

Start Hunting!