ГОСТ Р 56047—2014
Ipref = LevelPression(fileref);
Iptest = LevelPression(frletest);
I* Init routines */
II make Hann Window (2.1.3)
{
int k;
for(k=0;k<HANN;k++)
hannwindow(k] = 0.5‘sqrt((double)8/3)’
(1 - cos((double)2*M_PI*k/(HANN -1)));
}
II make Bark tables (2.1.5)
{
intk;
double zL. zU:
double *zl. *zc, *zu;
zL = B(Flow);
zU = B(Fup);
bark = ceil((zU - zL) / dz);
fL = (double *)malloc(bark * sizeof(double)):
fC = (double *)malloc(bark * sizeof(double)):
fU = (double *)malloc(bark * sizeof(double)):
zl = (double *)malloc(bark * sizeof(double));
zc = (double *)malloc(bark * sizeof(double));
zu = (double *)malk>c(bark * sizeof(double));
assert(fL != NULL && fC != NULL && fU != NULL && zl != NULL
&& zc != NULL && zu != NULL);
for(k=0;k<bark;k++) {
zl[k] = zL + k*dz:
zu[k) = zL+ (k+1)*dz;
zc[k] = 0.5 * (zl(kl + zu(k]);
}
zu[bark-1] = zU;
zc[bark -1J = 0.5 * (zl(bark-1) + zu(bark-1));
for(k=0;k<bark;k++) {
fL[k] = Bl(zl(k]):
fU[k) = Bl(zu[kj);
fC[k] = Bl(zc[k]);
}
free(zl);
free(zu):
free(zc);
}
II Initialize temp var
memset(&levinch1. 0x00. sizeof(struct levpatadaptin)):
memset(&levinch2. 0x00. sizeof(struct levpatadaptin));
memset(&modintestch1. 0x00. sizeof(struct modulation^));
memset(&modintestch2. 0x00, sizeof(struct modulationin)):
memset(&modinrefch1.0x00. sizeof(struct modulationin));
memset(&modinrefch2. 0x00. sizeof(struct modulationin));
memset(Etesttmpch1. 0x00. BARK * sizeof(double));
memset(Etesttmpch2. 0x00. BARK * sizeof(double));
memset(Ereflmpch1. 0x00. BARK ’ sizeof(double));
memset(Ereftmpch2. 0x00. BARK ’ sizeof(double));
memset(Cffttmpch1.0x00. (HANN/2) * sizeof(double));
memset(Cffttmpch2, 0x00, (HANN.f2) * sizeof(double));
53