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_CTCSS_SQUELCH_FF_H
00024 #define INCLUDED_GR_CTCSS_SQUELCH_FF_H
00025
00026 #include <gr_squelch_base_ff.h>
00027 #include <gri_goertzel.h>
00028
00029 class gr_ctcss_squelch_ff;
00030 typedef boost::shared_ptr<gr_ctcss_squelch_ff> gr_ctcss_squelch_ff_sptr;
00031
00032 gr_ctcss_squelch_ff_sptr
00033 gr_make_ctcss_squelch_ff(int rate, float freq, float level=0.01, int len=0, int ramp=0, bool gate=false);
00034
00039 class gr_ctcss_squelch_ff : public gr_squelch_base_ff
00040 {
00041 private:
00042 float d_freq;
00043 float d_level;
00044 int d_len;
00045 bool d_mute;
00046
00047 gri_goertzel d_goertzel_l;
00048 gri_goertzel d_goertzel_c;
00049 gri_goertzel d_goertzel_r;
00050
00051 friend gr_ctcss_squelch_ff_sptr gr_make_ctcss_squelch_ff(int rate, float freq, float level, int len, int ramp, bool gate);
00052 gr_ctcss_squelch_ff(int rate, float freq, float level, int len, int ramp, bool gate);
00053
00054 int find_tone(float freq);
00055
00056 protected:
00057 virtual void update_state(const float &in);
00058 virtual bool mute() const { return d_mute; }
00059
00060 public:
00061 std::vector<float> squelch_range() const;
00062 float level() const { return d_level; }
00063 void set_level(float level) { d_level = level; }
00064 int len() const { return d_len; }
00065 };
00066
00067 #endif