ГОСТ Р 56047—2014
for(k=0;k<bark:k++) {
m l =М1;
m2 = М2;
pattcoefftest = 0;
pattcoeffref = 0;
if(m1 > к)
m l = к;
if(m2 > bark -k-1)
m2 = bark -k -1;
for(i = -m1;i <= m2:i++) {
pattcoefftest += Rtest(k+i]:
pattcoeffref += Rreflk+i]:
}
tmp->PattCorrTestlk) = a[k]’tmp->PattCorrTest(k) +
pattcoefftest*{1.0-a[k])/(m1+m2+1);
tmp->PattCorrRef[k] = alk]’tmp->PattCorrRef[k] +
pattcoeffref*(1.0-a[k)V(m1 +m2+1);
out.Epref[k) = Elr©f[k] ’ tmp->PattCorrReflk];
out.Eptestlk] = Eltestjk] * tmp->PattCorrTest[k];
}
return out;
}
Файл: loudness.h
«define CONST 1.07664
Г Function prototypes 7
double loudness<double *);
/* Prototypes end V
Файл: loudness.c
«include <stdlib.h>
«include <math.h>
«include <common.h>
«include <loudness.h>
extern double ’fC;
extern int bark:
double
toodness(double *E>
{
int k:
double Ntot = 0;
double s. N. Ethres;
for(k=0;k<bark:k++) {
s = p(10.0. (-2.0-2.05‘atan((double)fC[ky4000.0) - 0.75
*atan((double)p<fC[kl/1600.0. 2.0)))/10.0);
Ethres = p(10.0. 0.364’p(fC[kJ/1000.0. -0.8));
N = (double)CONST*p(Ethres/(s*10000.0). 0.23)
*(p(1.0-s+s*E(kyEthres. 0.23)-1.0);
if(N > 0)
Ntot += N;
}
Ntot ’= (double)24.0/bark;
return Ntot;
}
78