Add check_topology, delete d_diff_filters in dtor, cleanup init and use of
authorEric Blossom <eb@comsec.com>
Sun, 7 Mar 2010 22:06:17 +0000 (14:06 -0800)
committerEric Blossom <eb@comsec.com>
Sun, 7 Mar 2010 22:06:17 +0000 (14:06 -0800)
logging output streams.

gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc
gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h
gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.cc
gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.h

index 59454afe5fa60b02f88af37577ae6101f9b6eccd..ff4fb70a36eed08aa623374a0ccf3e2128c622f3 100644 (file)
@@ -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;
index a07192a7f34dcfeb52b4f2290601bf3bc632e705..70857173bfdf2929d03b9df9f6b7d9fbec6c9e36 100644 (file)
@@ -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,
index d1d2f05dbe25e9d431f824b8b6fdd0641803ffdf..86de3b5a1c17fe2ec3e3864a9344a1839e8a148e 100644 (file)
@@ -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;
index 913f798fefccb6fdac3c7de4622f047ff3fad971..10eec4f5407c705fb5eddda7651b55a8a0c53895 100644 (file)
@@ -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,