summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
authorEric Blossom2010-03-07 14:06:17 -0800
committerEric Blossom2010-03-07 14:06:17 -0800
commit324971d366b9b194d9a6af4ddd581f434d02cb43 (patch)
treeb0ae90229364296ab6ecd29d6b4bbb88dfc09e36 /gnuradio-core
parent901e0ad28d1f65eb10362fffd00693426db84ed4 (diff)
downloadgnuradio-324971d366b9b194d9a6af4ddd581f434d02cb43.tar.gz
gnuradio-324971d366b9b194d9a6af4ddd581f434d02cb43.tar.bz2
gnuradio-324971d366b9b194d9a6af4ddd581f434d02cb43.zip
Add check_topology, delete d_diff_filters in dtor, cleanup init and use of
logging output streams.
Diffstat (limited to 'gnuradio-core')
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc15
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h4
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.cc15
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.h6
4 files changed, 29 insertions, 11 deletions
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc
index 59454afe5..ff4fb70a3 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc
+++ b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2010 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -93,9 +93,16 @@ gr_pfb_clock_sync_ccf::~gr_pfb_clock_sync_ccf ()
{
for(int i = 0; i < d_nfilters; i++) {
delete d_filters[i];
+ delete d_diff_filters[i];
}
}
+bool
+gr_pfb_clock_sync_ccf::check_topology(int ninputs, int noutputs)
+{
+ return noutputs == 1 || noutputs == 4;
+}
+
void
gr_pfb_clock_sync_ccf::set_taps (const std::vector<float> &newtaps,
std::vector< std::vector<float> > &ourtaps,
@@ -219,8 +226,8 @@ gr_pfb_clock_sync_ccf::general_work (int noutput_items,
gr_complex *in = (gr_complex *) input_items[0];
gr_complex *out = (gr_complex *) output_items[0];
- float *err, *outrate, *outk;
- if(output_items.size() > 2) {
+ float *err = 0, *outrate = 0, *outk = 0;
+ if(output_items.size() == 4) {
err = (float *) output_items[1];
outrate = (float*)output_items[2];
outk = (float*)output_items[3];
@@ -271,7 +278,7 @@ gr_pfb_clock_sync_ccf::general_work (int noutput_items,
i++;
count += (int)floor(d_sps);
- if(output_items.size() > 2) {
+ if(output_items.size() == 4) {
err[i] = error;
outrate[i] = d_rate_f;
outk[i] = d_k;
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h
index a07192a7f..70857173b 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h
+++ b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2010 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -119,6 +119,8 @@ public:
d_max_dev = m;
}
+ bool check_topology(int ninputs, int noutputs);
+
int general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.cc b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.cc
index d1d2f05db..86de3b5a1 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.cc
+++ b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2010 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -93,9 +93,16 @@ gr_pfb_clock_sync_fff::~gr_pfb_clock_sync_fff ()
{
for(int i = 0; i < d_nfilters; i++) {
delete d_filters[i];
+ delete d_diff_filters[i];
}
}
+bool
+gr_pfb_clock_sync_fff::check_topology(int ninputs, int noutputs)
+{
+ return noutputs == 1 || noutputs == 4;
+}
+
void
gr_pfb_clock_sync_fff::set_taps (const std::vector<float> &newtaps,
std::vector< std::vector<float> > &ourtaps,
@@ -219,8 +226,8 @@ gr_pfb_clock_sync_fff::general_work (int noutput_items,
float *in = (float *) input_items[0];
float *out = (float *) output_items[0];
- float *err, *outrate, *outk;
- if(output_items.size() > 2) {
+ float *err = 0, *outrate = 0, *outk = 0;
+ if(output_items.size() == 4) {
err = (float *) output_items[1];
outrate = (float*)output_items[2];
outk = (float*)output_items[3];
@@ -269,7 +276,7 @@ gr_pfb_clock_sync_fff::general_work (int noutput_items,
i++;
count += (int)floor(d_sps);
- if(output_items.size() > 2) {
+ if(output_items.size() == 4) {
err[i] = error;
outrate[i] = d_rate_f;
outk[i] = d_k;
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.h b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.h
index 913f798fe..10eec4f54 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.h
+++ b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2010 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -118,7 +118,9 @@ public:
{
d_max_dev = m;
}
-
+
+ bool check_topology(int ninputs, int noutputs);
+
int general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,