buffer_spike_detector.h
Go to the documentation of this file.
00001 /*
00002  * buffer_spike_detector.h
00003  * Copyright 2013 University of Massachusetts Lowell
00004  * Author: Jonathan Hasenzahl
00005  */
00006 
00007 #ifndef BUFFER_SPIKE_DETECTOR_H_
00008 #define BUFFER_SPIKE_DETECTOR_H_
00009 
00010 #include "neuro_recv/dish_state.h"
00011 #include "burst_calc/ranges.h"
00012 
00022 class BufferSpikeDetector
00023 {
00024 public:
00025     BufferSpikeDetector();
00026     void init(int buffer_size, double stdev_mult);
00027     void add(const neuro_recv::dish_state& d);
00028     double getBaseline(int index) { return baselines_[index]; }
00029     double getThreshold(int index) { return thresholds_[index]; }
00030     bool isBuffered() { return dishes_received_ >= buffer_size_; }
00031     burst_calc::ranges getRanges();
00032 
00033 private:
00034     void calculate();
00035 
00036     double sums_[60];
00037     double sum_squares_[60];
00038     double baselines_[60];
00039     double variances_[60];
00040     double stdevs_[60];
00041     double thresholds_[60];
00042     double min_volts_[60];
00043     double max_volts_[60];
00044     int buffer_size_;
00045     int dishes_received_;
00046     double stdev_mult_;
00047 };
00048 
00049 #endif


burst_calc
Author(s): Jonathan Hasenzahl
autogenerated on Sun Jan 5 2014 11:12:30