commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r9841 - in gnuradio/branches/developers/eb/frank/gnura


From: brickle
Subject: [Commit-gnuradio] r9841 - in gnuradio/branches/developers/eb/frank/gnuradio-core/src: lib/general python/gnuradio/gr
Date: Sat, 25 Oct 2008 15:13:31 -0600 (MDT)

Author: brickle
Date: 2008-10-25 15:13:29 -0600 (Sat, 25 Oct 2008)
New Revision: 9841

Modified:
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.cc
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.cc
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/qa_classify.py
Log:
classification blocks again, this time for sure

Modified: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.cc
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.cc
        2008-10-25 20:59:35 UTC (rev 9840)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.cc
        2008-10-25 21:13:29 UTC (rev 9841)
@@ -55,9 +55,13 @@
 {
   d_wavelet = gsl_wavelet_alloc(gsl_wavelet_daubechies, d_order);
   if (d_wavelet == NULL)
-    throw std::invalid_argument("can't allocate wavelet");
+    throw std::runtime_error("can't allocate wavelet");
   d_workspace = gsl_wavelet_workspace_alloc(d_size);
+  if (d_workspace == NULL)
+    throw std::runtime_error("can't allocate wavelet workspace");
   d_temp = (double *) malloc(d_size*sizeof(double));
+  if (d_workspace == NULL)
+    throw std::runtime_error("can't allocate wavelet double conversion temp");
 }
 
 gr_wavelet_ff::~gr_wavelet_ff()
@@ -92,7 +96,7 @@
                                    d_size,
                                    d_workspace);
     
-    for (int i = 0; i < noutput_items; i++)
+    for (int i = 0; i < d_size; i++)
       out[i] = d_temp[i];
 
     in  += d_size;

Modified: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.cc
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.cc
   2008-10-25 20:59:35 UTC (rev 9840)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.cc
   2008-10-25 21:13:29 UTC (rev 9841)
@@ -29,7 +29,7 @@
 #include <string.h>
 
 inline int
-np2(int k)
+power_of_2_or_next(int k)
 {
   int m = 0;
   for (int n = k-1; n > 0; n >>= 1) m++;
@@ -45,10 +45,10 @@
 gr_wvps_ff::gr_wvps_ff(int ilen)
   : gr_sync_block("wvps_ff",
                  gr_make_io_signature(1, 1, sizeof(float) * ilen),
-                 gr_make_io_signature(1, 1, sizeof(float) * np2(ilen))),
+                 gr_make_io_signature(1, 1, sizeof(float) * 
power_of_2_or_next(ilen))),
     d_ilen(ilen)
 {
-  d_olen = np2(d_ilen);
+  d_olen = power_of_2_or_next(d_ilen);
 }
 
 // input vector assumed to be output from gsl wavelet computation

Modified: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/qa_classify.py
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/qa_classify.py
   2008-10-25 20:59:35 UTC (rev 9840)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/qa_classify.py
   2008-10-25 21:13:29 UTC (rev 9841)
@@ -119,7 +119,7 @@
         e = dst.data()
 
         sum = 0
-        for (u, v) in zip(b, d):
+        for (u, v) in zip(c, e):
             w = u - v
             sum += w * w
         sum /= float(len(c))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]