gr_bin_statistics_f.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef INCLUDED_GR_BIN_STATISTICS_F_H
00024 #define INCLUDED_GR_BIN_STATISTICS_F_H
00025
00026
00027 #include <gr_sync_block.h>
00028 #include <gr_feval.h>
00029 #include <gr_message.h>
00030 #include <gr_msg_queue.h>
00031
00032 class gr_bin_statistics_f;
00033 typedef boost::shared_ptr<gr_bin_statistics_f> gr_bin_statistics_f_sptr;
00034
00035
00036 gr_bin_statistics_f_sptr
00037 gr_make_bin_statistics_f(unsigned int vlen,
00038 gr_msg_queue_sptr msgq,
00039 gr_feval_dd *tune,
00040 size_t tune_delay,
00041 size_t dwell_delay);
00042
00047 class gr_bin_statistics_f : public gr_sync_block
00048 {
00049 friend gr_bin_statistics_f_sptr
00050 gr_make_bin_statistics_f(unsigned int vlen,
00051 gr_msg_queue_sptr msgq,
00052 gr_feval_dd *tune,
00053 size_t tune_delay,
00054 size_t dwell_delay);
00055
00056 enum state_t { ST_INIT, ST_TUNE_DELAY, ST_DWELL_DELAY };
00057
00058 size_t d_vlen;
00059 gr_msg_queue_sptr d_msgq;
00060 gr_feval_dd *d_tune;
00061 size_t d_tune_delay;
00062 size_t d_dwell_delay;
00063 double d_center_freq;
00064
00065 state_t d_state;
00066 size_t d_delay;
00067
00068 gr_bin_statistics_f(unsigned int vlen,
00069 gr_msg_queue_sptr msgq,
00070 gr_feval_dd *tune,
00071 size_t tune_delay,
00072 size_t dwell_delay);
00073
00074 void enter_init();
00075 void enter_tune_delay();
00076 void enter_dwell_delay();
00077 void leave_dwell_delay();
00078
00079 protected:
00080 std::vector<float> d_max;
00081
00082 size_t vlen() const { return d_vlen; }
00083 double center_freq() const { return d_center_freq; }
00084 gr_msg_queue_sptr msgq() const { return d_msgq; }
00085
00086 virtual void reset_stats();
00087 virtual void accrue_stats(const float *input);
00088 virtual void send_stats();
00089
00090 public:
00091 ~gr_bin_statistics_f();
00092
00093 int work(int noutput_items,
00094 gr_vector_const_void_star &input_items,
00095 gr_vector_void_star &output_items);
00096
00097 };
00098
00099 #endif