Forum: GNU Radio Re: gr_firdes.cc/firdes.cc - window functions - flawe

Ab2d6b4f6f5c74d73383f51e290b275a?d=identicon&s=25 KB3CS - Chris (Guest)
on 2013-10-07 18:50
(Received via mailing list)
$ git diff v3.6.3 HEAD gr-filter/lib/firdes.cc  (but modified since you
remain @ v3.6.3)

diff --git a/gr-filter/lib/firdes.cc b/gr-filter/lib/firdes.cc
index 5c3320d..d55a4ba 100644
--- a/gr-filter/lib/firdes.cc
+++ b/gr-filter/lib/firdes.cc
@@ -746,6 +746,7 @@ namespace gr {
       case WIN_RECTANGULAR:
        for(int n = 0; n < ntaps; n++)
          taps[n] = 1;
+        break;

       case WIN_HAMMING:
        for(int n = 0; n < ntaps; n++)
@@ -774,16 +775,13 @@ namespace gr {
          double IBeta = 1.0/Izero(beta);
          double inm1 = 1.0/((double)(ntaps));
          double temp;
-         //fprintf(stderr, "IBeta = %g; inm1 = %g\n", IBeta, inm1);

-         for(int i=0; i<ntaps; i++) {
-           temp = i * inm1;
-           //fprintf(stderr, "temp = %g\n", temp);
-           taps[i] = Izero(beta*sqrt(1.0-temp*temp)) * IBeta;
-           //fprintf(stderr, "taps[%d] = %g\n", i, taps[i]);
-         }
+         for(int i= 0; i<ntaps; i++) {
+            temp = 2*i*inm1 - 1;
+            taps[i] = Izero(beta*sqrt(1.0-temp*temp)) * IBeta;
+          }
        }
-      break;
+       break;

       default:
        throw std::out_of_range("firdes:window: type out of range");
@@ -804,7 +802,7 @@ namespace gr {
        throw std::out_of_range("firdes check failed: 0 < fa <=
sampling_freq / 2");

       if(transition_width <= 0)
-       throw std::out_of_range("gr_dirdes check failed:
transition_width >
0");
+       throw std::out_of_range("gr_firdes check failed:
transition_width >
0");
     }

     void

.. but don't make the #include file changes in your v3.6.3 and you
should
change the version number (VERSION_INFO_MAINT_VERSION) in CMakeLists.txt
4eff8471dd77455a25564f9df9b2bd2e?d=identicon&s=25 bob wole (Guest)
on 2013-10-08 20:26
(Received via mailing list)
Hi Tom and Chris,

Thanks for your detailed guidance on this. I'll try this out.

Bob
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.