1189 for (
int i=0;i!=nbin;i++){
1190 int x = signal.at(i);
1194 s.push_back( (x & 1));
1214 if (nshift!=0 && nshift < 11){
1216 ADC_bit_shifts.first = nshift;
1217 ADC_bit_shifts.second = nshift;
1219 ret[
"ADCBitShift"][ch].push_back(ADC_bit_shifts);
1222 const int nl = signal.size();
1223 std::vector<int>
x(nl,0), x_orig(nl,0);
1224 for (
int i=0;i!=
nl;i++){
1225 x_orig[i] = signal.at(i);
1226 x[i] = signal.at(i);
1229 std::set<int> fillings;
1232 for (
int i=0;i!=
nl;i++){
1235 fillings.insert(filling);
1247 int prev1_bin_content =
mean;
1248 int prev_bin_content =
mean;
1249 int next_bin_content =
mean;
1250 int next1_bin_content =
mean;
1251 int curr_bin_content;
1253 for (
int i=0;i<
nl;i=i+1){
1254 curr_bin_content = x[i];
1256 if (
abs(curr_bin_content-mean)>exp_diff &&
1257 (
abs(curr_bin_content - prev_bin_content) > exp_diff ||
1258 abs(curr_bin_content - next_bin_content) > exp_diff)
1260 int exp_value = ( (2*prev_bin_content - prev1_bin_content) +
1261 (prev_bin_content + next_bin_content)/2. +
1262 (prev_bin_content * 2./3. + next1_bin_content/3.))/3.;
1263 for (
auto it = fillings.begin(); it!=fillings.end(); it++){
1266 if (fabs(y-exp_value) < fabs(x[i] - exp_value)){
1272 prev1_bin_content = prev_bin_content;
1273 prev_bin_content = x[i];
1275 next_bin_content = x[i+2];
1277 next_bin_content =
mean;
1280 next1_bin_content = x[i+3];
1282 next1_bin_content =
mean;
1287 for (
int i=0;i!=
nl;i++){
1288 signal.at(i) = x[i];
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
int lowest_bits(int value, int n)
double mean(sqlite3 *db, std::string const &table_name, std::string const &column_name)
std::string nl(std::size_t i=1)
int shift_right(int value, int n, int filling, int totalBit)