summaryrefslogtreecommitdiff
path: root/gr-digital
diff options
context:
space:
mode:
authorTom Rondeau2011-03-28 22:20:03 -0400
committerTom Rondeau2011-03-28 22:22:35 -0400
commitf6e8da2d7cb16c68a3e3683a0e81c84eda73dabf (patch)
tree8365d09c52de1dd6ece6a9c334325f923333facd /gr-digital
parent58b27b537b66cd8d4225bf9a62a0afda22e9c387 (diff)
downloadgnuradio-f6e8da2d7cb16c68a3e3683a0e81c84eda73dabf.tar.gz
gnuradio-f6e8da2d7cb16c68a3e3683a0e81c84eda73dabf.tar.bz2
gnuradio-f6e8da2d7cb16c68a3e3683a0e81c84eda73dabf.zip
gr-digital: renaming block to avoid name collision with stuff in gnuradio-core.
Diffstat (limited to 'gr-digital')
-rw-r--r--gr-digital/lib/Makefile.am4
-rw-r--r--gr-digital/lib/digital_costas_loop_cc.cc (renamed from gr-digital/lib/gr_costas_loop_cc.cc)50
-rw-r--r--gr-digital/lib/digital_costas_loop_cc.h (renamed from gr-digital/lib/gr_costas_loop_cc.h)35
-rw-r--r--gr-digital/swig/Makefile.am2
-rw-r--r--gr-digital/swig/digital_costas_loop_cc.i (renamed from gr-digital/swig/gr_costas_loop_cc.i)14
-rw-r--r--gr-digital/swig/digital_swig.i4
6 files changed, 55 insertions, 54 deletions
diff --git a/gr-digital/lib/Makefile.am b/gr-digital/lib/Makefile.am
index c37b48786..83a06c898 100644
--- a/gr-digital/lib/Makefile.am
+++ b/gr-digital/lib/Makefile.am
@@ -25,12 +25,12 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
# These headers get installed in ${prefix}/include/gnuradio
grinclude_HEADERS = \
- gr_costas_loop_cc.h
+ digital_costas_loop_cc.h
lib_LTLIBRARIES = libgnuradio-digital.la
libgnuradio_digital_la_SOURCES = \
- gr_costas_loop_cc.cc
+ digital_costas_loop_cc.cc
libgnuradio_digital_la_LIBADD = \
$(GNURADIO_CORE_LA)
diff --git a/gr-digital/lib/gr_costas_loop_cc.cc b/gr-digital/lib/digital_costas_loop_cc.cc
index b77b19745..537f54f2d 100644
--- a/gr-digital/lib/gr_costas_loop_cc.cc
+++ b/gr-digital/lib/digital_costas_loop_cc.cc
@@ -24,7 +24,7 @@
#include "config.h"
#endif
-#include <gr_costas_loop_cc.h>
+#include <digital_costas_loop_cc.h>
#include <gr_io_signature.h>
#include <gr_expj.h>
#include <gr_sincos.h>
@@ -32,21 +32,21 @@
#define M_TWOPI (2*M_PI)
-gr_costas_loop_cc_sptr
-gr_make_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq,
- int order
- ) throw (std::invalid_argument)
+digital_costas_loop_cc_sptr
+digital_make_costas_loop_cc (float alpha, float beta,
+ float max_freq, float min_freq,
+ int order
+ ) throw (std::invalid_argument)
{
- return gnuradio::get_initial_sptr(new gr_costas_loop_cc (alpha, beta,
- max_freq, min_freq,
- order));
+ return gnuradio::get_initial_sptr(new digital_costas_loop_cc (alpha, beta,
+ max_freq, min_freq,
+ order));
}
-gr_costas_loop_cc::gr_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq,
- int order
- ) throw (std::invalid_argument)
+digital_costas_loop_cc::digital_costas_loop_cc (float alpha, float beta,
+ float max_freq, float min_freq,
+ int order
+ ) throw (std::invalid_argument)
: gr_sync_block ("costas_loop_cc",
gr_make_io_signature (1, 1, sizeof (gr_complex)),
gr_make_io_signature (1, 2, sizeof (gr_complex))),
@@ -57,15 +57,15 @@ gr_costas_loop_cc::gr_costas_loop_cc (float alpha, float beta,
{
switch(d_order) {
case 2:
- d_phase_detector = &gr_costas_loop_cc::phase_detector_2;
+ d_phase_detector = &digital_costas_loop_cc::phase_detector_2;
break;
case 4:
- d_phase_detector = &gr_costas_loop_cc::phase_detector_4;
+ d_phase_detector = &digital_costas_loop_cc::phase_detector_4;
break;
case 8:
- d_phase_detector = &gr_costas_loop_cc::phase_detector_8;
+ d_phase_detector = &digital_costas_loop_cc::phase_detector_8;
break;
default:
@@ -75,7 +75,7 @@ gr_costas_loop_cc::gr_costas_loop_cc (float alpha, float beta,
}
float
-gr_costas_loop_cc::phase_detector_8(gr_complex sample) const
+digital_costas_loop_cc::phase_detector_8(gr_complex sample) const
{
float K = sqrt(2.0) - 1;
@@ -90,7 +90,7 @@ gr_costas_loop_cc::phase_detector_8(gr_complex sample) const
}
float
-gr_costas_loop_cc::phase_detector_4(gr_complex sample) const
+digital_costas_loop_cc::phase_detector_4(gr_complex sample) const
{
return ((sample.real()>0 ? 1.0 : -1.0) * sample.imag() -
@@ -98,27 +98,27 @@ gr_costas_loop_cc::phase_detector_4(gr_complex sample) const
}
float
-gr_costas_loop_cc::phase_detector_2(gr_complex sample) const
+digital_costas_loop_cc::phase_detector_2(gr_complex sample) const
{
return (sample.real()*sample.imag());
}
void
-gr_costas_loop_cc::set_alpha(float alpha)
+digital_costas_loop_cc::set_alpha(float alpha)
{
d_alpha = alpha;
}
void
-gr_costas_loop_cc::set_beta(float beta)
+digital_costas_loop_cc::set_beta(float beta)
{
d_beta = beta;
}
int
-gr_costas_loop_cc::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+digital_costas_loop_cc::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
const gr_complex *iptr = (gr_complex *) input_items[0];
gr_complex *optr = (gr_complex *) output_items[0];
@@ -154,7 +154,7 @@ gr_costas_loop_cc::work (int noutput_items,
else if (d_freq < d_min_freq)
d_freq = d_min_freq;
- foptr[i] = gr_complex(d_freq,0);
+ foptr[i] = gr_complex(error,0);
}
} else {
for (int i = 0; i < noutput_items; i++){
diff --git a/gr-digital/lib/gr_costas_loop_cc.h b/gr-digital/lib/digital_costas_loop_cc.h
index 181880f1c..256423aae 100644
--- a/gr-digital/lib/gr_costas_loop_cc.h
+++ b/gr-digital/lib/digital_costas_loop_cc.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -21,8 +21,8 @@
*/
-#ifndef INCLUDED_GR_COSTAS_LOOP_CC_H
-#define INCLUDED_GR_COSTAS_LOOP_CC_H
+#ifndef INCLUDED_DIGITAL_COSTAS_LOOP_CC_H
+#define INCLUDED_DIGITAL_COSTAS_LOOP_CC_H
#include <gr_sync_block.h>
#include <stdexcept>
@@ -53,15 +53,15 @@
* \param min_freq the minimum frequency deviation (radians/sample) the loop can handle
* \param order the loop order, either 2 or 4
*/
-class gr_costas_loop_cc;
-typedef boost::shared_ptr<gr_costas_loop_cc> gr_costas_loop_cc_sptr;
+class digital_costas_loop_cc;
+typedef boost::shared_ptr<digital_costas_loop_cc> digital_costas_loop_cc_sptr;
-gr_costas_loop_cc_sptr
-gr_make_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq,
- int order
- ) throw (std::invalid_argument);
+digital_costas_loop_cc_sptr
+digital_make_costas_loop_cc (float alpha, float beta,
+ float max_freq, float min_freq,
+ int order
+ ) throw (std::invalid_argument);
/*!
@@ -74,17 +74,18 @@ gr_make_costas_loop_cc (float alpha, float beta,
*
* \p order must be 2 or 4.
*/
-class gr_costas_loop_cc : public gr_sync_block
+class digital_costas_loop_cc : public gr_sync_block
{
- friend gr_costas_loop_cc_sptr gr_make_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq,
- int order
- ) throw (std::invalid_argument);
+ friend digital_costas_loop_cc_sptr
+ digital_make_costas_loop_cc (float alpha, float beta,
+ float max_freq, float min_freq,
+ int order
+ ) throw (std::invalid_argument);
float d_alpha, d_beta, d_max_freq, d_min_freq, d_phase, d_freq;
int d_order;
- gr_costas_loop_cc (float alpha, float beta,
+ digital_costas_loop_cc (float alpha, float beta,
float max_freq, float min_freq,
int order
) throw (std::invalid_argument);
@@ -108,7 +109,7 @@ class gr_costas_loop_cc : public gr_sync_block
float phase_detector_2(gr_complex sample) const; // for BPSK
- float (gr_costas_loop_cc::*d_phase_detector)(gr_complex sample) const;
+ float (digital_costas_loop_cc::*d_phase_detector)(gr_complex sample) const;
public:
diff --git a/gr-digital/swig/Makefile.am b/gr-digital/swig/Makefile.am
index 277c66f33..737d348b7 100644
--- a/gr-digital/swig/Makefile.am
+++ b/gr-digital/swig/Makefile.am
@@ -57,7 +57,7 @@ digital_swig_la_swig_libadd = \
# additional SWIG files to be installed
digital_swig_swiginclude_headers = \
- gr_costas_loop_cc.i
+ digital_costas_loop_cc.i
if GUILE
TESTS += run_guile_tests
endif \ No newline at end of file
diff --git a/gr-digital/swig/gr_costas_loop_cc.i b/gr-digital/swig/digital_costas_loop_cc.i
index 488cab370..b339a3e65 100644
--- a/gr-digital/swig/gr_costas_loop_cc.i
+++ b/gr-digital/swig/digital_costas_loop_cc.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005,2006 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,20 +20,20 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(gr,costas_loop_cc);
+GR_SWIG_BLOCK_MAGIC(digital,costas_loop_cc);
-gr_costas_loop_cc_sptr
-gr_make_costas_loop_cc (float alpha, float beta,
+digital_costas_loop_cc_sptr
+digital_make_costas_loop_cc (float alpha, float beta,
float max_freq, float min_freq,
int order
) throw (std::invalid_argument);
-class gr_costas_loop_cc : public gr_sync_block
+class digital_costas_loop_cc : public gr_sync_block
{
private:
- gr_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq, int order);
+ digital_costas_loop_cc (float alpha, float beta,
+ float max_freq, float min_freq, int order);
public:
void set_alpha(float alpha);
diff --git a/gr-digital/swig/digital_swig.i b/gr-digital/swig/digital_swig.i
index 1134ed7e0..c3b049d72 100644
--- a/gr-digital/swig/digital_swig.i
+++ b/gr-digital/swig/digital_swig.i
@@ -22,10 +22,10 @@
%include "gnuradio.i"
%{
-#include "gr_costas_loop_cc.h"
+#include "digital_costas_loop_cc.h"
%}
-%include "gr_costas_loop_cc.i"
+%include "digital_costas_loop_cc.i"
#if SWIGGUILE
%scheme %{