FACT++
1.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
static void DrsCalibrate::RemoveSpikes2
(
float *
p
,
uint32_t
roi
)
inline
static
Definition at line
587
of file
DrsCalib.h
.
References
i
.
588
{
589
if
(roi<4)
590
return
;
591
592
std::vector<float> Ameas(p, p+roi);
593
594
std::vector<float> diff(roi);
595
for
(
size_t
i
=1;
i
<roi-1;
i
++)
596
diff[
i
] = (p[
i
-1] + p[
i
+1])/2 - p[
i
];
597
598
//std::vector<float> N1mean(roi);
599
//for (size_t i=1; i<roi-1; i++)
600
// N1mean[i] = (p[i-1] + p[i+1])/2;
601
602
const
float
fract = 0.8;
603
604
for
(
size_t
i
=0;
i
<roi-3;
i
++)
605
{
606
if
(diff[
i
]<5)
607
continue
;
608
609
if
(Ameas[
i
+2] - (Ameas[
i
] + Ameas[
i
+3])/2 > 10)
610
{
611
p[
i
+1]= (Ameas[
i
+3] - Ameas[
i
])/3 + Ameas[
i
];
612
p[
i
+2]= 2*(Ameas[
i
+3] - Ameas[
i
])/3 + Ameas[
i
];
613
614
i
+= 3;
615
616
continue
;
617
}
618
619
if
( (diff[
i
+1]<-diff[
i
]*fract*2) && (diff[
i
+2]>10) )
620
{
621
p[
i
+1] = (Ameas[
i
]+Ameas[
i
+2])/2;
622
diff[
i
+2] = (p[
i
+1] + Ameas[
i
+3])/2 - Ameas[
i
+2];
623
624
i
+= 2;
625
}
626
627
// const float x = Ameas[i] - N1mean[i];
628
// if (x > -5.)
629
// continue;
630
631
// if (Ameas[i+2] - (Ameas[i] + Ameas[i+3])/2. > 10.)
632
// {
633
// p[i+1]= (Ameas[i+3] - Ameas[i])/3 + Ameas[i];
634
// p[i+2]= 2*(Ameas[i+3] - Ameas[i])/3 + Ameas[i];
635
// i += 3;
636
// continue;
637
// }
638
639
// const float xp = Ameas[i+1] - N1mean[i+1];
640
// const float xpp = Ameas[i+2] - N1mean[i+2];
641
642
// if ( (xp > -2.*x*fract) && (xpp < -10.) )
643
// {
644
// p[i+1] = N1mean[i+1];
645
// N1mean[i+2] = Ameas[i+1] - Ameas[i+3]/2;
646
//
647
// i += 2;
648
// }
649
}
650
}
i
int i
Definition:
db_dim_client.c:21
DrsCalibrate
Generated on Sun Sep 18 2016 20:50:49 for FACT++ by
1.8.11