13 #include "cetlib_except/exception.h"
14 #include "messagefacility/MessageLogger/MessageLogger.h"
24 unsigned int zerothreshold = 5;
29 unsigned int zerothreshold = 5;
46 unsigned int zerothreshold = 5;
51 unsigned int zerothreshold = 5;
65 unsigned int &zerothreshold)
83 unsigned int &zerothreshold,
102 void Compress(
const boost::circular_buffer<std::vector<short>> &adcvec_neighbors,
103 std::vector<short> &adc,
105 unsigned int &zerothreshold,
106 int &nearestneighbor)
126 unsigned int &zerothreshold,
128 int &nearestneighbor,
129 bool fADCStickyCodeFeature)
134 ZeroSuppression(adc,zerothreshold, pedestal, nearestneighbor, fADCStickyCodeFeature);
136 ZeroSuppression(adc,zerothreshold, pedestal, nearestneighbor, fADCStickyCodeFeature);
147 void Compress(
const boost::circular_buffer<std::vector<short>> &adcvec_neighbors,
148 std::vector<short> &adc,
150 unsigned int &zerothreshold,
152 int &nearestneighbor,
153 bool fADCStickyCodeFeature)
158 ZeroSuppression(adcvec_neighbors,adc,zerothreshold, pedestal, nearestneighbor, fADCStickyCodeFeature);
160 ZeroSuppression(adcvec_neighbors,adc,zerothreshold, pedestal, nearestneighbor, fADCStickyCodeFeature);
174 unsigned int &zerothreshold)
176 const int adcsize = adc.size();
177 const int zerothresholdsigned = zerothreshold;
179 std::vector<short> zerosuppressed(adc.size());
180 int maxblocks = adcsize/2 + 1;
181 std::vector<short> blockbegin(maxblocks);
182 std::vector<short> blocksize(maxblocks);
184 unsigned int nblocks = 0;
185 unsigned int zerosuppressedsize = 0;
189 for(
int i = 0; i < adcsize; ++i){
190 int adc_current_value =
std::abs(adc[i]);
192 if(adc_current_value > zerothresholdsigned){
196 blockbegin[nblocks] = i;
197 blocksize[nblocks] = 0;
201 zerosuppressed[zerosuppressedsize] = adc[i];
202 zerosuppressedsize++;
203 blocksize[nblocks]++;
205 if(i == adcsize-1) nblocks++;
208 if(adc_current_value <= zerothresholdsigned && blockcheck == 1){
209 zerosuppressed[zerosuppressedsize] = adc[i];
210 zerosuppressedsize++;
211 blocksize[nblocks]++;
219 adc.resize(2+nblocks+nblocks+zerosuppressedsize);
226 for(
unsigned int i = 0; i < nblocks; ++i)
227 adc[i+2] = blockbegin[i];
229 for(
unsigned int i = 0; i < nblocks; ++i)
230 adc[i+nblocks+2] = blocksize[i];
232 for(
unsigned int i = 0; i < zerosuppressedsize; ++i)
233 adc[i+nblocks+nblocks+2] = zerosuppressed[i];
244 unsigned int &zerothreshold,
245 int &nearestneighbor)
248 const int adcsize = adc.size();
249 const int zerothresholdsigned = zerothreshold;
251 std::vector<short> zerosuppressed(adcsize);
252 int maxblocks = adcsize/2 + 1;
253 std::vector<short> blockbegin(maxblocks);
254 std::vector<short> blocksize(maxblocks);
257 int zerosuppressedsize = 0;
259 int blockstartcheck = 0;
260 int endofblockcheck = 0;
262 for(
int i = 0; i < adcsize; ++i){
263 int adc_current_value =
std::abs(adc[i]);
265 if(blockstartcheck==0){
266 if(adc_current_value>zerothresholdsigned){
268 if((i-nearestneighbor)<=(blockbegin[nblocks-1]+blocksize[nblocks-1]+1)){
271 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
275 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
276 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
281 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
282 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
287 else if(blockstartcheck==1){
288 if(adc_current_value>zerothresholdsigned){
289 blocksize[nblocks]++;
293 if(endofblockcheck<nearestneighbor){
295 blocksize[nblocks]++;
298 else if(i+2<adcsize){
299 if(
std::abs(adc[i+1]) <= zerothresholdsigned &&
std::abs(adc[i+2]) <= zerothresholdsigned){
311 if(blockstartcheck==1){
315 for(
int i = 0; i < nblocks; ++i)
316 zerosuppressedsize += blocksize[i];
319 adc.resize(2+nblocks+nblocks+zerosuppressedsize);
320 zerosuppressed.resize(2+nblocks+nblocks+zerosuppressedsize);
323 int zerosuppressedcount = 0;
324 for(
int i = 0; i < nblocks; ++i){
326 for(
int j = 0; j < blocksize[i]; ++j){
327 zerosuppressed[zerosuppressedcount] = adc[blockbegin[i] + j];
328 zerosuppressedcount++;
334 for(
int i = 0; i < nblocks; ++i){
335 adc[i+2] = blockbegin[i];
336 adc[i+nblocks+2] = blocksize[i];
341 for(
int i = 0; i < zerosuppressedsize; ++i)
342 adc[i+nblocks+nblocks+2] = zerosuppressed[i];
355 unsigned int &zerothreshold,
357 int &nearestneighbor,
358 bool fADCStickyCodeFeature)
361 const int adcsize = adc.size();
362 const int zerothresholdsigned = zerothreshold;
364 std::vector<short> zerosuppressed(adcsize);
365 int maxblocks = adcsize/2 + 1;
366 std::vector<short> blockbegin(maxblocks);
367 std::vector<short> blocksize(maxblocks);
370 int zerosuppressedsize = 0;
372 int blockstartcheck = 0;
373 int endofblockcheck = 0;
375 for(
int i = 0; i < adcsize; ++i){
378 if(blockstartcheck==0){
379 if(adc_current_value>zerothresholdsigned){
381 if(i-nearestneighbor<=blockbegin[nblocks-1]+blocksize[nblocks-1]+1){
383 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
387 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
388 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
393 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
394 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
399 else if(blockstartcheck==1){
400 if(adc_current_value>zerothresholdsigned){
401 blocksize[nblocks]++;
405 if(endofblockcheck<nearestneighbor){
407 blocksize[nblocks]++;
410 else if(i+2<adcsize){
421 if(blockstartcheck==1){
426 for(
int i = 0; i < nblocks; ++i)
427 zerosuppressedsize += blocksize[i];
430 adc.resize(2+nblocks+nblocks+zerosuppressedsize);
431 zerosuppressed.resize(2+nblocks+nblocks+zerosuppressedsize);
434 int zerosuppressedcount = 0;
435 for(
int i = 0; i < nblocks; ++i){
437 for(
int j = 0; j < blocksize[i]; ++j){
438 zerosuppressed[zerosuppressedcount] = adc[blockbegin[i] + j];
439 zerosuppressedcount++;
445 for(
int i = 0; i < nblocks; ++i){
446 adc[i+2] = blockbegin[i];
447 adc[i+nblocks+2] = blocksize[i];
452 for(
int i = 0; i < zerosuppressedsize; ++i)
453 adc[i+nblocks+nblocks+2] = zerosuppressed[i];
465 void ZeroSuppression(
const boost::circular_buffer<std::vector<short>> &adcvec_neighbors,
466 std::vector<short> &adc,
467 unsigned int &zerothreshold,
468 int &nearestneighbor)
471 const int adcsize = adc.size();
472 const int zerothresholdsigned = zerothreshold;
474 std::vector<short> zerosuppressed(adcsize);
475 const int maxblocks = adcsize/2 + 1;
476 std::vector<short> blockbegin(maxblocks);
477 std::vector<short> blocksize(maxblocks);
480 int zerosuppressedsize = 0;
482 int blockstartcheck = 0;
483 int endofblockcheck = 0;
485 for(
int i = 0; i < adcsize; ++i){
489 int adc_current_value = 0;
491 for(boost::circular_buffer<std::vector<short>>::const_iterator adcveciter = adcvec_neighbors.begin(); adcveciter!=adcvec_neighbors.end();++adcveciter){
492 const std::vector<short> &adcvec_current = *adcveciter;
493 const int adcvec_current_single =
std::abs(adcvec_current[i]);
495 if(adc_current_value < adcvec_current_single){
496 adc_current_value = adcvec_current_single;
500 if(blockstartcheck==0){
501 if(adc_current_value>zerothresholdsigned){
503 if(i-nearestneighbor<=blockbegin[nblocks-1]+blocksize[nblocks-1]+1){
505 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
509 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
510 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
515 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
516 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
521 else if(blockstartcheck==1){
522 if(adc_current_value>zerothresholdsigned){
523 blocksize[nblocks]++;
527 if(endofblockcheck<nearestneighbor){
529 blocksize[nblocks]++;
532 else if(i+2<adcsize){
533 if(
std::abs(adc[i+1]) <= zerothresholdsigned &&
std::abs(adc[i+2]) <= zerothresholdsigned){
544 if(blockstartcheck==1){
550 for(
int i = 0; i < nblocks; ++i)
551 zerosuppressedsize += blocksize[i];
554 adc.resize(2+nblocks+nblocks+zerosuppressedsize);
555 zerosuppressed.resize(2+nblocks+nblocks+zerosuppressedsize);
558 int zerosuppressedcount = 0;
559 for(
int i = 0; i < nblocks; ++i){
561 for(
int j = 0; j < blocksize[i]; ++j){
562 zerosuppressed[zerosuppressedcount] = adc[blockbegin[i] + j];
563 zerosuppressedcount++;
569 for(
int i = 0; i < nblocks; ++i){
570 adc[i+2] = blockbegin[i];
571 adc[i+nblocks+2] = blocksize[i];
576 for(
int i = 0; i < zerosuppressedsize; ++i)
577 adc[i+nblocks+nblocks+2] = zerosuppressed[i];
590 void ZeroSuppression(
const boost::circular_buffer<std::vector<short>> &adcvec_neighbors,
591 std::vector<short> &adc,
592 unsigned int &zerothreshold,
594 int &nearestneighbor,
595 bool fADCStickyCodeFeature)
598 const int adcsize = adc.size();
599 const int zerothresholdsigned = zerothreshold;
601 std::vector<short> zerosuppressed(adcsize);
602 const int maxblocks = adcsize/2 + 1;
603 std::vector<short> blockbegin(maxblocks);
604 std::vector<short> blocksize(maxblocks);
607 int zerosuppressedsize = 0;
609 int blockstartcheck = 0;
610 int endofblockcheck = 0;
612 for(
int i = 0; i < adcsize; ++i){
618 for(boost::circular_buffer<std::vector<short>>::const_iterator adcveciter = adcvec_neighbors.begin(); adcveciter!=adcvec_neighbors.end();++adcveciter){
619 const std::vector<short> &adcvec_current = *adcveciter;
620 const int adcvec_current_single =
std::abs(adcvec_current[i] - pedestal);
622 if(adc_current_value < adcvec_current_single){
623 adc_current_value = adcvec_current_single;
627 if(blockstartcheck==0){
628 if(adc_current_value>zerothresholdsigned){
630 if(i-nearestneighbor<=blockbegin[nblocks-1]+blocksize[nblocks-1]+1){
632 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
636 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
637 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
642 blockbegin[nblocks] = (i - nearestneighbor > 0) ? i - nearestneighbor : 0;
643 blocksize[nblocks] = i - blockbegin[nblocks] + 1;
648 else if(blockstartcheck==1){
649 if(adc_current_value>zerothresholdsigned){
650 blocksize[nblocks]++;
654 if(endofblockcheck<nearestneighbor){
656 blocksize[nblocks]++;
660 else if(i+2<adcsize){
672 if(blockstartcheck==1){
678 for(
int i = 0; i < nblocks; ++i)
679 zerosuppressedsize += blocksize[i];
682 adc.resize(2+nblocks+nblocks+zerosuppressedsize);
683 zerosuppressed.resize(2+nblocks+nblocks+zerosuppressedsize);
686 int zerosuppressedcount = 0;
687 for(
int i = 0; i < nblocks; ++i){
689 for(
int j = 0; j < blocksize[i]; ++j){
690 zerosuppressed[zerosuppressedcount] = adc[blockbegin[i] + j];
691 zerosuppressedcount++;
697 for(
int i = 0; i < nblocks; ++i){
698 adc[i+2] = blockbegin[i];
699 adc[i+nblocks+2] = blocksize[i];
704 for(
int i = 0; i < zerosuppressedsize; ++i)
705 adc[i+nblocks+nblocks+2] = zerosuppressed[i];
717 std::vector<short> &uncompressed)
719 const int lengthofadc = adc[0];
720 const int nblocks = adc[1];
722 uncompressed.resize(lengthofadc);
723 for (
int i = 0;i < lengthofadc; ++i){
727 int zerosuppressedindex = nblocks*2 + 2;
729 for(
int i = 0; i < nblocks; ++i){
731 for(
int j = 0; j < adc[2+nblocks+i]; ++j){
734 uncompressed[adc[2+i]+j] = adc[zerosuppressedindex];
735 zerosuppressedindex++;
746 std::vector<short> &uncompressed,
749 const int lengthofadc = adc[0];
750 const int nblocks = adc[1];
752 uncompressed.resize(lengthofadc);
753 for (
int i = 0;i < lengthofadc; ++i){
754 uncompressed[i] = pedestal;
757 int zerosuppressedindex = nblocks*2 + 2;
759 for(
int i = 0; i < nblocks; ++i){
761 for(
int j = 0; j < adc[2+nblocks+i]; ++j){
764 uncompressed[adc[2+i]+j] = adc[zerosuppressedindex];
765 zerosuppressedindex++;
777 std::vector<short> &uncompressed,
785 std::vector<short> tmp(2*adc[0]);
790 for(
unsigned int i = 0; i < adc.size(); ++i) uncompressed[i] = adc[i];
796 throw cet::exception(
"raw")
797 <<
"raw::Uncompress() does not support compression #"
806 std::vector<short> &uncompressed,
815 std::vector<short> tmp(2*adc[0]);
820 for(
unsigned int i = 0; i < adc.size(); ++i) uncompressed[i] = adc[i];
826 throw cet::exception(
"raw")
827 <<
"raw::Uncompress() does not support compression #"
851 std::vector<short>
const orig_adc(std::move(adc));
855 std::vector<short> diffs;
856 diffs.reserve(orig_adc.size());
857 std::adjacent_difference
858 (orig_adc.begin(), orig_adc.end(), std::back_inserter(diffs));
863 adc.reserve(orig_adc.size());
865 adc.push_back(orig_adc.front());
866 unsigned int curb = 15U;
868 std::bitset<16> bset;
871 for(
size_t i = 1U; i < diffs.size(); ++i){
876 if(i < diffs.size() - 3){
878 if(diffs[i+1] == 0 && diffs[i+2] == 0 && diffs[i+3] == 0){
886 adc.push_back(bset.to_ulong());
905 adc.push_back(bset.to_ulong());
923 adc.push_back(bset.to_ulong());
940 adc.push_back(bset.to_ulong());
955 adc.push_back(bset.to_ulong());
970 adc.push_back(bset.to_ulong());
985 adc.push_back(bset.to_ulong());
1000 adc.push_back(bset.to_ulong());
1015 adc.push_back(bset.to_ulong());
1029 adc.push_back(bset.to_ulong());
1037 if(orig_adc[i] > 0) adc.push_back(orig_adc[i]);
1039 std::bitset<16> tbit(-orig_adc[i]);
1041 adc.push_back(tbit.to_ulong());
1049 adc.push_back(bset.to_ulong());
1060 std::vector<short> &uncompressed)
1064 uncompressed[0] = adc[0];
1066 unsigned int curu = 1;
1067 short curADC = uncompressed[0];
1071 for(
unsigned int i = 1; i < adc.size() && curu < uncompressed.size(); ++i){
1073 std::bitset<16> bset(adc[i]);
1078 if( !bset.test(15) ){
1081 bset.set(14,
false);
1082 curADC = -1*bset.to_ulong();
1084 uncompressed[curu] = curADC;
1094 while( !bset.test(lowestb) && lowestb < 15) ++lowestb;
1097 mf::LogWarning(
"raw.cxx") <<
"encoded entry has no set bits!!! "
1099 << bset.to_string< char,std::char_traits<char>,std::allocator<char> >();
1103 while( b >= lowestb){
1107 while( !bset.test(b-zerocnt) && b-zerocnt > lowestb) ++zerocnt;
1112 for(
int s = 0;
s < 4; ++
s){
1113 uncompressed[curu] = curADC;
1116 if(curu > uncompressed.size()-1)
break;
1120 else if(zerocnt == 1){
1121 uncompressed[curu] = curADC;
1126 else if(zerocnt == 2){
1128 uncompressed[curu] = curADC;
1133 else if(zerocnt == 3){
1135 uncompressed[curu] = curADC;
1140 else if(zerocnt == 4){
1142 uncompressed[curu] = curADC;
1147 else if(zerocnt == 5){
1149 uncompressed[curu] = curADC;
1154 else if(zerocnt == 6){
1156 uncompressed[curu] = curADC;
1161 else if(zerocnt == 7){
1163 uncompressed[curu] = curADC;
1169 if(curu > uncompressed.size() - 1)
break;
1173 if(curu > uncompressed.size() - 1)
break;
1187 bool fADCStickyCodeFeature){
1189 int adc_return_value =
std::abs(adc_value - pedestal);
1191 if(!fADCStickyCodeFeature){
1192 return adc_return_value;
1195 unsigned int sixlsbs = adc_value &
onemask;
1197 if((sixlsbs==onemask || sixlsbs==0) &&
std::abs(adc_value - pedestal) < 64){
1198 adc_return_value = 0;
1200 return adc_return_value;
1204 cmp.insert(cmp.end(), array.begin(), array.end());
1209 std::function<
void(
int,
std::vector<std::vector<bool>>&)> add_to_table) {
1211 std::vector<std::vector<bool>> table;
1212 add_to_table(100, table);
1214 std::vector<short> comp_short;
1216 assert(not
empty(wf));
1218 unsigned int size_short =
sizeof(wf[0])*8-1;
1219 unsigned int max_2_short = (1 << (size_short*2));
1220 size_t wf_size = wf.size();
1223 if (wf_size > max_2_short) {
1224 throw cet::exception(
"raw") <<
"WOW! You are trying to compress a " << wf_size <<
" long waveform"
1225 <<
" in a vector of shorts.\nUnfortunately, the encoded waveform needs to store the size"
1226 <<
" of the wavefom (in its first number) and " << wf_size <<
" is bigger than the maximum\n"
1227 <<
" number you can encode with 2 shorts (" << max_2_short <<
").\n"
1228 <<
" Bailing out disgracefully to avoid massive trouble.\n";
1231 short high = (wf_size >> (
sizeof(short)*8-1));
1232 short low = wf_size % ((std::numeric_limits<short>::max()+1));
1233 comp_short.push_back(high);
1234 comp_short.push_back(low);
1235 comp_short.push_back(*wf.begin());
1238 std::vector<bool> cmp;
1239 cmp.reserve(wf.size()*
sizeof(wf[0])*8);
1242 std::vector<short> diff;
1243 diff.reserve(wf.size());
1246 std::adjacent_difference(wf.begin(), wf.end(),std::back_inserter(diff), [](
const short& it1,
const short& it2){
1248 if (d > 0) d = 2 * d;
1249 else d = -2 * d + 1;
1254 for (
size_t iSample=1; iSample<diff.size(); ++iSample) {
1256 short d = diff[iSample];
1257 if ((
unsigned)d < table.size()) {
1262 add_to_table(end, table);
1269 size_t n_vector = cmp.size();
1272 std::bitset<8*sizeof(short)> this_encoded;
1274 size_t bit_counter=0;
1276 for (
size_t it=0; it<n_vector; ++it) {
1278 if (bit_counter>=8*
sizeof(
short)) {
1279 short comp_s = (short)this_encoded.to_ulong();
1280 comp_short.push_back(comp_s);
1282 this_encoded.reset();
1286 this_encoded.set(bit_counter);
1293 short comp_s = (short)this_encoded.to_ulong();
1294 comp_short.push_back(comp_s);
1302 std::vector<short> &uncompressed,
1303 std::function<
int(std::vector<bool>&)> decode_table_chunk) {
1306 size_t n_samples = (adc[0]<<(
sizeof(short)*8-1))+adc[1];
1308 uncompressed.push_back(adc[2]);
1311 std::vector<bool> comp;
1313 for (
size_t i=3; i<adc.size(); ++i) {
1315 std::bitset<8*sizeof(short)> this_encoded(adc[i]);
1316 for (
size_t i2=0; i2<this_encoded.size(); ++i2) {
1317 comp.push_back(this_encoded[i2]);
1322 std::vector<bool> current_number;
1323 for (
size_t it=0; it<comp.size(); ++it) {
1324 current_number.push_back(comp[it]);
1328 if ((current_number.size()>=2 && it >= 1 && comp[it-1] == 1 && comp[it] == 1) || it == comp.size()-1) {
1329 current_number.pop_back();
1330 short zigzag_number = decode_table_chunk(current_number);
1333 if (zigzag_number%2 == 0) decoded = zigzag_number / 2;
1334 else decoded = -(zigzag_number - 1) / 2;
1335 short baseline = uncompressed.back();
1337 uncompressed.push_back(baseline + decoded);
1339 current_number.clear();
1340 if (uncompressed.size() == n_samples)
break;
1347 if ((
int)table.size() >
end)
1350 std::map<int, int> fibn;
1357 table.push_back(std::vector<bool>());
1358 table.push_back({
true });
1359 table.push_back({
false,
true});
1362 if ((
int)table.size() >
end)
1366 for (
int i=2; fibn.rbegin()->second<
end; ++i) {
1367 fibn[i] = fibn[i-1] + fibn[i-2];
1371 for (
int i=table.size(); i<=
end; ++i) {
1372 int current_number = i;
1373 std::vector<bool> seq;
1374 while (current_number>0) {
1376 for (
auto fib = fibn.rbegin(); fib != fibn.rend(); ++fib) {
1377 if (fib->second<=current_number) {
1380 seq=std::vector<bool>(fib->first-1,
false);
1382 seq[fib->first-2] =
true;
1384 current_number-=fib->second;
1390 table.push_back(seq);
1395 std::vector<int> FibNumbers={1,2,3,5,8,13,21,34,55,89,144,233,377,610,987};
1397 if (chunk.size() > FibNumbers.size()) {
1398 for (
int i=FibNumbers.size(); i<=(int)chunk.size(); ++i){
1399 FibNumbers.push_back(FibNumbers.at(i-1)+FibNumbers.at(i-2));
1403 for (
size_t it=0; it<chunk.size(); ++it) {
1405 decoded += FibNumbers[it];
void CompressHuffman(std::vector< short > &adc)
enum raw::_compress Compress_t
void UncompressHuffman(const std::vector< short > &adc, std::vector< short > &uncompressed)
const unsigned int onemask
Zero Suppression followed by Huffman Encoding.
standard_dbscan3dalg useful for diagnostics hits not in a line will not be clustered on on only for track like only for track like on on the smaller the less shower like tracks low
Zero Suppression algorithm.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
int ADCStickyCodeCheck(const short adc_value, const int pedestal, bool fADCStickyCodeFeature)
void fibonacci_encode_table(int end, std::vector< std::vector< bool >> &table)
Collect all the RawData header files together.
auto end(FixedBins< T, C > const &) noexcept
void ZeroUnsuppression(const std::vector< short > &adc, std::vector< short > &uncompressed)
void add_to_sequence_terminate(std::vector< bool > array, std::vector< bool > &cmp)
void UncompressFibonacci(const std::vector< short > &adc, std::vector< short > &uncompressed, std::function< int(std::vector< bool > &)> decode_table_chunk)
then echo File list $list not found else cat $list while read file do echo $file sed s
void CompressFibonacci(std::vector< short > &wf, std::function< void(int, std::vector< std::vector< bool >> &)> add_to_table)
void Compress(std::vector< short > &adc, raw::Compress_t compress)
Compresses a raw data buffer.
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
bool empty(FixedBins< T, C > const &) noexcept
void ZeroSuppression(std::vector< short > &adc, unsigned int &zerothreshold)
short fibonacci_decode(std::vector< bool > &chunk)