discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] gr_firdes.cc/firdes.cc - window functions - flawe


From: KB3CS - Chris
Subject: Re: [Discuss-gnuradio] gr_firdes.cc/firdes.cc - window functions - flawe
Date: Mon, 7 Oct 2013 12:49:08 -0400

$ 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


reply via email to

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