[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r8738 - gnuradio/branches/developers/jblum/gr-wxglgui/
From: |
jblum |
Subject: |
[Commit-gnuradio] r8738 - gnuradio/branches/developers/jblum/gr-wxglgui/src/python |
Date: |
Fri, 27 Jun 2008 11:19:37 -0600 (MDT) |
Author: jblum
Date: 2008-06-27 11:19:34 -0600 (Fri, 27 Jun 2008)
New Revision: 8738
Modified:
gnuradio/branches/developers/jblum/gr-wxglgui/src/python/fftsink.py
Log:
fixed real plot
Modified: gnuradio/branches/developers/jblum/gr-wxglgui/src/python/fftsink.py
===================================================================
--- gnuradio/branches/developers/jblum/gr-wxglgui/src/python/fftsink.py
2008-06-27 06:46:57 UTC (rev 8737)
+++ gnuradio/branches/developers/jblum/gr-wxglgui/src/python/fftsink.py
2008-06-27 17:19:34 UTC (rev 8738)
@@ -386,17 +386,18 @@
set_average=fft.set_average,
)
#setup x grid and setup the input watcher
- if self.real: input_watcher(fft.msgq, self.win.plot)
- else: input_watcher(fft.msgq, self._handle_complex_samples)
+ input_watcher(fft.msgq, self._handle_samples)
- def _handle_complex_samples(self, samples):
+ def _handle_samples(self, samples):
"""!
- Reorder the complex fft samples so the negative bins come first
+ If complex, reorder the fft samples so the negative bins come
first.
+ If real, keep take only the positive bins.
@param samples an array of fft samples
"""
num_samples = len(samples)
- samples = numpy.concatenate((samples[num_samples/2+1:],
samples[:num_samples/2]))
- self.win.plot(samples)
+ if self.real: samples = samples[:num_samples/2]
+ else: samples = numpy.concatenate((samples[num_samples/2+1:],
samples[:num_samples/2]))
+ self.win.plot(samples)
class fft_sink_f(_fft_sink_base): item_size = gr.sizeof_float
class fft_sink_c(_fft_sink_base): item_size = gr.sizeof_gr_complex
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r8738 - gnuradio/branches/developers/jblum/gr-wxglgui/src/python,
jblum <=