commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r11587 - gnuradio/branches/developers/n4hy/pfb_iir2/gn


From: n4hy
Subject: [Commit-gnuradio] r11587 - gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general
Date: Wed, 12 Aug 2009 14:34:35 -0600 (MDT)

Author: n4hy
Date: 2009-08-12 14:34:34 -0600 (Wed, 12 Aug 2009)
New Revision: 11587

Modified:
   
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.cc
   
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.h
   
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.i
Log:
still beating on bugs

Modified: 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.cc
===================================================================
--- 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.cc
       2009-08-12 19:09:55 UTC (rev 11586)
+++ 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.cc
       2009-08-12 20:34:34 UTC (rev 11587)
@@ -187,7 +187,7 @@
 
     return rtn;
   }}
-  return (std::vector<double>) NULL;
+  return (vector<double>) NULL;
 }
 
 gr_iirdes::transfer_function
@@ -301,28 +301,33 @@
 {
   int size = tf.a.size();
   gsl_poly_complex_workspace *w;
-  double a(size),b(size),z(2*size);
+  double *a,*b;
+  gr_complexd *z;
   gr_iirdes::zpk rtn;
+  gr_complexd *zero, *pole;
   
   if (size < 2) throw std::invalid_argument
                  ("transfer function to pole, zero, gain calculation requires 
order 2 or greater");
 
-  std::vector<double> 
-  rtn.p.resize(size);
   w = gsl_poly_complex_workspace_alloc(size);
-  for (int i=0;i<size;i++)
-    a[i]=tf.a[i],
-      b[i]=tf.b[i];
+  z = new gr_complexd(size);
+  a = new double(size);
+  b = new double(size);
+  for (int i=0;i<size;i++) {
+    a[i]=tf.a[i];
+    b[i]=tf.b[i];
+  }
+
   // compute zeros
-  gsl_poly_complex_solve (a, size, w, z);
+  gsl_poly_complex_solve (&a[0], size, w, (double *)z);
   // store them in the zeros in the zpk array
   for (int i=0;i<size;i++)
-    rtn.z[i]=gr_complex(z[2*i],z[2*i+1]);
+    zero[i]=z[i];
 
   // compute poles
-  gsl_poly_complex_solve (b, size, w, z);
+  gsl_poly_complex_solve (&b[0], size, w, (double *)z);
   for (int i=0;i<size;i++)
-    rtn.p[i]=gr_complex(z[2*i],z[2*i+1]);
+    pole[i]=z[i];
   rtn.k = tf.b[0]/tf.a[0];
 
   return rtn;
@@ -330,7 +335,7 @@
 
 gr_iirdes::zpk
 gr_iirdes::sftrans(gr_iirdes::zpk ZeroPoleK,
-                  std::vector<double> W,
+                  vector<double> W,
                   bool stop)
 {
   gr_iirdes::zpk rtn;

Modified: 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.h
===================================================================
--- 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.h
        2009-08-12 19:09:55 UTC (rev 11586)
+++ 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.h
        2009-08-12 20:34:34 UTC (rev 11587)
@@ -60,8 +60,8 @@
   } transfer_function;
 
   typedef struct _zpk {
-    std::vector<gr_complex> *z;
-    std::vector<gr_complex> *p;
+    std::vector<gr_complexd> *z;
+    std::vector<gr_complexd> *p;
     double k;
   } zpk;
 

Modified: 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.i
===================================================================
--- 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.i
        2009-08-12 19:09:55 UTC (rev 11586)
+++ 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/general/gr_iirdes.i
        2009-08-12 20:34:34 UTC (rev 11587)
@@ -50,9 +50,9 @@
   } transfer_function;
 
   typedef struct _zpk {
-    std::vector<double> Z;
-    std::vector<double> P;
-    std::vector<double> k;
+    std::vector<double> *z;
+    std::vector<double> *p;
+    double               k;
   } zpk;
 
   typedef struct _sos {





reply via email to

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