summaryrefslogtreecommitdiff
path: root/gr-analog/include/analog
diff options
context:
space:
mode:
Diffstat (limited to 'gr-analog/include/analog')
-rw-r--r--gr-analog/include/analog/CMakeLists.txt6
-rw-r--r--gr-analog/include/analog/agc.h16
-rw-r--r--gr-analog/include/analog/agc2.h18
-rw-r--r--gr-analog/include/analog/agc2_cc.h12
-rw-r--r--gr-analog/include/analog/agc2_ff.h12
-rw-r--r--gr-analog/include/analog/agc_cc.h8
-rw-r--r--gr-analog/include/analog/agc_ff.h8
-rw-r--r--gr-analog/include/analog/api.h2
-rw-r--r--gr-analog/include/analog/cpm.h37
-rw-r--r--gr-analog/include/analog/ctcss_squelch_ff.h10
-rw-r--r--gr-analog/include/analog/fastnoise_source_X.h.t70
-rw-r--r--gr-analog/include/analog/feedforward_agc_cc.h11
-rw-r--r--gr-analog/include/analog/frequency_modulator_fc.h5
-rw-r--r--gr-analog/include/analog/lfsr.h162
-rw-r--r--gr-analog/include/analog/noise_source_X.h.t2
-rw-r--r--gr-analog/include/analog/plateau_detector_fb.h71
-rw-r--r--gr-analog/include/analog/pll_carriertracking_cc.h5
-rw-r--r--gr-analog/include/analog/pll_freqdet_cf.h5
-rw-r--r--gr-analog/include/analog/pll_refout_cc.h5
-rw-r--r--gr-analog/include/analog/pwr_squelch_cc.h5
-rw-r--r--gr-analog/include/analog/pwr_squelch_ff.h5
-rw-r--r--gr-analog/include/analog/quadrature_demod_cf.h6
-rw-r--r--gr-analog/include/analog/rail_ff.h6
-rw-r--r--gr-analog/include/analog/rotator.h63
-rw-r--r--gr-analog/include/analog/sincos.h38
25 files changed, 223 insertions, 365 deletions
diff --git a/gr-analog/include/analog/CMakeLists.txt b/gr-analog/include/analog/CMakeLists.txt
index f46960c984..0343abcd85 100644
--- a/gr-analog/include/analog/CMakeLists.txt
+++ b/gr-analog/include/analog/CMakeLists.txt
@@ -26,7 +26,7 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
#!${PYTHON_EXECUTABLE}
import sys, os, re
-sys.path.append('${GR_CORE_PYTHONPATH}')
+sys.path.append('${GR_RUNTIME_PYTHONPATH}')
os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
@@ -65,6 +65,7 @@ endmacro(expand_h)
# Invoke macro to generate various sources
#######################################################################
expand_h(noise_source_X s i f c)
+expand_h(fastnoise_source_X s i f c)
expand_h(sig_source_X s i f c)
add_custom_target(analog_generated_includes DEPENDS
@@ -78,6 +79,7 @@ install(FILES
${generated_includes}
api.h
cpm.h
+ noise_type.h
agc.h
agc2.h
noise_type.h
@@ -93,7 +95,6 @@ install(FILES
fmdet_cf.h
frequency_modulator_fc.h
phase_modulator_fc.h
- plateau_detector_fb.h
pll_carriertracking_cc.h
pll_freqdet_cf.h
pll_refout_cc.h
@@ -104,7 +105,6 @@ install(FILES
pwr_squelch_ff.h
quadrature_demod_cf.h
rail_ff.h
- rotator.h
sig_source_waveform.h
simple_squelch_cc.h
DESTINATION ${GR_INCLUDE_DIR}/gnuradio/analog
diff --git a/gr-analog/include/analog/agc.h b/gr-analog/include/analog/agc.h
index 92d777fa19..c304ba8f3e 100644
--- a/gr-analog/include/analog/agc.h
+++ b/gr-analog/include/analog/agc.h
@@ -39,6 +39,14 @@ namespace gr {
class ANALOG_API agc_cc
{
public:
+ /*!
+ * Construct a complex value AGC loop implementation object.
+ *
+ * \param rate the update rate of the loop.
+ * \param reference reference value to adjust signal power to.
+ * \param gain initial gain value.
+ * \param max_gain maximum gain value (0 for unlimited).
+ */
agc_cc(float rate = 1e-4, float reference = 1.0,
float gain = 1.0, float max_gain = 0.0)
: _rate(rate), _reference(reference),
@@ -90,6 +98,14 @@ namespace gr {
class ANALOG_API agc_ff
{
public:
+ /*!
+ * Construct a floating point value AGC loop implementation object.
+ *
+ * \param rate the update rate of the loop.
+ * \param reference reference value to adjust signal power to.
+ * \param gain initial gain value.
+ * \param max_gain maximum gain value (0 for unlimited).
+ */
agc_ff(float rate = 1e-4, float reference = 1.0,
float gain = 1.0, float max_gain = 0.0)
: _rate(rate), _reference(reference), _gain(gain),
diff --git a/gr-analog/include/analog/agc2.h b/gr-analog/include/analog/agc2.h
index 75a203e9fc..8d1958d293 100644
--- a/gr-analog/include/analog/agc2.h
+++ b/gr-analog/include/analog/agc2.h
@@ -39,6 +39,15 @@ namespace gr {
class ANALOG_API agc2_cc
{
public:
+ /*!
+ * Construct a comple value AGC loop implementation object.
+ *
+ * \param attack_rate the update rate of the loop when in attack mode.
+ * \param decay_rate the update rate of the loop when in decay mode.
+ * \param reference reference value to adjust signal power to.
+ * \param gain initial gain value.
+ * \param max_gain maximum gain value (0 for unlimited).
+ */
agc2_cc(float attack_rate = 1e-1, float decay_rate = 1e-2,
float reference = 1.0,
float gain = 1.0, float max_gain = 0.0)
@@ -99,6 +108,15 @@ namespace gr {
class ANALOG_API agc2_ff
{
public:
+ /*!
+ * Construct a floating point value AGC loop implementation object.
+ *
+ * \param attack_rate the update rate of the loop when in attack mode.
+ * \param decay_rate the update rate of the loop when in decay mode.
+ * \param reference reference value to adjust signal power to.
+ * \param gain initial gain value.
+ * \param max_gain maximum gain value (0 for unlimited).
+ */
agc2_ff(float attack_rate = 1e-1, float decay_rate = 1e-2,
float reference = 1.0,
float gain = 1.0, float max_gain = 0.0)
diff --git a/gr-analog/include/analog/agc2_cc.h b/gr-analog/include/analog/agc2_cc.h
index c922ccd4da..7f3a7c24bd 100644
--- a/gr-analog/include/analog/agc2_cc.h
+++ b/gr-analog/include/analog/agc2_cc.h
@@ -31,7 +31,8 @@ namespace gr {
namespace analog {
/*!
- * \brief high performance Automatic Gain Control class
+ * \brief high performance Automatic Gain Control class with
+ * attack and decay rates.
* \ingroup level_blk
*
* For Power the absolute value of the complex number is used.
@@ -42,6 +43,15 @@ namespace gr {
// gr::analog::agc2_cc::sptr
typedef boost::shared_ptr<agc2_cc> sptr;
+ /*!
+ * Build a complex value AGC loop block with attack and decay rates.
+ *
+ * \param attack_rate the update rate of the loop when in attack mode.
+ * \param decay_rate the update rate of the loop when in decay mode.
+ * \param reference reference value to adjust signal power to.
+ * \param gain initial gain value.
+ * \param max_gain maximum gain value (0 for unlimited).
+ */
static sptr make(float attack_rate = 1e-1, float decay_rate = 1e-2,
float reference = 1.0,
float gain = 1.0, float max_gain = 0.0);
diff --git a/gr-analog/include/analog/agc2_ff.h b/gr-analog/include/analog/agc2_ff.h
index 27dd6d92e5..4bb7b0f646 100644
--- a/gr-analog/include/analog/agc2_ff.h
+++ b/gr-analog/include/analog/agc2_ff.h
@@ -31,7 +31,8 @@ namespace gr {
namespace analog {
/*!
- * \brief high performance Automatic Gain Control class
+ * \brief high performance Automatic Gain Control class with
+ * attack and decay rates.
*
* \ingroup level_blk
* Power is approximated by absolute value
@@ -42,6 +43,15 @@ namespace gr {
// gr::analog::agc2_ff::sptr
typedef boost::shared_ptr<agc2_ff> sptr;
+ /*!
+ * Build a floating point AGC loop block with attack and decay rates.
+ *
+ * \param attack_rate the update rate of the loop when in attack mode.
+ * \param decay_rate the update rate of the loop when in decay mode.
+ * \param reference reference value to adjust signal power to.
+ * \param gain initial gain value.
+ * \param max_gain maximum gain value (0 for unlimited).
+ */
static sptr make(float attack_rate = 1e-1, float decay_rate = 1e-2,
float reference = 1.0,
float gain = 1.0, float max_gain = 0.0);
diff --git a/gr-analog/include/analog/agc_cc.h b/gr-analog/include/analog/agc_cc.h
index b2b1a9b430..0e59f8593b 100644
--- a/gr-analog/include/analog/agc_cc.h
+++ b/gr-analog/include/analog/agc_cc.h
@@ -42,6 +42,14 @@ namespace gr {
// gr::analog::agc_cc::sptr
typedef boost::shared_ptr<agc_cc> sptr;
+ /*!
+ * Build a complex value AGC loop block.
+ *
+ * \param rate the update rate of the loop.
+ * \param reference reference value to adjust signal power to.
+ * \param gain initial gain value.
+ * \param max_gain maximum gain value (0 for unlimited).
+ */
static sptr make(float rate = 1e-4, float reference = 1.0,
float gain = 1.0, float max_gain = 0.0);
diff --git a/gr-analog/include/analog/agc_ff.h b/gr-analog/include/analog/agc_ff.h
index 30d1ae1fd9..6046d6f645 100644
--- a/gr-analog/include/analog/agc_ff.h
+++ b/gr-analog/include/analog/agc_ff.h
@@ -42,6 +42,14 @@ namespace gr {
// gr::analog::agc_ff::sptr
typedef boost::shared_ptr<agc_ff> sptr;
+ /*!
+ * Build a floating point AGC loop block.
+ *
+ * \param rate the update rate of the loop.
+ * \param reference reference value to adjust signal power to.
+ * \param gain initial gain value.
+ * \param max_gain maximum gain value (0 for unlimited).
+ */
static sptr make(float rate = 1e-4, float reference = 1.0,
float gain = 1.0, float max_gain = 0.0);
diff --git a/gr-analog/include/analog/api.h b/gr-analog/include/analog/api.h
index b7dee46933..2459ace614 100644
--- a/gr-analog/include/analog/api.h
+++ b/gr-analog/include/analog/api.h
@@ -22,7 +22,7 @@
#ifndef INCLUDED_ANALOG_API_H
#define INCLUDED_ANALOG_API_H
-#include <gruel/attributes.h>
+#include <attributes.h>
#ifdef gnuradio_analog_EXPORTS
# define ANALOG_API __GR_ATTR_EXPORT
diff --git a/gr-analog/include/analog/cpm.h b/gr-analog/include/analog/cpm.h
index d22e02321c..aff0dd19eb 100644
--- a/gr-analog/include/analog/cpm.h
+++ b/gr-analog/include/analog/cpm.h
@@ -28,6 +28,9 @@
namespace gr {
namespace analog {
+ /*! \brief Return the taps for an interpolating FIR filter
+ * (gr::filter::interp_fir_filter_fff).
+ */
class ANALOG_API cpm
{
public:
@@ -40,25 +43,30 @@ namespace gr {
GENERIC = 999
};
- /*! \brief Return the taps for an interpolating FIR filter (gr_interp_fir_filter_fff).
+ /*! \brief Return the taps for an interpolating FIR filter
+ * (gr::filter::interp_fir_filter_fff).
*
- * These taps represent the phase response \f$g(k)\f$ for use in a CPM modulator,
- * see also gr_cpmmod_bc.
+ * These taps represent the phase response \f$g(k)\f$ for use in
+ * a CPM modulator, see also gr_cpmmod_bc.
*
- * \param type The CPM type (Rectangular, Raised Cosine, Spectral Raised Cosine,
- * Tamed FM or Gaussian).
+ * \param type The CPM type (Rectangular, Raised Cosine,
+ * Spectral Raised Cosine, Tamed FM or Gaussian).
* \param samples_per_sym Samples per symbol.
* \param L The length of the phase response in symbols.
- * \param beta For Spectral Raised Cosine, this is the rolloff factor. For Gaussian
- * phase responses, this the 3dB-time-bandwidth product. For all other
- * cases, it is ignored.
+ * \param beta For Spectral Raised Cosine, this is the rolloff
+ * factor. For Gaussian phase responses, this the
+ * 3dB-time-bandwidth product. For all other cases,
+ * it is ignored.
*
- * Output: returns a vector of length \a K = \p samples_per_sym x \p L.
- * This can be used directly in an interpolating FIR filter such as
- * gr_interp_fir_filter_fff with interpolation factor \p samples_per_sym.
+ * Output: returns a vector of length \a K = \p samples_per_sym
+ * x \p L. This can be used directly in an
+ * interpolating FIR filter such as
+ * gr_interp_fir_filter_fff with interpolation factor \p
+ * samples_per_sym.
*
- * All phase responses are normalised s.t. \f$ \sum_{k=0}^{K-1} g(k) = 1\f$; this will cause
- * a maximum phase change of \f$ h \cdot \pi\f$ between two symbols, where \a h is the
+ * All phase responses are normalised s.t. \f$ \sum_{k=0}^{K-1}
+ * g(k) = 1\f$; this will cause a maximum phase change of \f$ h
+ * \cdot \pi\f$ between two symbols, where \a h is the
* modulation index.
*
* The following phase responses can be generated:
@@ -77,7 +85,8 @@ namespace gr {
* [1]: Anderson, Aulin and Sundberg; Digital Phase Modulation
*/
static std::vector<float>
- phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta=0.3);
+ phase_response(cpm_type type, unsigned samples_per_sym,
+ unsigned L, double beta=0.3);
};
} // namespace analog
} // namespace gr
diff --git a/gr-analog/include/analog/ctcss_squelch_ff.h b/gr-analog/include/analog/ctcss_squelch_ff.h
index f880299173..b63876714d 100644
--- a/gr-analog/include/analog/ctcss_squelch_ff.h
+++ b/gr-analog/include/analog/ctcss_squelch_ff.h
@@ -31,7 +31,7 @@ namespace gr {
namespace analog {
/*!
- * \brief gate or zero output if ctcss tone not present
+ * \brief gate or zero output if CTCSS tone not present
* \ingroup level_blk
*/
class ANALOG_API ctcss_squelch_ff :
@@ -47,6 +47,14 @@ namespace gr {
/*!
* \brief Make CTCSS tone squelch block.
+ *
+ * \param rate gain of the internal frequency filters.
+ * \param freq frequency value to use as the squelch tone.
+ * \param level threshold level for the squelch tone.
+ * \param len length of the frequency filters.
+ * \param ramp sets response characteristic.
+ * \param gate if true, no output if no squelch tone.
+ * if false, output 0's if no squelch tone.
*/
static sptr make(int rate, float freq, float level,
int len, int ramp, bool gate);
diff --git a/gr-analog/include/analog/fastnoise_source_X.h.t b/gr-analog/include/analog/fastnoise_source_X.h.t
new file mode 100644
index 0000000000..e1c606692c
--- /dev/null
+++ b/gr-analog/include/analog/fastnoise_source_X.h.t
@@ -0,0 +1,70 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2013 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+// @WARNING@
+
+#ifndef @GUARD_NAME@
+#define @GUARD_NAME@
+
+#include <analog/api.h>
+#include <analog/noise_type.h>
+#include <gr_sync_block.h>
+
+namespace gr {
+ namespace analog {
+
+ /*!
+ * \brief Random number source
+ * \ingroup source_blk
+ *
+ * \details
+ * Generate random values from different distributions.
+ * Currently, only Gaussian and uniform are enabled.
+ */
+ class ANALOG_API @BASE_NAME@ : virtual public gr_sync_block
+ {
+ public:
+ // gr::analog::@BASE_NAME@::sptr
+ typedef boost::shared_ptr<@BASE_NAME@> sptr;
+
+ /*! \brief Make a fast noise source
+ * \param type the random distribution to use (see analog/noise_type.h)
+ * \param ampl a scaling factor for the output
+ * \param seed seed for random generators. Note that for uniform and
+ * \param samples Number of samples to pre-generate
+ * Gaussian distributions, this should be a negative number.
+ */
+ static sptr make(noise_type_t type, float ampl,
+ long seed = 0, long samples=1024*16);
+
+ virtual void set_type(noise_type_t type) = 0;
+ virtual void set_amplitude(float ampl) = 0;
+
+ virtual noise_type_t type() const = 0;
+ virtual float amplitude() const = 0;
+ };
+
+ } /* namespace analog */
+} /* namespace gr */
+
+
+#endif /* @GUARD_NAME@ */
diff --git a/gr-analog/include/analog/feedforward_agc_cc.h b/gr-analog/include/analog/feedforward_agc_cc.h
index 9e259a4eba..743b9b3a3b 100644
--- a/gr-analog/include/analog/feedforward_agc_cc.h
+++ b/gr-analog/include/analog/feedforward_agc_cc.h
@@ -30,7 +30,8 @@ namespace gr {
namespace analog {
/*!
- * \brief Non-causal AGC which computes required gain based on max absolute value over nsamples
+ * \brief Non-causal AGC which computes required gain based on max
+ * absolute value over nsamples
* \ingroup level_blk
*/
class ANALOG_API feedforward_agc_cc : virtual public gr_sync_block
@@ -38,7 +39,13 @@ namespace gr {
public:
// gr::analog::feedforward_agc_cc::sptr
typedef boost::shared_ptr<feedforward_agc_cc> sptr;
-
+
+ /*!
+ * Build a complex valued feed-forward AGC loop block.
+ *
+ * \param nsamples number of samples to look ahead.
+ * \param reference reference value to adjust signal power to.
+ */
static sptr make(int nsamples, float reference);
};
diff --git a/gr-analog/include/analog/frequency_modulator_fc.h b/gr-analog/include/analog/frequency_modulator_fc.h
index 8706d513a6..67be1ff00e 100644
--- a/gr-analog/include/analog/frequency_modulator_fc.h
+++ b/gr-analog/include/analog/frequency_modulator_fc.h
@@ -41,6 +41,11 @@ namespace gr {
// gr::analog::frequency_modulator_fc::sptr
typedef boost::shared_ptr<frequency_modulator_fc> sptr;
+ /*!
+ * Build a frequency modulator block.
+ *
+ * \param sensitivity radians/sample = amplitude * sensitivity
+ */
static sptr make(double sensitivity);
virtual void set_sensitivity(float sens) = 0;
diff --git a/gr-analog/include/analog/lfsr.h b/gr-analog/include/analog/lfsr.h
deleted file mode 100644
index 5cf2ec70df..0000000000
--- a/gr-analog/include/analog/lfsr.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,2010,2012 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef INCLUDED_ANALOG_LFSR_H
-#define INCLUDED_ANALOG_LFSR_H
-
-#include <analog/api.h>
-#include <stdexcept>
-#include <stdint.h>
-
-namespace gr {
- namespace analog {
-
- /*!
- * \brief Fibonacci Linear Feedback Shift Register using specified
- * polynomial mask
- * \ingroup misc
- *
- * Generates a maximal length pseudo-random sequence of length
- * 2^degree-1
- *
- * Constructor: analog::lfsr(int mask, int seed, int reg_len);
- *
- * \param mask - polynomial coefficients representing the
- * locations of feedback taps from a shift register
- * which are xor'ed together to form the new high
- * order bit.
- *
- * Some common masks might be:
- * x^4 + x^3 + x^0 = 0x19
- * x^5 + x^3 + x^0 = 0x29
- * x^6 + x^5 + x^0 = 0x61
- *
- * \param seed - the initialization vector placed into the
- * register durring initialization. Low order bit
- * corresponds to x^0 coefficient -- the first to be
- * shifted as output.
- *
- * \param reg_len - specifies the length of the feedback shift
- * register to be used. Durring each iteration, the
- * register is rightshifted one and the new bit is
- * placed in bit reg_len. reg_len should generally be
- * at least order(mask) + 1
- *
- *
- * see http://en.wikipedia.org/wiki/Linear_feedback_shift_register
- * for more explanation.
- *
- * next_bit() - Standard LFSR operation
- *
- * Perform one cycle of the LFSR. The output bit is taken from
- * the shift register LSB. The shift register MSB is assigned from
- * the modulo 2 sum of the masked shift register.
- *
- * next_bit_scramble(unsigned char input) - Scramble an input stream
- *
- * Perform one cycle of the LFSR. The output bit is taken from
- * the shift register LSB. The shift register MSB is assigned from
- * the modulo 2 sum of the masked shift register and the input LSB.
- *
- * next_bit_descramble(unsigned char input) - Descramble an input stream
- *
- * Perform one cycle of the LFSR. The output bit is taken from
- * the modulo 2 sum of the masked shift register and the input LSB.
- * The shift register MSB is assigned from the LSB of the input.
- *
- * See http://en.wikipedia.org/wiki/Scrambler for operation of these
- * last two functions (see multiplicative scrambler.)
- */
- class lfsr
- {
- private:
- uint32_t d_shift_register;
- uint32_t d_mask;
- uint32_t d_seed;
- uint32_t d_shift_register_length; // less than 32
-
- static uint32_t
- popCount(uint32_t x)
- {
- uint32_t r = x - ((x >> 1) & 033333333333)
- - ((x >> 2) & 011111111111);
- return ((r + (r >> 3)) & 030707070707) % 63;
- }
-
- public:
- lfsr(uint32_t mask, uint32_t seed, uint32_t reg_len)
- : d_shift_register(seed),
- d_mask(mask),
- d_seed(seed),
- d_shift_register_length(reg_len)
- {
- if(reg_len > 31)
- throw std::invalid_argument("reg_len must be <= 31");
- }
-
- unsigned char next_bit()
- {
- unsigned char output = d_shift_register & 1;
- unsigned char newbit = popCount( d_shift_register & d_mask )%2;
- d_shift_register = ((d_shift_register>>1) | (newbit<<d_shift_register_length));
- return output;
- }
-
- unsigned char next_bit_scramble(unsigned char input)
- {
- unsigned char output = d_shift_register & 1;
- unsigned char newbit = (popCount( d_shift_register & d_mask )%2)^(input & 1);
- d_shift_register = ((d_shift_register>>1) | (newbit<<d_shift_register_length));
- return output;
- }
-
- unsigned char next_bit_descramble(unsigned char input)
- {
- unsigned char output = (popCount( d_shift_register & d_mask )%2)^(input & 1);
- unsigned char newbit = input & 1;
- d_shift_register = ((d_shift_register>>1) | (newbit<<d_shift_register_length));
- return output;
- }
-
- /*!
- * Reset shift register to initial seed value
- */
- void reset() { d_shift_register = d_seed; }
-
- /*!
- * Rotate the register through x number of bits
- * where we are just throwing away the results to get queued up correctly
- */
- void pre_shift(int num)
- {
- for(int i=0; i<num; i++) {
- next_bit();
- }
- }
-
- int mask() const { return d_mask; }
- };
-
- } /* namespace analog */
-} /* namespace gr */
-
-#endif /* INCLUDED_ANALOG_LFSR_H */
diff --git a/gr-analog/include/analog/noise_source_X.h.t b/gr-analog/include/analog/noise_source_X.h.t
index 9d1be6fedf..27d20cd072 100644
--- a/gr-analog/include/analog/noise_source_X.h.t
+++ b/gr-analog/include/analog/noise_source_X.h.t
@@ -53,7 +53,7 @@ namespace gr {
* \param seed seed for random generators. Note that for uniform and
* Gaussian distributions, this should be a negative number.
*/
- static sptr make(noise_type_t type, float ampl, long seed);
+ static sptr make(noise_type_t type, float ampl, long seed=0);
virtual void set_type(noise_type_t type) = 0;
virtual void set_amplitude(float ampl) = 0;
diff --git a/gr-analog/include/analog/plateau_detector_fb.h b/gr-analog/include/analog/plateau_detector_fb.h
deleted file mode 100644
index 33629bd18b..0000000000
--- a/gr-analog/include/analog/plateau_detector_fb.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2012 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-
-#ifndef INCLUDED_ANALOG_PLATEAU_DETECTOR_FB_H
-#define INCLUDED_ANALOG_PLATEAU_DETECTOR_FB_H
-
-#include <analog/api.h>
-#include <gr_sync_block.h>
-
-namespace gr {
- namespace analog {
-
- /*!
- * \brief Detects a plateau and marks the middle.
- *
- * Detect a plateau of a-priori known height. Input is a stream of floats,
- * the output is a stream of bytes. Whenever a plateau is detected, the
- * middle of that plateau is marked with a '1' on the output stream (all
- * other samples are left at zero).
- *
- * You can use this in a Schmidl & Cox synchronisation algorithm to interpret
- * the output of the normalized correlator. Just pass the length of the cyclic
- * prefix (in samples) as the max_len parameter).
- *
- * Unlike the peak detectors, you must the now the absolute height of the plateau.
- * Whenever the amplitude exceeds the given threshold, it starts assuming the
- * presence of a plateau.
- *
- * An implicit hysteresis is provided by the fact that after detecting one plateau,
- * it waits at least max_len samples before the next plateau can be detected.
- *
- * \ingroup analog
- *
- */
- class ANALOG_API plateau_detector_fb : virtual public gr_sync_block
- {
- public:
- typedef boost::shared_ptr<plateau_detector_fb> sptr;
-
- /*!
- * \param max_len Maximum length of the plateau
- * \param threshold Anything above this value is considered a plateau
- */
- static sptr make(int max_len, float threshold=0.9);
- };
-
- } // namespace analog
-} // namespace gr
-
-#endif /* INCLUDED_ANALOG_PLATEAU_DETECTOR_FB_H */
-
diff --git a/gr-analog/include/analog/pll_carriertracking_cc.h b/gr-analog/include/analog/pll_carriertracking_cc.h
index 3596429d49..0812d650f0 100644
--- a/gr-analog/include/analog/pll_carriertracking_cc.h
+++ b/gr-analog/include/analog/pll_carriertracking_cc.h
@@ -24,6 +24,7 @@
#define INCLUDED_ANALOG_PLL_CARRIERTRACKING_CC_H
#include <analog/api.h>
+#include <blocks/control_loop.h>
#include <gr_sync_block.h>
namespace gr {
@@ -45,7 +46,9 @@ namespace gr {
* and should be set around pi/200 -- 2pi/100. \sa
* pll_freqdet_cf, pll_carriertracking_cc
*/
- class ANALOG_API pll_carriertracking_cc : virtual public gr_sync_block
+ class ANALOG_API pll_carriertracking_cc
+ : virtual public gr_sync_block,
+ virtual public blocks::control_loop
{
public:
// gr::analog::pll_carriertracking_cc::sptr
diff --git a/gr-analog/include/analog/pll_freqdet_cf.h b/gr-analog/include/analog/pll_freqdet_cf.h
index 613e85263f..8ffbc5968e 100644
--- a/gr-analog/include/analog/pll_freqdet_cf.h
+++ b/gr-analog/include/analog/pll_freqdet_cf.h
@@ -24,6 +24,7 @@
#define INCLUDED_ANALOG_PLL_FREQDET_CF_H
#include <analog/api.h>
+#include <blocks/control_loop.h>
#include <gr_sync_block.h>
namespace gr {
@@ -44,7 +45,9 @@ namespace gr {
* around pi/200 -- 2pi/100.
* \sa pll_refout_cc, pll_carriertracking_cc
*/
- class ANALOG_API pll_freqdet_cf : virtual public gr_sync_block
+ class ANALOG_API pll_freqdet_cf
+ : virtual public gr_sync_block,
+ virtual public blocks::control_loop
{
public:
// gr::analog::pll_freqdet_cf::sptr
diff --git a/gr-analog/include/analog/pll_refout_cc.h b/gr-analog/include/analog/pll_refout_cc.h
index a18d177e6e..1ba907262e 100644
--- a/gr-analog/include/analog/pll_refout_cc.h
+++ b/gr-analog/include/analog/pll_refout_cc.h
@@ -24,6 +24,7 @@
#define INCLUDED_ANALOG_PLL_REFOUT_CC_H
#include <analog/api.h>
+#include <blocks/control_loop.h>
#include <gr_sync_block.h>
namespace gr {
@@ -45,7 +46,9 @@ namespace gr {
* and should be set around pi/200 -- 2pi/100. \sa
* pll_freqdet_cf, pll_carriertracking_cc
*/
- class ANALOG_API pll_refout_cc : virtual public gr_sync_block
+ class ANALOG_API pll_refout_cc
+ : virtual public gr_sync_block,
+ virtual public blocks::control_loop
{
public:
// gr::analog::pll_refout_cc::sptr
diff --git a/gr-analog/include/analog/pwr_squelch_cc.h b/gr-analog/include/analog/pwr_squelch_cc.h
index 79364a86b5..e3f6fb67fc 100644
--- a/gr-analog/include/analog/pwr_squelch_cc.h
+++ b/gr-analog/include/analog/pwr_squelch_cc.h
@@ -50,8 +50,9 @@ namespace gr {
*
* \param db threshold (in dB) for power squelch
* \param alpha Gain of averaging filter
- * \param ramp
- * \param gate
+ * \param ramp sets response characteristic.
+ * \param gate if true, no output if no squelch tone.
+ * if false, output 0's if no squelch tone.
*/
static sptr make(double db, double alpha=0.0001,
int ramp=0, bool gate=false);
diff --git a/gr-analog/include/analog/pwr_squelch_ff.h b/gr-analog/include/analog/pwr_squelch_ff.h
index 6fdebec746..f8f7b4aac2 100644
--- a/gr-analog/include/analog/pwr_squelch_ff.h
+++ b/gr-analog/include/analog/pwr_squelch_ff.h
@@ -50,8 +50,9 @@ namespace gr {
*
* \param db threshold (in dB) for power squelch
* \param alpha Gain of averaging filter
- * \param ramp
- * \param gate
+ * \param ramp sets response characteristic.
+ * \param gate if true, no output if no squelch tone.
+ * if false, output 0's if no squelch tone.
*/
static sptr make(double db, double alpha=0.0001,
int ramp=0, bool gate=false);
diff --git a/gr-analog/include/analog/quadrature_demod_cf.h b/gr-analog/include/analog/quadrature_demod_cf.h
index 916d8b2ece..fc29e494da 100644
--- a/gr-analog/include/analog/quadrature_demod_cf.h
+++ b/gr-analog/include/analog/quadrature_demod_cf.h
@@ -42,6 +42,12 @@ namespace gr {
// gr::analog::quadrature_demod_cf::sptr
typedef boost::shared_ptr<quadrature_demod_cf> sptr;
+ /* \brief Make a quadrature demodulator block.
+ *
+ * \param gain Gain setting to adjust the output amplitude. Set
+ * based on converting the phase difference between
+ * samples to a nominal output value.
+ */
static sptr make(float gain);
virtual void set_gain(float gain) = 0;
diff --git a/gr-analog/include/analog/rail_ff.h b/gr-analog/include/analog/rail_ff.h
index e51b2fc935..120ca2815b 100644
--- a/gr-analog/include/analog/rail_ff.h
+++ b/gr-analog/include/analog/rail_ff.h
@@ -39,6 +39,12 @@ namespace gr {
// gr::analog::rail_ff::sptr
typedef boost::shared_ptr<rail_ff> sptr;
+ /*!
+ * Build a rail block.
+ *
+ * \param lo the low value to clip to.
+ * \param hi the high value to clip to.
+ */
static sptr make(float lo, float hi);
virtual float lo() const = 0;
diff --git a/gr-analog/include/analog/rotator.h b/gr-analog/include/analog/rotator.h
deleted file mode 100644
index ee3849eae7..0000000000
--- a/gr-analog/include/analog/rotator.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2003,2008,2012 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef _ANALOG_ROTATOR_H_
-#define _ANALOG_ROTATOR_H_
-
-#include <analog/api.h>
-#include <gr_complex.h>
-
-namespace gr {
- namespace analog {
-
- class rotator
- {
- private:
- gr_complex d_phase;
- gr_complex d_phase_incr;
- unsigned int d_counter;
-
- public:
- rotator() : d_phase (1), d_phase_incr (1), d_counter(0)
- { }
-
- void set_phase(gr_complex phase) { d_phase = phase / abs(phase); }
- void set_phase_incr(gr_complex incr) { d_phase_incr = incr / abs(incr); }
-
- gr_complex rotate (gr_complex in)
- {
- d_counter++;
-
- gr_complex z = in * d_phase; // rotate in by phase
- d_phase *= d_phase_incr; // incr our phase (complex mult == add phases)
-
- if((d_counter % 512) == 0)
- d_phase /= abs(d_phase); // Normalize to ensure multiplication is rotation
-
- return z;
- }
- };
-
- } /* namespace analog */
-} /* namespace gr */
-
-#endif /* _ANALOG_ROTATOR_H_ */
diff --git a/gr-analog/include/analog/sincos.h b/gr-analog/include/analog/sincos.h
deleted file mode 100644
index 38b9d96da0..0000000000
--- a/gr-analog/include/analog/sincos.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2002,2004,2012 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef INCLUDED_ANALOG_SINCOS_H
-#define INCLUDED_ANALOG_SINCOS_H
-
-#include <analog/api.h>
-
-namespace gr {
- namespace analog {
-
- // compute sine and cosine at the same time
- ANALOG_API void sincos(double x, double *sin, double *cos);
- ANALOG_API void sincosf(float x, float *sin, float *cos);
-
- } /* namespace analog */
-} /* namespace gr */
-
-#endif /* INCLUDED_ANALOG_SINCOS_H */