Satisfying the complex NxNxM requirement in s2rlgc function
10 views (last 30 days)
Show older comments
Hello world,
I am trying to convert some s-parameters to the RLGC values using matlabs s2rlgc function. (It comes with the RF toolbox). However so far it has been able to do so for one individual value of s parameters. For example, I run the following script.
S_11 = 2.80007716585167 - 194.777061344490i;
S_12 = 1.01738305506126 + 0.00852418806674031i;
S_21 = 1.00027791458013 + 6.81079834005747e-07i;
S_22 = 10.1134655629712 + 0.881321459087057i;
freq = 40000000000;
% put the 4 s-parameters in a matrix
s_params = [S_11,S_12; S_21,S_22];
length = 4.5;
z0 =50;
sparams_passive = makepassive(all_s_params);
rlgc_params = s2rlgc(sparams_passive,length,freq,z0);
disp(rlgc_params)
and it will output
R: -9.3154
L: -2.5604e-10
G: 0.0036
C: 9.9513e-14
alpha: 1.2686
beta: -0.1837
Zc: 0.0012 -50.7238i
into the command window. The problem is that I have a 3202x2 complex double of s paramters since I took them in from a VNA(vector network analyzer; equipment from lab) As you can see from the line of code above, the S parameters form in 4 complex numbers, and so in the s_params matrix, they come out as a 3202x2 complex double. I also have a frequency 1601x1 double that corresponds with each set of s parameters.
I would love to run them all at once. When I try to do so I get error messages that say "S_PARAMS must be a complex NxNxM array."
I am not sure what is meant by NxNxM array. Does anyone have an idea?
8 Comments
David Goodmanson
on 2 Jul 2018
I don't have the RF toolbox so I can't say much. I guess all I could suggest is
plot(abs(S(1,1,:)))
and
plot(angle(S(1,1,:)))
just to see if they make sense. And similarly for S(1,2,:) etc.
Answers (1)
Martin
on 23 Feb 2019
Hi,
with the data in the following form
A = 1st value of array :[ S11 S12 ]
. .
the 1602nd value S21 S22
. .
3202 value of the array [ S21 S22 ]
I would use reshape like this
M = 1601; % size() or length() would be better
B = [A(1:M,1),A(M+1:end,1),A(1:M,2),A(M+1:end,2)].'; % Creates a Matrix of row vectors [s11;s21;s12;s22]
S = reshape(B,[2,2,M]); % creates NxNxM matrix from B
this should work as input for s2rlgc.
0 Comments
See Also
Categories
Find more on Data Import and Network Parameters 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!