ГОСТ Р ИСО/МЭК 10373-6—2015
int fiag-0;
double
dill;
ESL ’new;
double v;
double L;
int crosscounter-O;
int locat_inaex-0;
int locat indexstart-0;
while (env|locat_inaex]--0.0] // Leaves Os out
local_.ndex--;
locat_inaex_3tatt-locat_moex;
it (env|local index]-target>0)
(
for (loeat_lndex~locet._index_starr.;
locat_lndex<env_length»-locet_index_siert-i;local indext*)
l
dilf-er.vIiocat_lndex)-target;
i
t
•after en odd occurrence,
ii flag— 0 sv env[locat_index]l-O.C) // At the beginning or
envelope is over "target" leveL
0
f
flag-1; // down!
v - t a ig e t ;
•-toutput locat_mdex-l‘-((toutput’loc«t_-ndex -toutput’local_
index-i])/{envflocat_index1-env[loca*._index-1])*Rarget-env]loea»._tndex-l]));
new-createnodef(v,t);
msert_node(crosses,new);
crosscounter
I
if (dilf>0 bi flag— 1 ы env(locat_lndexI1-0.0) // After first (or ever.)
occurrence, envelope is under "target" level
I
Ilag- ; // up!
v-target;
t-iouiput‘loftatindex-1*-((toutput.-ocat-ndex -toutput!local_
index-1])/(env(loeatindex]-envllocat_index-l1)*(terget.-env[locrat_index-11));
new-createnodef(v,U;
insert_node(crosses,new);
crosscounter-
1
// Returns all occ-rrences with time and volt level in a list
e ls e
Ipr-ntr(stdout,"S-gna. is not -- --- -- \n");
return (crosscounter) ;
П
A lso retu rns how many occurrences appeared
! /
Funct ton th at c a lc u la te s the relevan t t Lmes
void (.finder (char type, double *env, double ‘ toutput, double t l n l , double Hmax, double
Hmin, int ra te , in*. env_length, TIMES ‘ t.imeres)
l
double »envc-KCLL;
double ‘ enve2-NCLL;
ESL ‘ crosses-S’CLL;
ESL *cr03ses2-NELL;
ESL ‘ crossesi-NL’LL;
ESL *cr osses_WORK-NL’LL;
double n m e ty -0 .0 ;
double live-0 .0 ;
72