touchstone file could not be processed in matlab
Show older comments
Hello , I have created a touchstone in cadence virtuoso of two port system(i have renamed it in txt so i could upload it here) but Matlab is not recocnising it.
i tried to import the file into matlab as shown in the code bellow, i get the following error.
Where did i go wrong?
Thanks.
S = sparameters('touchstone_file.s2p');
disp(S)
***************************ERROR MASSAGE********************
S = sparameters('Error using rf.file.touchstone.Data/createoptionlist
Invalid option line for the Touchstone format:
# Hz S RI R 33.755800 50.000000
Error in rf.file.touchstone.Data/read
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 75)
obj = obj@rf.internal.netparams.ScatteringParameters(varargin{:});
3 Comments
Know idea what a Touchstone format valid option line would be, but looking at the Touchstone File Spec document I don't see a case of more than one value for the reference resistance documented...altho can see for a 2-port analyzer needing one for each channel.
Just for grins, try changing that line to
# Hz S RI R 33.755800
and retry to see if works then.
After that, dunno what else to tell you either if it does or doesn't but will be interesting to know result.
dpb
on 22 Apr 2020
[Answer moved to comment...dpb]
correct its working only for 50 ohm ports.
S = sparameters('spp4');
disp(S);
rfplot(S);
dpb
on 22 Apr 2020
Well, that confirms the suspicion I had from the Standard document -- I don't know whether it is that that link is outdated or whether it is a vendor extension beyond the file spec in the particular instrument you're using.
I don't have necessary toolbox so can't look at the code to see how it is implemented; the format is pretty simple such that if it is m-code it should be pretty easy to create a version that will handle the other inputs.
Or, for just the two-port case, doesn't look like would be very hard to just read the file format directly with low-level i/o functions like textscan and/or fscanf and friends...
Accepted Answer
More Answers (1)
Mark
on 15 Nov 2024
Now that RF Toolbox is using the official Touchstone 2.0 reader, the following works.
S = sparameters('touchstone_file.txt')
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!