summaryrefslogtreecommitdiff
path: root/gr-utils/src/python/gr_plot_psd.py
diff options
context:
space:
mode:
authorTom Rondeau2011-01-15 17:21:14 -0500
committerTom Rondeau2011-01-15 17:21:14 -0500
commit7b5095514204a524afbf6fd97bb70511519e5b35 (patch)
tree05f87c66d27657e27baf1e907ba6affa15c70606 /gr-utils/src/python/gr_plot_psd.py
parent3ad8f8ed993cccae7492bf0fa8519ebe15567101 (diff)
downloadgnuradio-7b5095514204a524afbf6fd97bb70511519e5b35.tar.gz
gnuradio-7b5095514204a524afbf6fd97bb70511519e5b35.tar.bz2
gnuradio-7b5095514204a524afbf6fd97bb70511519e5b35.zip
Using .min and .max on scipy arrays instead of min() max(); seems to be more portable.
Diffstat (limited to 'gr-utils/src/python/gr_plot_psd.py')
-rwxr-xr-xgr-utils/src/python/gr_plot_psd.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/gr-utils/src/python/gr_plot_psd.py b/gr-utils/src/python/gr_plot_psd.py
index b386d35ab..1b653d61a 100755
--- a/gr-utils/src/python/gr_plot_psd.py
+++ b/gr-utils/src/python/gr_plot_psd.py
@@ -94,7 +94,7 @@ class gr_plot_psd:
print "End of File"
else:
tstep = 1.0 / self.sample_rate
- self.time = [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.iq_psd, self.freq = self.dopsd(self.iq)
@@ -154,13 +154,14 @@ class gr_plot_psd:
imags = self.iq.imag
self.plot_iq[0].set_data([self.time, reals])
self.plot_iq[1].set_data([self.time, imags])
- self.sp_iq.set_xlim(min(self.time), max(self.time))
- self.sp_iq.set_ylim([1.5*min([min(reals), min(imags)]),
- 1.5*max([max(reals), max(imags)])])
+ self.sp_iq.set_xlim(self.time.min(), self.time.max())
+ self.sp_iq.set_ylim([1.5*min([reals.min(), imags.min()]),
+ 1.5*max([reals.max(), imags.max()])])
def draw_psd(self):
self.plot_psd[0].set_data([self.freq, self.iq_psd])
- self.sp_psd.set_ylim([min(self.iq_psd)-10, max(self.iq_psd)+10])
+ self.sp_psd.set_ylim([self.iq_psd.min()-10, self.iq_psd.max()+10])
+ self.sp_psd.set_xlim([self.freq.min(), self.freq.max()])
def draw_spec(self):
overlap = self.specfftsize/4
@@ -168,7 +169,7 @@ class gr_plot_psd:
self.sp_spec.clear()
self.sp_spec.specgram(self.iq, self.specfftsize, self.sample_rate,
window = lambda d: d*winfunc(self.specfftsize),
- noverlap = overlap, xextent=[min(self.time), max(self.time)])
+ noverlap = overlap, xextent=[self.time.min(), self.time.max()])
def update_plots(self):
self.draw_time()
@@ -194,8 +195,8 @@ class gr_plot_psd:
iq_psd, freq = self.dopsd(iq)
self.plot_psd[0].set_data(freq, iq_psd)
- self.sp_psd.axis([min(freq), max(freq),
- min(iq_psd)-10, max(iq_psd)+10])
+ self.sp_psd.axis([freq.min(), freq.max(),
+ iq_psd.min()-10, iq_psd.max()+10])
draw()