touchstone file could not be processed in matlab

i tried to import the s4p file into matlab as shown in the code bellow, i get the following error.
Where did i go wrong?
Thanks.
obj = SParameterChannel('FileName','RDL1_PCB.s4p',...
'PortOrder', [1 2 3 4],
...
'MaxNumberOfPoles', 1000,...
'ErrorTolerance', -40,...
'SampleInterval', 6.25e-12,...
'StopTime', 100e-09,...
'TxAmplitude', 1.0,...
'TxRiseTime', 40e-12,...
'TxRTFactor', 0.6);
plotRational(obj)
Unable to resolve the name 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{:});
Error in SParameterChannel/validateSparameter (line 459)
sobj = sparameters(obj.FileName);
Error in SParameterChannel/calculateImpulse (line 488)
validateSparameter(obj)
Error in SParameterChannel/get.f (line 402)
calculateImpulse(obj);
Error in SParameterChannel/plotRational (line 428)
freqsforresp = linspace(0,max(obj.f)*2,length(obj.f))';

 Accepted Answer

It took some digging, but the error is likely because you do not have the RF Toolbox installed. From the documentation page for SParameterChannel:
The SParameterChannel object combines the scattering parameter (S-parameter) model of a baseband communication channel with an analog transmitter and receiver into a single S-parameter with adjustable port ordering. The object then calculates the impulse response of the S-Parameter using the rational (RF Toolbox) function. The SParameterChannel object supports .sNp Touchstone files, where N is an even number representing the number of ports. The value of N is 4 or higher.
I was getting the same error as you until I added it. If RF Toolbox is included in your license, you can use the Add-Ons Explorer.
I will send a request internally for improving the error messaging in this scenario.

More Answers (0)

Products

Tags

Asked:

on 17 May 2021

Commented:

on 17 May 2021

Community Treasure Hunt

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

Start Hunting!