diff options
author | jcorgan | 2007-11-08 20:50:47 +0000 |
---|---|---|
committer | jcorgan | 2007-11-08 20:50:47 +0000 |
commit | 28edd49f3d5c1e7eb2f3f2826726bf688f037b1f (patch) | |
tree | aa24a9f5605733b3417cbb89439049d379bb1ed1 /gr-utils/src | |
parent | 9e9d90d528c8833c5b6a0a0982d7df198b6c9451 (diff) | |
download | gnuradio-28edd49f3d5c1e7eb2f3f2826726bf688f037b1f.tar.gz gnuradio-28edd49f3d5c1e7eb2f3f2826726bf688f037b1f.tar.bz2 gnuradio-28edd49f3d5c1e7eb2f3f2826726bf688f037b1f.zip |
Fix for working with peak hold in usrp_fft.py
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6839 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-utils/src')
-rwxr-xr-x | gr-utils/src/python/usrp_fft.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gr-utils/src/python/usrp_fft.py b/gr-utils/src/python/usrp_fft.py index fae5ae4cd..58da67147 100755 --- a/gr-utils/src/python/usrp_fft.py +++ b/gr-utils/src/python/usrp_fft.py @@ -235,7 +235,7 @@ class app_top_block(stdgui2.std_top_block): self.myform['baseband'].set_value(r.baseband_freq) self.myform['ddc'].set_value(r.dxc_freq) if not self.options.waterfall and not self.options.oscilloscope: - self.scope.set_baseband_freq(target_freq) + self.scope.win.set_baseband_freq(target_freq) return True return False @@ -264,9 +264,16 @@ class app_top_block(stdgui2.std_top_block): if event.CmdDown(): # Re-center on maximum power points = self.scope.win._points - ind = numpy.argmax(points[:,1]) + if self.scope.win.peak_hold: + if self.scope.win.peak_vals is not None: + ind = numpy.argmax(self.scope.win.peak_vals) + else: + ind = int(points.shape()[0]/2) + else: + ind = numpy.argmax(points[:,1]) (freq, pwr) = points[ind] target_freq = freq/self.scope.win._scale_factor + print ind, freq, pwr self.set_freq(target_freq) else: # Re-center on clicked frequency |