diff options
author | jblum | 2008-10-10 21:13:33 +0000 |
---|---|---|
committer | jblum | 2008-10-10 21:13:33 +0000 |
commit | 3fc664ececbafa04ab5a117b418cb7b4fc0652c6 (patch) | |
tree | e083ddbe197729a6f3131fa1341afa952b38a3d9 /gr-wxgui/src/python/fft_window.py | |
parent | 4bea843cfe50369eed9ac13d7c60e28214804845 (diff) | |
download | gnuradio-3fc664ececbafa04ab5a117b418cb7b4fc0652c6.tar.gz gnuradio-3fc664ececbafa04ab5a117b418cb7b4fc0652c6.tar.bz2 gnuradio-3fc664ececbafa04ab5a117b418cb7b4fc0652c6.zip |
check for samples before autoscale, avoids potential error condition
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9767 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-wxgui/src/python/fft_window.py')
-rw-r--r-- | gr-wxgui/src/python/fft_window.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gr-wxgui/src/python/fft_window.py b/gr-wxgui/src/python/fft_window.py index e7affb1b0..6e54aec87 100644 --- a/gr-wxgui/src/python/fft_window.py +++ b/gr-wxgui/src/python/fft_window.py @@ -149,6 +149,7 @@ class fft_window(wx.Panel, pubsub.pubsub, common.prop_setter): #ensure y_per_div if y_per_div not in DIV_LEVELS: y_per_div = DIV_LEVELS[0] #setup + self.samples = list() self.ext_controller = controller self.real = real self.fft_size = fft_size @@ -197,6 +198,7 @@ class fft_window(wx.Panel, pubsub.pubsub, common.prop_setter): Autoscale the fft plot to the last frame. Set the dynamic range and reference level. """ + 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) |