diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2019-08-07 21:45:12 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2019-08-09 23:04:28 +0200 |
commit | f7bbf2c1d8d780294f3e016aff239ca35eb6516e (patch) | |
tree | e09ab6112e02b2215b2d59ac24d3d6ea2edac745 /gr-analog/lib/pwr_squelch_cc_impl.cc | |
parent | 78431dc6941e3acc67c858277dfe4a0ed583643c (diff) |
Tree: clang-format without the include sorting
Diffstat (limited to 'gr-analog/lib/pwr_squelch_cc_impl.cc')
-rw-r--r-- | gr-analog/lib/pwr_squelch_cc_impl.cc | 92 |
1 files changed, 44 insertions, 48 deletions
diff --git a/gr-analog/lib/pwr_squelch_cc_impl.cc b/gr-analog/lib/pwr_squelch_cc_impl.cc index 62b9cff5c6..5eec01c0ff 100644 --- a/gr-analog/lib/pwr_squelch_cc_impl.cc +++ b/gr-analog/lib/pwr_squelch_cc_impl.cc @@ -27,61 +27,57 @@ #include "pwr_squelch_cc_impl.h" namespace gr { - namespace analog { +namespace analog { - pwr_squelch_cc::sptr - pwr_squelch_cc::make(double threshold, double alpha, - int ramp, bool gate) - { - return gnuradio::get_initial_sptr - (new pwr_squelch_cc_impl(threshold, alpha, ramp, gate)); - } +pwr_squelch_cc::sptr +pwr_squelch_cc::make(double threshold, double alpha, int ramp, bool gate) +{ + return gnuradio::get_initial_sptr( + new pwr_squelch_cc_impl(threshold, alpha, ramp, gate)); +} - pwr_squelch_cc_impl::pwr_squelch_cc_impl(double threshold, double alpha, - int ramp, bool gate) - : block("pwr_squelch_cc", - io_signature::make(1, 1, sizeof(gr_complex)), - io_signature::make(1, 1, sizeof(gr_complex))), - squelch_base_cc_impl("pwr_squelch_cc", ramp, gate), - d_pwr(0), d_iir(alpha) - { - set_threshold(threshold); - } +pwr_squelch_cc_impl::pwr_squelch_cc_impl(double threshold, + double alpha, + int ramp, + bool gate) + : block("pwr_squelch_cc", + io_signature::make(1, 1, sizeof(gr_complex)), + io_signature::make(1, 1, sizeof(gr_complex))), + squelch_base_cc_impl("pwr_squelch_cc", ramp, gate), + d_pwr(0), + d_iir(alpha) +{ + set_threshold(threshold); +} - pwr_squelch_cc_impl::~pwr_squelch_cc_impl() - { - } +pwr_squelch_cc_impl::~pwr_squelch_cc_impl() {} - std::vector<float> - pwr_squelch_cc_impl::squelch_range() const - { - std::vector<float> r(3); - r[0] = -50.0; // min FIXME - r[1] = +50.0; // max FIXME - r[2] = (r[1] - r[0]) / 100; // step size +std::vector<float> pwr_squelch_cc_impl::squelch_range() const +{ + std::vector<float> r(3); + r[0] = -50.0; // min FIXME + r[1] = +50.0; // max FIXME + r[2] = (r[1] - r[0]) / 100; // step size - return r; - } + return r; +} - void - pwr_squelch_cc_impl::update_state(const gr_complex &in) - { - d_pwr = d_iir.filter(in.real()*in.real()+in.imag()*in.imag()); - } +void pwr_squelch_cc_impl::update_state(const gr_complex& in) +{ + d_pwr = d_iir.filter(in.real() * in.real() + in.imag() * in.imag()); +} - void - pwr_squelch_cc_impl::set_threshold(double db) - { - gr::thread::scoped_lock l(d_setlock); - d_threshold = std::pow(10.0, db/10); - } +void pwr_squelch_cc_impl::set_threshold(double db) +{ + gr::thread::scoped_lock l(d_setlock); + d_threshold = std::pow(10.0, db / 10); +} - void - pwr_squelch_cc_impl::set_alpha(double alpha) - { - gr::thread::scoped_lock l(d_setlock); - d_iir.set_taps(alpha); - } +void pwr_squelch_cc_impl::set_alpha(double alpha) +{ + gr::thread::scoped_lock l(d_setlock); + d_iir.set_taps(alpha); +} - } /* namespace analog */ +} /* namespace analog */ } /* namespace gr */ |