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
PURPOSE j at all freq
Definition: QPpassive.m:44
Undo scaling of outgoing poles
Undo scaling of outgoing residues
fitData
freqSamples
Find a complex rational model for freq domain data for a
fprintf(prrFile, "%d", 50)
prrFile
for i
function generatePRRFile(filePath, targetName) s2p
b
Definition: getResidues.m:47