JUK1
generatePRRFile.m
Go to the documentation of this file.
1
function
generatePRRFile
( filePath, targetName )
2
s2p = sparameters( filePath );
3
4
freqSamples
= s2p.Frequencies * 1e-9;
5
6
fitData
=
struct
(
"poles"
, {},
"residues"
, {},
"remainder"
, {},
"proportional"
, {});
7
S
= repmat(
fitData
, s2p.NumPorts, s2p.NumPorts );
8
9
prrFile
= fopen( targetName,
'w'
);
10
fprintf
(
prrFile
,
"%d"
, 50 );
11
12
% Find
a
complex rational model
for
freq
domain data
13
for
a
= 1 : 1 : s2p.NumPorts
14
for
b
= 1 : 1 : s2p.NumPorts
15
[ S(a, b).poles, S(a, b).residues, S(a, b).remainder, S(a, b).proportional ] = findComplexRationalApproximation(
freqSamples
, squeeze(s2p.Parameters(
a
,
b
, : )) );
16
17
fprintf
(
prrFile
,
"\n%g %g\n"
, real(
S
(
a
,
b
).
remainder
), imag(
S
(
a
,
b
).
remainder
) );
18
fprintf
(
prrFile
,
"%g %g"
, real(
S
(
a
,
b
).
poles
( 1 ) ), imag(
S
(
a
,
b
).
poles
( 1 ) ) );
19
for
i
= 2 : 1 : length(
S
(
a
,
b
).
poles
)
20
fprintf
(
prrFile
,
" %g %g"
, real(
S
(
a
,
b
).
poles
(
i
) ), imag(
S
(
a
,
b
).
poles
(
i
) ) );
21
end
22
23
fprintf
(
prrFile
,
"\n%g %g"
, real(
S
(
a
,
b
).
residues
( 1 ) ), imag(
S
(
a
,
b
).
residues
( 1 ) ) );
24
for
i
= 2 : 1 : length(
S
(
a
,
b
).
residues
)
25
fprintf
(
prrFile
,
" %g %g"
, real(
S
(
a
,
b
).
residues
(
i
) ), imag(
S
(
a
,
b
).
residues
(
i
) ) );
26
end
27
end
28
end
29
end
freq
PURPOSE j at all freq
Definition:
QPpassive.m:44
poles
Undo scaling of outgoing poles
Definition:
findComplexRationalApproximation.m:70
residues
Undo scaling of outgoing residues
Definition:
findComplexRationalApproximation.m:70
remainder
remainder
Definition:
findComplexRationalApproximation.m:74
fitData
fitData
Definition:
generatePRRFile.m:6
freqSamples
freqSamples
Definition:
generatePRRFile.m:4
a
Find a complex rational model for freq domain data for a
Definition:
generatePRRFile.m:13
fprintf
fprintf(prrFile, "%d", 50)
prrFile
prrFile
Definition:
generatePRRFile.m:9
i
for i
Definition:
generatePRRFile.m:19
S
S
Definition:
generatePRRFile.m:7
generatePRRFile
function generatePRRFile(filePath, targetName) s2p
b
b
Definition:
getResidues.m:47
src
Matlab
generatePRRFile.m
Generated by
1.9.1