summaryrefslogtreecommitdiff
path: root/gr-utils/src
diff options
context:
space:
mode:
Diffstat (limited to 'gr-utils/src')
-rwxr-xr-xgr-utils/src/python/gr_plot_const.py2
-rwxr-xr-xgr-utils/src/python/gr_plot_fft.py13
2 files changed, 9 insertions, 6 deletions
diff --git a/gr-utils/src/python/gr_plot_const.py b/gr-utils/src/python/gr_plot_const.py
index 9e4920776..5dd08c9a0 100755
--- a/gr-utils/src/python/gr_plot_const.py
+++ b/gr-utils/src/python/gr_plot_const.py
@@ -138,7 +138,7 @@ class draw_constellation:
def zoom(self, event):
newxlim = scipy.array(self.sp_iq.get_xlim())
curxlim = scipy.array(self.xlim)
- if(newxlim.all() != curxlim.all()):
+ if(newxlim[0] != curxlim[0] or newxlim[1] != curxlim[1]):
self.xlim = newxlim
r = self.reals[int(ceil(self.xlim[0])) : int(ceil(self.xlim[1]))]
i = self.imags[int(ceil(self.xlim[0])) : int(ceil(self.xlim[1]))]
diff --git a/gr-utils/src/python/gr_plot_fft.py b/gr-utils/src/python/gr_plot_fft.py
index bb21f3dcd..ba3901e03 100755
--- a/gr-utils/src/python/gr_plot_fft.py
+++ b/gr-utils/src/python/gr_plot_fft.py
@@ -89,7 +89,8 @@ class gr_plot_fft:
self.iq_fft = self.dofft(self.iq)
tstep = 1.0 / self.sample_rate
- self.time = scipy.array([tstep*(self.position + i) for i in xrange(len(self.iq))])
+ #self.time = scipy.array([tstep*(self.position + i) for i in xrange(len(self.iq))])
+ self.time = scipy.array([tstep*(i) for i in xrange(len(self.iq))])
self.freq = self.calc_freq(self.time, self.sample_rate)
@@ -158,10 +159,12 @@ class gr_plot_fft:
def zoom(self, event):
newxlim = scipy.array(self.sp_iq.get_xlim())
curxlim = scipy.array(self.xlim)
- if(newxlim.all() != curxlim.all()):
+ if(newxlim[0] != curxlim[0] or newxlim[1] != curxlim[1]):
self.xlim = newxlim
- xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0] - self.position))))
- xmax = min(int(ceil(self.sample_rate*(self.xlim[1] - self.position))), len(self.iq))
+ #xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0] - self.position))))
+ #xmax = min(int(ceil(self.sample_rate*(self.xlim[1] - self.position))), len(self.iq))
+ xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0]))))
+ xmax = min(int(ceil(self.sample_rate*(self.xlim[1]))), len(self.iq))
iq = self.iq[xmin : xmax]
time = self.time[xmin : xmax]
@@ -171,7 +174,7 @@ class gr_plot_fft:
self.plot_fft[0].set_data(freq, iq_fft)
self.sp_fft.axis([freq.min(), freq.max(),
- iq_fft.min()-10, iq_fftmax()+10])
+ iq_fft.min()-10, iq_fft.max()+10])
draw()