commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10329 - gnuradio/trunk/gr-wxgui/src/python


From: jblum
Subject: [Commit-gnuradio] r10329 - gnuradio/trunk/gr-wxgui/src/python
Date: Wed, 28 Jan 2009 12:52:46 -0700 (MST)

Author: jblum
Date: 2009-01-28 12:52:45 -0700 (Wed, 28 Jan 2009)
New Revision: 10329

Modified:
   gnuradio/trunk/gr-wxgui/src/python/common.py
   gnuradio/trunk/gr-wxgui/src/python/scope_window.py
Log:
fixed 2 scaling bugs in scopesink

Modified: gnuradio/trunk/gr-wxgui/src/python/common.py
===================================================================
--- gnuradio/trunk/gr-wxgui/src/python/common.py        2009-01-28 19:09:53 UTC 
(rev 10328)
+++ gnuradio/trunk/gr-wxgui/src/python/common.py        2009-01-28 19:52:45 UTC 
(rev 10329)
@@ -259,7 +259,7 @@
        """
        scale_factor = 3
        mean = numpy.average(samples)
-       rms = scale_factor*((numpy.sum((samples-mean)**2)/len(samples))**.5)
+       rms = 
numpy.max([scale_factor*((numpy.sum((samples-mean)**2)/len(samples))**.5), .1])
        min = mean - rms
        max = mean + rms
        return min, max

Modified: gnuradio/trunk/gr-wxgui/src/python/scope_window.py
===================================================================
--- gnuradio/trunk/gr-wxgui/src/python/scope_window.py  2009-01-28 19:09:53 UTC 
(rev 10328)
+++ gnuradio/trunk/gr-wxgui/src/python/scope_window.py  2009-01-28 19:52:45 UTC 
(rev 10329)
@@ -411,8 +411,8 @@
                        #autorange
                        if self[AUTORANGE_KEY] and time.time() - 
self.autorange_ts > AUTORANGE_UPDATE_RATE:
                                bounds = [common.get_min_max(samples) for 
samples in sampleses]
-                               y_min = numpy.min(*[bound[0] for bound in 
bounds])
-                               y_max = numpy.max(*[bound[1] for bound in 
bounds])
+                               y_min = numpy.min([bound[0] for bound in 
bounds])
+                               y_max = numpy.max([bound[1] for bound in 
bounds])
                                #adjust the y per div
                                y_per_div = 
common.get_clean_num((y_max-y_min)/self[Y_DIVS_KEY])
                                if y_per_div != self[Y_PER_DIV_KEY]: 
self.set_y_per_div(y_per_div)





reply via email to

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