Under extreme circumstances, optfir might never produce an answer (atten>300), so...
authorTom Rondeau <trondeau@vt.edu>
Tue, 28 Dec 2010 18:08:55 +0000 (13:08 -0500)
committerTom Rondeau <trondeau@vt.edu>
Tue, 28 Dec 2010 18:08:55 +0000 (13:08 -0500)
gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py
gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py
gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py
gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py

index c4e496c45acbf2c2d9ada86df0a9fefde67e13fe..5e4e06871411800a6f9a35d6ffa74f062d884f5a 100644 (file)
@@ -57,6 +57,10 @@ class pfb_arb_resampler_ccf(gr.hier_block2):
                     made = False
                     print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple))
 
+                    # Build in an exit strategy; if we've come this far, it ain't working.
+                    if(ripple >= 1.0):
+                        raise RuntimeError("optfir could not generate an appropriate filter.")
+
         self.pfb = gr.pfb_arb_resampler_ccf(self._rate, self._taps, self._size)
 
         self.connect(self, self.pfb)
index ecbdd2047660322772c1145548f7b163b71ba616..3ddc1749a7ba87c19e300d36feb61215cd506bfe 100644 (file)
@@ -54,6 +54,10 @@ class pfb_channelizer_ccf(gr.hier_block2):
                     made = False
                     print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple))
 
+                    # Build in an exit strategy; if we've come this far, it ain't working.
+                    if(ripple >= 1.0):
+                        raise RuntimeError("optfir could not generate an appropriate filter.")
+
         self.s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, self._numchans)
         self.pfb = gr.pfb_channelizer_ccf(self._numchans, self._taps,
                                           self._oversample_rate)
index 103980da02011908f32c3e32e41b9bcf0f5e2a17..2e36e7bc1d41d6b1f75e645a374656b7cf269e2b 100644 (file)
@@ -54,6 +54,10 @@ class pfb_decimator_ccf(gr.hier_block2):
                     made = False
                     print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple))
 
+                    # Build in an exit strategy; if we've come this far, it ain't working.
+                    if(ripple >= 1.0):
+                        raise RuntimeError("optfir could not generate an appropriate filter.")
+
         self.s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, self._decim)
         self.pfb = gr.pfb_decimator_ccf(self._decim, self._taps, self._channel)
 
index a210e3de82c53409144174ab93d1d5f7bb7e2c97..a6094f7f459f871352be2843a0ec8af54b2c0552 100644 (file)
@@ -45,7 +45,7 @@ class pfb_interpolator_ccf(gr.hier_block2):
             # Create a filter that covers the full bandwidth of the input signal
             bw = 0.4
             tb = 0.2
-            ripple = 0.1
+            ripple = 0.99
             made = False
             while not made:
                 try:
@@ -56,6 +56,10 @@ class pfb_interpolator_ccf(gr.hier_block2):
                     made = False
                     print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple))
 
+                    # Build in an exit strategy; if we've come this far, it ain't working.
+                    if(ripple >= 1.0):
+                        raise RuntimeError("optfir could not generate an appropriate filter.")
+
         self.pfb = gr.pfb_interpolator_ccf(self._interp, self._taps)
 
         self.connect(self, self.pfb)