ГОСТ Р ИСО/МЭК 10373-6—2015
/* Note: (vtiine|2)-vtime|l]> is the scope sample rate */
start-center - (ml) N_nata ! 2;
ОГТ ********************************/
tor(i-Q;i<-K nata-l;i*»>
i
l* Bartlett winnow */
i t ( (N data
и
1> — C>
(
/* Ndata is even V
it (I < (Hit) N_data /2)
l
Wb-2.0F*i/(doubie) (N_da».a - 1);
)
else
l
Mb-2.0F*(N d a ta -i-1 ) / (douhle) (N d a ta - 1 );
I
)
else
{
/♦Ndat.a is Odd */
it 11 < (lilt) N_dsta /2 )
l
Wb-2.OF*1/(double)IN data - 1);
I
else
l
Mb-2.0F-2.OF*1/(double)<N dat* - 1);
I
I
k-i«start;
cU_real-cO_real*vdlk)*(double)cos(w0«vtime|k))*Wb;
c0_i№ag-c0_imag*villkj*(double)sin(wC*vtime[k)>*Wb;
cl_real-cl_real*vdlkl*(double)cos(wu’vtime[k];*Wb;
cl_imag-cl_unag*vd!k]*(double)sm(wu’vtimeIkJ>*Wb;
c2_real-c2_real»vdik)*(double)cos(wl’vtime|k);*Wb;
c2_imag-c2 -imag*vd|kl*(double)sm(wl*vtime|k)>*Wb;
/*****•************* OFT scale ***************************/
cU_real-4.0F*c0_real/(double) N_aata;
cO_imag-4.GF*cO_imag/(double) Kdata;
cl_real-4.0F*cl_real/(double) K_aata;
cl_imag-4.GF*cl_imag/(double) Kdata;
c2_real-4.0F’c2_real/(double) K_data;
c2_imag-4.GF*c2_imag/(double) N_uata?
/* Note: •).OF includes the correction coet. ol the bartlett winnow »/
absolute to u n e r coefficient ••***•****/
cO abs-(double)sqrt (cO
_
real*cO
_
reai » cO
_
mag*cO
_
imag>;
c l abs-(double;3qrt (cl
_
re a l*cl
_
re a l * cl
_
im ag*el
_
im ag);
c2
_
abs-(double)sqrt (c2
_
teal*c2
_
teal*c2
_
imag*c2
_
imag);
/« **« •**•**••» * phase ot to u n e r coefficient **********/
c
0
_
phase-(double)atan2(c0
_
im ag,cOreal};
cl phase-(double) atan2 (clim a g , c l re a l)