summaryrefslogtreecommitdiff
path: root/gr-wxgui/src/python/waterfall_window.py
diff options
context:
space:
mode:
authorJohnathan Corgan2009-09-02 14:38:37 -0700
committerJohnathan Corgan2009-09-02 14:38:37 -0700
commit72afd843cfa4037eb0a059a647c952b7e5ddf25c (patch)
treee70794c5f51fec80e90c76456ce96e27193aafa8 /gr-wxgui/src/python/waterfall_window.py
parenta36c92ed48fb80c78a97a200b92b98d36a7d4c05 (diff)
parenta70c291e3cd4fc3d51f2eebb6b39cdb9d46862da (diff)
downloadgnuradio-72afd843cfa4037eb0a059a647c952b7e5ddf25c.tar.gz
gnuradio-72afd843cfa4037eb0a059a647c952b7e5ddf25c.tar.bz2
gnuradio-72afd843cfa4037eb0a059a647c952b7e5ddf25c.zip
Merge branch 'wxgui_fix' from http://gnuradio.org/git/jblum.git into master
* waterfall and fft use a common autoscale function * Fix so that the waterfall texture is initialized with a buffer of the same size.
Diffstat (limited to 'gr-wxgui/src/python/waterfall_window.py')
-rw-r--r--gr-wxgui/src/python/waterfall_window.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/gr-wxgui/src/python/waterfall_window.py b/gr-wxgui/src/python/waterfall_window.py
index c00992e14..28e67a830 100644
--- a/gr-wxgui/src/python/waterfall_window.py
+++ b/gr-wxgui/src/python/waterfall_window.py
@@ -237,16 +237,10 @@ class waterfall_window(wx.Panel, pubsub.pubsub):
Does not affect the current data in the waterfall.
"""
if not len(self.samples): return
- #get the peak level (max of the samples)
- peak_level = numpy.max(self.samples)
- #get the noise floor (averge the smallest samples)
- noise_floor = numpy.average(numpy.sort(self.samples)[:len(self.samples)/4])
- #padding
- noise_floor -= abs(noise_floor)*.5
- peak_level += abs(peak_level)*.1
+ min_level, max_level = common.get_min_max_fft(self.samples)
#set the range and level
- self[REF_LEVEL_KEY] = peak_level
- self[DYNAMIC_RANGE_KEY] = peak_level - noise_floor
+ self[REF_LEVEL_KEY] = max_level
+ self[DYNAMIC_RANGE_KEY] = max_level - min_level
def handle_msg(self, msg):
"""