ГОСТ Р 56047—2014
«include <fftw.h>
«include <comnxjn.h>
«include <harmstruct.h>
extern char ’filetest;
extern int count;
extern fftw_plan plan2;
double Cffl[HAN№2J:
int maxk;
double
harmstruct(double ’ffttest. double ‘fftref. double ’EHStmp. int rate,
double ’Cffttmp, int p. int *n)
{
int k. i;
double F0[HANN/2], C(HANN/2], hannwin[HANN/2];
double num. denoma. denomb. Csum = 0;
fft\v_complex in[HANN/2], out[HANN,’2];
double max;
bzero(Cfft. 8 ’ HANN/2);
for(k=0;k<p*2-1;k++){
if(!fftreflk] || !ffttest|k|) { II skip log<0)
«if defined(SKIPFRAME) && !defined(ZERO)
( ’ n b :
return 0;
«elif defined(ZERO)
if(!fftref[kj) {
fftreflk] = ZERO;
«ifdef DEBUG
debug("Warning [%s:%d] in Harmstruct.c: “
*fftrefl%d] is set around zeroVi*.
filetest, count, k, fftreflk]);
#endif
}
if(!ffttest[k]> {
ffttest(k] = ZERO;
«ifdef DEBUG
debug("Warning [%s:%d] in Harmstruct.c; "
*ffttest(%d] is set around zero\n",
filetest. count, k. ffttest(kj);
«endrf
}
F0[kj = Iog10(p<fftreflk]. 2.0)) - Iog10{p{ffttest[k]. 2.0));
«else
if(!fftreflk] && !ffttest[k]>
F0[kj = 0;
else {
«ifdef DEBUG
debug(”Error (%s;%d] in Harmstmct.c: “
*log(fftref[%d] = %g log(ffttestl%d] = %g\n“.
filetest. count, k. fftreflk], k. ffttestlk]);
«endif
FOlk] = 0;
}
«endif
}
else
FOlk] = log10(p<fftreflk], 2.0)) - Iog10(p(ffitest[k}. 2.0));
}
for(i=0;i<p:i++) {
num = 0;
74