Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
spfile.cpp
Go to the documentation of this file.
1 /*
2  * spfile.cpp - S-parameter file class implementation
3  *
4  * Copyright (C) 2004, 2005, 2006, 2008, 2009 Stefan Jahn <stefan@lkcc.org>
5  *
6  * This is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this package; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * $Id$
22  *
23  */
24 
25 #if HAVE_CONFIG_H
26 # include <config.h>
27 #endif
28 
29 #include "component.h"
30 #include "matvec.h"
31 #include "dataset.h"
32 #include "strlist.h"
33 #include "poly.h"
34 #include "spline.h"
35 #include "interpolator.h"
36 #include "spfile.h"
37 
38 using namespace qucs;
39 
40 // Constructor for S-parameter file vector.
42  v = f = 0;
43  isreal = 1;
44  inter = NULL;
45  r = c = 0;
46 }
47 
48 // Destructor for S-parameter file vector.
50  if (inter) delete inter;
51 }
52 
53 // Passes vectors and their data types to the S-parameter file vector.
55  bool _isreal, int it, int dt) {
56  v = _v;
57  f = _f;
58  isreal = _isreal;
59  inter = new interpolator ();
60  if (isreal) {
61  inter->rvectors (v, f);
62  inter->prepare (it, REPEAT_NO, dt | DATA_REAL);
63  }
64  else {
65  inter->cvectors (v, f);
66  inter->prepare (it, REPEAT_NO, dt | DATA_COMPLEX);
67  }
68 }
69 
70 // Returns interpolated data.
72  if (isreal)
73  return inter->rinterpolate (x);
74  else
75  return inter->cinterpolate (x);
76 }
77 
78 // Constructor creates an empty and unnamed instance of the spfile class.
79 spfile::spfile () : circuit () {
80  data = NULL;
81  sfreq = nfreq = NULL;
82  spara = FMIN = SOPT = RN = NULL;
83  interpolType = dataType = 0;
84  type = CIR_SPFILE;
85  setVariableSized (true);
86 }
87 
88 // Destructor deletes spfile object from memory.
90  if (spara) delete[] spara;
91  if (RN) delete RN;
92  if (FMIN) delete FMIN;
93  if (SOPT) delete SOPT;
94 #if DEBUG && 0
95  if (data) {
96  data->setFile ("spfile.dat");
97  data->print ();
98  }
99 #endif
100  if (data) delete data;
101 }
102 
103 void spfile::calcSP (nr_double_t frequency) {
104 
105  // nothing to do if the given file type had errors
106  if (spara == NULL || sfreq == NULL) return;
107 
108  // set interpolated S-parameters
110 }
111 
112 /* This function returns the S-parameter matrix of the circuit for the
113  given frequency. It uses interpolation for frequency points which
114  are not part of the original touchstone file. */
115 matrix spfile::getInterpolMatrixS (nr_double_t frequency) {
116 
117  // first interpolate the matrix values
118  matrix s (getSize () - 1);
119  for (int r = 0; r < getSize () - 1; r++) {
120  for (int c = 0; c < getSize () - 1; c++) {
121  int i = r * getSize () + c;
122  s.set (r, c, spara[i].interpolate (frequency));
123  }
124  }
125 
126  // then convert them to S-parameters if necessary
127  switch (paraType) {
128  case 'Y':
129  s = ytos (s);
130  break;
131  case 'Z':
132  s = ztos (s);
133  break;
134  case 'H':
135  s = htos (s);
136  break;
137  case 'G':
138  s = gtos (s);
139  break;
140  }
141  return s;
142 }
143 
144 void spfile::calcNoiseSP (nr_double_t frequency) {
145  // nothing to do if the given file type had errors
146  if (spara == NULL || nfreq == NULL) return;
147  setMatrixN (calcMatrixCs (frequency));
148 }
149 
150 matrix spfile::calcMatrixCs (nr_double_t frequency) {
151  // set interpolated noise correlation matrix
152  nr_double_t r = real (RN->interpolate (frequency));
153  nr_double_t f = real (FMIN->interpolate (frequency));
154  nr_complex_t g = SOPT->interpolate (frequency);
155  matrix s = getInterpolMatrixS (frequency);
156  matrix n = correlationMatrix (f, g, r, s);
157  matrix c = expandNoiseMatrix (n, expandSParaMatrix (s));
158  return c;
159 }
160 
161 /* This function expands the actual S-parameter file data stored
162  within the touchstone file to have an additional reference one-port
163  whose S-parameter is -1 (i.e. ground). */
164 matrix spfile::expandSParaMatrix (matrix s) {
165  assert (s.getCols () == s.getRows ());
166  int r, c, ports = s.getCols () + 1;
167  nr_double_t g = -1;
168  nr_complex_t fr, ss, sr, sc, sa;
169  matrix res (ports);
170 
171  // compute S'mm
172  for (sa = 0, r = 0; r < ports - 1; r++)
173  for (c = 0; c < ports - 1; c++) sa += s.get (r, c);
174  ss = (2 - g - ports + sa) / (1 - ports * g - sa);
175  res.set (ports - 1, ports - 1, ss);
176  fr = (1.0 - g * ss) / (1.0 - g);
177 
178  // compute S'im
179  for (r = 0; r < ports - 1; r++) {
180  for (sc = 0, c = 0; c < ports - 1; c++) sc += s.get (r, c);
181  res.set (r, ports - 1, fr * (1.0 - sc));
182  }
183 
184  // compute S'mj
185  for (c = 0; c < ports - 1; c++) {
186  for (sr = 0, r = 0; r < ports - 1; r++) sr += s.get (r, c);
187  res.set (ports - 1, c, fr * (1.0 - sr));
188  }
189 
190  // compute S'ij
191  for (r = 0; r < ports - 1; r++) {
192  for (c = 0; c < ports - 1; c++) {
193  fr = g * res (r, ports - 1) * res (ports - 1, c) / (1.0 - g * ss);
194  res.set (r, c, s.get (r, c) - fr);
195  }
196  }
197 
198  return res;
199 }
200 
201 /* The function is the counterpart of the above expandSParaMatrix()
202  function. It shrinks the S-parameter matrix by removing the
203  reference port. */
204 matrix spfile::shrinkSParaMatrix (matrix s) {
205  assert (s.getCols () == s.getRows () && s.getCols () > 0);
206  int r, c, ports = s.getCols ();
207  nr_double_t g = -1;
208  matrix res (ports - 1);
209 
210  // compute S'ij
211  for (r = 0; r < ports - 1; r++) {
212  for (c = 0; c < ports - 1; c++) {
213  res.set (r, c, s (r, c) + g * s (r, ports - 1) *
214  s (ports - 1, c) / (1.0 - g * s (ports - 1, ports - 1)));
215  }
216  }
217  return res;
218 }
219 
220 /* This function expands the actual noise correlation matrix to have an
221  additional reference one-port whose S-parameter is -1
222  (i.e. ground). The given S-parameter matrix is required to perform
223  this transformation and is obtained using the expandSParaMatrix()
224  function. */
225 matrix spfile::expandNoiseMatrix (matrix n, matrix s) {
226  assert (s.getCols () == s.getRows () && n.getCols () == n.getRows () &&
227  n.getCols () == s.getCols () - 1);
228  nr_double_t T = getPropertyDouble ("Temp");
229  int r, c, ports = n.getCols () + 1;
230  nr_double_t g = -1;
231 
232  // create K matrix
233  matrix k (ports, ports - 1);
234  for (r = 0; r < ports - 1; r++) {
235  for (c = 0; c < ports - 1; c++) {
236  if (r == c)
237  k.set (r, c, 1.0 + g * (s.get (r, ports - 1) - 1.0));
238  else
239  k.set (r, c, g * s.get (r, ports - 1));
240  }
241  }
242  for (c = 0; c < ports - 1; c++)
243  k.set (ports - 1, c, g * s.get (ports - 1, ports - 1) - 1.0);
244 
245  // create D vector
246  matrix d (ports, 1);
247  for (r = 0; r < ports - 1; r++) d.set (r, 0, s.get (r, ports - 1));
248  d.set (ports - 1, 0, s.get (ports - 1, ports - 1) - 1.0);
249 
250  // expand noise correlation matrix
251  matrix res (ports);
252  res = (k * n * adjoint (k) - kelvin (T) / T0 * fabs (1 - norm (g)) *
253  d * adjoint (d)) * norm (1 / (1 - g));
254  return res;
255 }
256 
257 /* The function is the counterpart of the above expandNoiseMatrix()
258  function. It shrinks the noise correlation matrix by removing the
259  reference port. The given S-parameter matrix is required to perform
260  this transformation and is obtained using the expandSParaMatrix()
261  function. */
262 matrix spfile::shrinkNoiseMatrix (matrix n, matrix s) {
263  assert (s.getCols () == s.getRows () && n.getCols () == n.getRows () &&
264  n.getCols () == s.getCols () && n.getCols () > 0);
265  int r, ports = n.getCols ();
266  nr_double_t g = -1;
267  nr_double_t T = getPropertyDouble ("Temp");
268 
269  // create K' matrix
270  matrix k (ports - 1, ports);
271  for (r = 0; r < ports - 1; r++) k.set (r, r, 1);
272  for (r = 0; r < ports - 1; r++)
273  k.set (r, ports - 1, g * s.get (r, ports - 1) /
274  (1.0 - g * s.get (ports - 1, ports - 1)));
275 
276  // create D' vector
277  matrix d (ports - 1, 1);
278  for (r = 0; r < ports - 1; r++) d.set (r, 0, s.get (r, ports - 1));
279 
280  // shrink noise correlation matrix
281  matrix res (ports - 1);
282  res = k * n * adjoint (k) + kelvin (T) / T0 * fabs (1.0 - norm (g)) /
283  norm (1.0 - g * s.get (ports - 1, ports - 1)) * d * adjoint (d);
284  return res;
285 }
286 
287 void spfile::prepare (void) {
288 
289  // check type of data
290  char * type = getPropertyString ("Data");
291  if (!strcmp (type, "rectangular")) {
292  // rectangular data
294  }
295  else if (!strcmp (type, "polar")) {
296  // polar data
298  }
299 
300  // check type of interpolator
301  type = getPropertyString ("Interpolator");
302  if (!strcmp (type, "linear")) {
304  }
305  else if (!strcmp (type, "cubic")) {
307  }
308 
309  // load S-parameter file
310  char * file = getPropertyString ("File");
311  if (data == NULL) data = dataset::load_touchstone (file);
312  if (data != NULL) {
313  // determine the number of ports defined by that file
314  int ports = (int) std::sqrt ((double) data->countVariables ());
315  if (ports == getSize () - 1) {
316  if (spara == NULL) {
317  // find matrix vector entries in touchstone dataset
318  createIndex ();
319  }
320  if (sfreq == NULL) {
321  logprint (LOG_ERROR, "ERROR: file `%s' contains no `frequency' "
322  "vector\n", file);
323  }
324  }
325  else {
326  logprint (LOG_ERROR, "ERROR: file `%s' specifies a %d-port, `%s' "
327  "requires a %d-port\n", file, ports, getName (),
328  getSize () - 1);
329  }
330  }
331 }
332 
333 void spfile::initSP (void) {
334  // allocate S-parameter matrix
335  allocMatrixS ();
336  // initialize data
337  prepare ();
338 }
339 
340 /* The function creates an additional data vector for the given matrix
341  entry and adds it to the dataset. */
342 void spfile::createVector (int r, int c) {
343  int i = r * getSize () + c;
344  spara[i].r = r;
345  spara[i].c = c;
346  qucs::vector * v = new qucs::vector (matvec::createMatrixString ("S", r, c),
347  sfreq->getSize ());
348  v->setDependencies (new strlist ());
349  v->getDependencies()->add (sfreq->getName ());
350  data->addVariable (v);
351  spara[i].v = v;
352 }
353 
354 /* This function goes through the dataset stored within the original
355  touchstone file and looks for the S-parameter matrices and
356  frequency vector. It also tries to find the noise parameter
357  data. */
358 void spfile::createIndex (void) {
359  qucs::vector * v; int s = getSize (); char * n;
360  int r, c, i;
361 
362  // go through list of dependency vectors and find frequency vectors
363  for (v = data->getDependencies (); v != NULL; v = (::vector *) v->getNext ()) {
364  if ((n = v->getName ()) != NULL) {
365  if (!strcmp (n, "frequency")) sfreq = v;
366  else if (!strcmp (n, "nfreq")) nfreq = v;
367  }
368  }
369 
370  // create vector index
371  spara = new spfile_vector[s * s] ();
372 
373  // go through list of variable vectors and find matrix entries
374  for (v = data->getVariables (); v != NULL; v = (::vector *) v->getNext ()) {
375  if ((n = matvec::isMatrixVector (v->getName (), r, c)) != NULL) {
376  // save matrix vector indices
377  i = r * s + c;
378  spara[i].r = r;
379  spara[i].c = c;
380  spara[i].prepare (v, sfreq, false, interpolType, dataType);
381  paraType = n[0]; // save type of touchstone data
382  free (n);
383  }
384  if ((n = v->getName ()) != NULL) {
385  // find noise parameter vectors
386  if (!strcmp (n, "Rn")) {
387  RN = new spfile_vector ();
388  RN->prepare (v, nfreq, true, interpolType, dataType);
389  }
390  else if (!strcmp (n, "Fmin")) {
391  FMIN = new spfile_vector ();
392  FMIN->prepare (v, nfreq, true, interpolType, dataType);
393  }
394  else if (!strcmp (n, "Sopt")) {
395  SOPT = new spfile_vector ();
396  SOPT->prepare (v, nfreq, false, interpolType, dataType);
397  }
398  }
399  }
400 }
401 
402 /* This function computes the noise correlation matrix of a twoport
403  based upon the noise parameters and the given S-parameter
404  matrix. */
405 matrix spfile::correlationMatrix (nr_double_t Fmin, nr_complex_t Sopt,
406  nr_double_t Rn, matrix s) {
407  assert (s.getCols () == s.getRows () && s.getCols () == 2);
408  matrix c (2);
409  nr_complex_t Kx = 4 * Rn / z0 / norm (1.0 + Sopt);
410  c.set (0, 0, (Fmin - 1) * (norm (s.get (0, 0)) - 1) +
411  Kx * norm (1.0 - s.get (0, 0) * Sopt));
412  c.set (1, 1, norm (s.get (1, 0)) * ((Fmin - 1) + Kx * norm (Sopt)));
413  c.set (0, 1, s.get (0, 0) / s.get (1, 0) * c.get (1, 1) -
414  conj (s.get (1, 0)) * conj (Sopt) * Kx);
415  c.set (1, 0, conj (c.get (0, 1)));
416  return c;
417 }
418 
419 /* The function computes the noise figure and noise parameters for the
420  given S-parameter and noise correlation matrices of a twoport. */
421 nr_double_t spfile::noiseFigure (matrix s, matrix c, nr_double_t& Fmin,
422  nr_complex_t& Sopt, nr_double_t& Rn) {
423  assert (s.getCols () == s.getRows () && c.getCols () == c.getRows () &&
424  s.getCols () == 2 && c.getCols () == 2);
425  nr_complex_t n1, n2;
426  n1 = c.get (0, 0) * norm (s.get (1, 0)) -
427  2 * real (c.get (0, 1) * s.get (1, 0) * conj (s.get (0, 0))) +
428  c.get (1, 1) * norm (s.get (0, 0));
429  n2 = 2.0 * (c.get (1, 1) * s.get (0, 0) -
430  c.get (0, 1) * s.get (1, 0)) / (c.get (1, 1) + n1);
431 
432  // optimal source reflection coefficient
433  Sopt = 1 - norm (n2);
434  if (real (Sopt) < 0.0)
435  Sopt = (1.0 + std::sqrt (Sopt)) / n2; // avoid a negative radicant
436  else
437  Sopt = (1.0 - std::sqrt (Sopt)) / n2;
438 
439  // minimum noise figure
440  Fmin = real (1.0 + (c.get (1, 1) - n1 * norm (Sopt)) /
441  norm (s.get (1, 0)) / (1.0 + norm (Sopt)));
442 
443  // equivalent noise resistance
444  Rn = real ((c (0, 0) - 2.0 *
445  real (c (0, 1) * conj ((1.0 + s (0, 0)) / s (1, 0))) +
446  c (1, 1) * norm ((1.0 + s (0, 0)) / s (1, 0))) / 4.0);
447  Rn = Rn * z0;
448 
449  // noise figure itself
450  return real (1.0 + c.get (1, 1) / norm (s.get (1, 0)));
451 }
452 
453 void spfile::initDC (void) {
454  // get appropriate property value
455  char * dc = getPropertyString ("duringDC");
456 
457  // a short during DC including the reference node
458  if (!strcmp (dc, "shortall")) {
459  int v, n, lastnode = getSize () - 1;
460  setVoltageSources (lastnode);
461  allocMatrixMNA ();
462  // place zero voltage sources
463  for (v = VSRC_1, n = NODE_1; n < lastnode; n++, v++) {
464  voltageSource (v, n, lastnode);
465  }
466  return;
467  }
468  // a short during DC excluding the reference node
469  if (!strcmp (dc, "short")) {
470  int v, n, lastnode = getSize () - 2;
471  setVoltageSources (lastnode);
472  allocMatrixMNA ();
473  // place zero voltage sources
474  for (v = VSRC_1, n = NODE_1; n < lastnode; n++, v++) {
475  voltageSource (v, n, lastnode);
476  }
477  return;
478  }
479  // an open during DC
480  else if (!strcmp (dc, "open")) {
481  setVoltageSources (0);
482  allocMatrixMNA ();
483  return;
484  }
485  // none specified, DC value of IDFT ?
486  else {
487  setVoltageSources (0);
488  allocMatrixMNA ();
489  }
490 }
491 
492 void spfile::initAC (void) {
493  setVoltageSources (0);
494  allocMatrixMNA ();
495  initSP ();
496 }
497 
498 void spfile::calcAC (nr_double_t frequency) {
499  // nothing to do if the given file type had errors
500  if (spara == NULL || sfreq == NULL) return;
501  // calculate interpolated S-parameters
502  calcSP (frequency);
503  // convert S-parameters to Y-parameters
504  setMatrixY (stoy (getMatrixS ()));
505 }
506 
507 void spfile::calcNoiseAC (nr_double_t frequency) {
508  // nothing to do if the given file type had errors
509  if (spara == NULL || nfreq == NULL) return;
510  setMatrixN (cstocy (calcMatrixCs (frequency), getMatrixY () * z0) / z0);
511 }
512 
513 void spfile::initTR (void) {
514  initDC ();
515 }
516 
517 // properties
518 PROP_REQ [] = {
519  { "File", PROP_STR, { PROP_NO_VAL, "spfile.snp" }, PROP_NO_RANGE },
520  PROP_NO_PROP };
521 PROP_OPT [] = {
522  { "Data", PROP_STR, { PROP_NO_VAL, "polar" },
523  PROP_RNG_STR2 ("rectangular", "polar") },
524  { "Interpolator", PROP_STR, { PROP_NO_VAL, "linear" },
525  PROP_RNG_STR2 ("linear", "cubic") },
526  { "Temp", PROP_REAL, { 26.85, PROP_NO_STR }, PROP_MIN_VAL (K) },
527  { "duringDC", PROP_STR, { PROP_NO_VAL, "open" },
528  PROP_RNG_STR4 ("open", "short", "shortall", "unspecified") },
529  PROP_NO_PROP };
530 struct define_t spfile::cirdef =
531  { "SPfile",
#define DATA_REAL
Definition: interpolator.h:40
void add(char *)
Definition: strlist.cpp:65
std::complex< nr_double_t > nr_complex_t
Definition: complex.h:31
void prepare(qucs::vector *, qucs::vector *, bool, int, int)
Definition: spfile.cpp:54
#define REPEAT_NO
Definition: interpolator.h:33
void calcNoiseSP(nr_double_t)
Definition: spfile.cpp:144
matrix adjoint(matrix a)
adjoint matrix
Definition: matrix.cpp:522
qucs::vector * v
Definition: spfile.h:46
matrix ytos(matrix y, qucs::vector z0)
Admittance matrix to scattering parameters.
Definition: matrix.cpp:1133
qucs::matrix calcMatrixCs(nr_double_t)
Definition: spfile.cpp:150
matrix real(matrix a)
Real part matrix.
Definition: matrix.cpp:568
PROP_REQ[]
Definition: spfile.cpp:518
#define T0
standard temperature
Definition: constants.h:61
qucs::vector * getVariables(void)
Definition: dataset.h:63
#define kelvin(x)
Definition: constants.h:108
int getSize(void) const
Definition: vector.cpp:192
#define PROP_DEF
Definition: netdefs.h:189
#define PROP_RNG_STR2(s1, s2)
Definition: netdefs.h:145
nr_double_t getPropertyDouble(const char *)
Definition: object.cpp:176
spfile_vector * FMIN
Definition: spfile.h:86
qucs::matrix expandNoiseMatrix(qucs::matrix, qucs::matrix)
Definition: spfile.cpp:225
#define PROP_REAL
Definition: netdefs.h:174
void initDC(void)
Definition: spfile.cpp:453
int dataType
Definition: spfile.h:89
~spfile_vector()
Definition: spfile.cpp:49
PROP_OPT[]
Definition: spfile.cpp:521
#define PROP_NO_PROP
Definition: netdefs.h:122
void setVoltageSources(int)
Definition: circuit.cpp:607
#define K
Absolute 0 in centigrade.
Definition: constants.h:59
#define PROP_NO_RANGE
Definition: netdefs.h:126
int countVariables(void)
Definition: dataset.cpp:301
void initTR(void)
Definition: spfile.cpp:513
#define PROP_NO_STR
Definition: netdefs.h:125
void allocMatrixS(void)
Definition: circuit.cpp:251
n
Definition: parse_citi.y:147
void prepare(void)
Definition: spfile.cpp:287
#define PROP_LINEAR
Definition: netdefs.h:120
static const nr_double_t z0
Definition: circuit.h:320
r
Definition: parse_mdl.y:515
#define DATA_POLAR
Definition: interpolator.h:37
object * getNext(void)
Definition: object.h:59
matrix getMatrixY(void)
Definition: circuit.cpp:696
int getSize(void)
Get the number of ports the circuit element has.
Definition: circuit.h:143
#define PROP_NODES
Definition: netdefs.h:121
matrix htos(matrix h, nr_complex_t z1, nr_complex_t z2)
Converts hybrid matrix to scattering parameters.
Definition: matrix.cpp:1307
void print(void)
Definition: dataset.cpp:331
#define DATA_RECTANGULAR
Definition: interpolator.h:36
void setDependencies(strlist *)
Definition: vector.cpp:143
#define VSRC_1
Definition: circuit.h:40
i
Definition: parse_mdl.y:516
n2
Definition: parse_zvr.y:187
qucs::matrix expandSParaMatrix(qucs::matrix)
Definition: spfile.cpp:164
nr_complex_t sqrt(const nr_complex_t z)
Compute principal value of square root.
Definition: complex.cpp:271
#define INTERPOL_LINEAR
Definition: interpolator.h:29
matrix stoy(matrix s, qucs::vector z0)
Scattering parameters to admittance matrix.
Definition: matrix.cpp:1082
qucs::matrix correlationMatrix(nr_double_t, nr_complex_t, nr_double_t, qucs::matrix)
Definition: spfile.cpp:405
#define INTERPOL_CUBIC
Definition: interpolator.h:30
#define PROP_COMPONENT
Definition: netdefs.h:116
char paraType
Definition: spfile.h:88
matrix ztos(matrix z, qucs::vector z0)
Convert impedance matrix scattering parameters.
Definition: matrix.cpp:1018
free($1)
x
Definition: parse_mdl.y:498
void setMatrixY(matrix)
Definition: circuit.cpp:685
spfile_vector * RN
Definition: spfile.h:85
void createVector(int, int)
Definition: spfile.cpp:342
spfile_vector * SOPT
Definition: spfile.h:87
#define PROP_RNG_STR4(s1, s2, s3, s4)
Definition: netdefs.h:149
isreal
Definition: parse_vcd.y:337
void calcAC(nr_double_t)
Definition: spfile.cpp:498
void addVariable(qucs::vector *)
Definition: dataset.cpp:153
matrix cstocy(matrix cs, matrix y)
Converts S-parameter noise correlation matrix to admittance noise correlation matrix.
Definition: matrix.cpp:1430
void setMatrixS(matrix)
Definition: circuit.cpp:643
type
Definition: parse_vcd.y:164
matrix getMatrixS(void)
Definition: circuit.cpp:654
void calcSP(nr_double_t)
Definition: spfile.cpp:103
#define PROP_MIN_VAL(k)
Definition: netdefs.h:133
spfile_vector * spara
Definition: spfile.h:84
int interpolType
Definition: spfile.h:90
qucs::matrix shrinkNoiseMatrix(qucs::matrix, qucs::matrix)
Definition: spfile.cpp:262
v
Definition: parse_zvr.y:141
n1
Definition: parse_zvr.y:179
void allocMatrixMNA(void)
Definition: circuit.cpp:267
nr_double_t norm(const nr_complex_t z)
Compute euclidian norm of complex number.
Definition: complex.cpp:283
void initAC(void)
Definition: spfile.cpp:492
nr_complex_t interpolate(nr_double_t)
Definition: spfile.cpp:71
#define PROP_STR
Definition: netdefs.h:175
List int
Definition: parse_citi.y:183
~spfile()
Definition: spfile.cpp:89
matrix gtos(matrix g, nr_complex_t z1, nr_complex_t z2)
Definition: matrix.cpp:1355
#define NODE_1
Definition: circuit.h:34
qucs::matrix getInterpolMatrixS(nr_double_t)
Definition: spfile.cpp:115
void voltageSource(int, int, int, nr_double_t value=0.0)
Definition: circuit.cpp:748
void setMatrixN(matrix)
Definition: circuit.cpp:664
qucs::dataset * data
Definition: spfile.h:81
#define LOG_ERROR
Definition: logging.h:28
char * getName(void)
Definition: object.cpp:84
void calcNoiseAC(nr_double_t)
Definition: spfile.cpp:507
void createIndex(void)
Definition: spfile.cpp:358
matrix conj(matrix a)
Conjugate complex matrix.
Definition: matrix.cpp:505
#define PROP_NO_VAL
Definition: netdefs.h:124
void initSP(void)
placehoder for S-Parameter initialisation function
Definition: spfile.cpp:333
qucs::vector * nfreq
Definition: spfile.h:83
nr_double_t noiseFigure(qucs::matrix, qucs::matrix, nr_double_t &, nr_complex_t &, nr_double_t &)
Definition: spfile.cpp:421
qucs::vector * getDependencies(void)
Definition: dataset.h:62
char * getPropertyString(const char *)
Definition: object.cpp:159
void logprint(int level, const char *format,...)
Definition: logging.c:37
qucs::vector * sfreq
Definition: spfile.h:82
strlist * getDependencies(void)
Definition: vector.cpp:138
#define DATA_COMPLEX
Definition: interpolator.h:39
#define PROP_NO_SUBSTRATE
Definition: netdefs.h:118
data
Definition: parse_citi.y:117
void setFile(const char *)
Definition: dataset.cpp:323
qucs::matrix shrinkSParaMatrix(qucs::matrix)
Definition: spfile.cpp:204