56 "GHz",
'S',
"MA", 50.0, 1e9, 0, 0, 0 };
60 "hz",
"khz",
"mhz",
"ghz",
"s",
"y",
"z",
"g",
"h",
"ma",
"db",
"ri", NULL };
71 for (xroot = next; xroot != NULL; xroot =
next) {
74 if ((xroot->
getSize () & 1) == 0) {
96 nr_double_t f =
real (root->
get (0));
99 if ((
size & 1) == 0) {
118 nr_double_t freq =
real (root->
get (0));
134 "decreasing frequency value\n",
noise ?
"noise" :
"data",
144 "%d required\n",
noise ?
"noise" :
"data",
164 if (!strcmp (str,
"hz")) {
168 else if (!strcmp (str,
"khz")) {
172 else if (!strcmp (str,
"mhz")) {
176 else if (!strcmp (str,
"ghz")) {
181 else if (!strcmp (str,
"s")) {
184 else if (!strcmp (str,
"y")) {
187 else if (!strcmp (str,
"z")) {
190 else if (!strcmp (str,
"g")) {
193 else if (!strcmp (str,
"h")) {
197 else if (!strcmp (str,
"ma")) {
200 else if (!strcmp (str,
"db")) {
203 else if (!strcmp (str,
"ri")) {
270 for (
int j = 0; j <
ports; j++) {
271 int pos = 1 + j * 2 +
i * 2 *
ports;
274 if (ports == 2 &&
i != j) {
275 pos = 1 +
i * 2 + j * 2 *
ports;
310 val = (val -
r) / (1.0 - r * val);
327 matrix
s = matrix (ports);
330 for (n = 0; n < len; n++) {
333 for (i = 0; i <
ports; i++) {
334 for (j = 0; j <
ports; j++) {
343 for (i = 0; i <
ports; i++) {
344 for (j = 0; j <
ports; j++) {
345 v->
set (s.get (i, j),
n);
366 for (
int j = 1; j <=
ports; j++) {
375 if (
i == 1 && j == 1)
377 else if (
i == 2 && j == 2)
381 if (
i == 1 && j == 1)
383 else if (
i == 2 && j == 2)
422 int i,
n, errors = 0;
509 return errors ? -1 : 0;
std::complex< nr_double_t > nr_complex_t
qucs::vector * touchstone_vector
matrix real(matrix a)
Real part matrix.
qucs::vector * getVariables(void)
void touchstone_init(void)
static void touchstone_join(void)
strlist * touchstone_idents
nr_complex_t pow(const nr_complex_t z, const nr_double_t d)
Compute power function with real exponent.
static const char * touchstone_valid_options[]
matrix stos(matrix s, qucs::vector zref, qucs::vector z0)
S params to S params.
Global physical constants header file.
void appendVariable(qucs::vector *)
void setDependencies(strlist *)
nr_complex_t sqrt(const nr_complex_t z)
Compute principal value of square root.
void setName(const char *)
int touchstone_lex_destroy(void)
void touchstone_destroy(void)
static char * touchstone_create_set(int r, int c)
static int touchstone_vector_check(void)
static void touchstone_normalize(void)
void set(nr_double_t, int)
Dense matrix class header file.
struct touchstone_t touchstone_options
static void touchstone_normalize_sp(void)
static void touchstone_options_eval(void)
#define rad(x)
Convert degree to radian.
void appendDependency(qucs::vector *)
static void touchstone_finalize(void)
int touchstone_check(void)
nr_complex_t polar(const nr_double_t mag, const nr_double_t ang)
Construct a complex number using polar notation.
qucs::vector * findVariable(const char *)
void logprint(int level, const char *format,...)
static void touchstone_create(void)
dataset * touchstone_result
static char * createMatrixString(const char *, int, int)