commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 04/04: qtgui: spectrogram offline plotter:


From: git
Subject: [Commit-gnuradio] [gnuradio] 04/04: qtgui: spectrogram offline plotter: changed title to just the data type read from the header. Also fixes issues with short and int support.
Date: Sun, 4 Jan 2015 20:47:53 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch master
in repository gnuradio.

commit da122a977c9afe60f9696c5b0e452078ba75328d
Author: Tom Rondeau <address@hidden>
Date:   Sun Jan 4 15:44:00 2015 -0500

    qtgui: spectrogram offline plotter: changed title to just the data type 
read from the header. Also fixes issues with short and int support.
---
 gr-qtgui/apps/gr_spectrogram_plot | 46 ++++++++++++++++++++++++++-------------
 1 file changed, 31 insertions(+), 15 deletions(-)

diff --git a/gr-qtgui/apps/gr_spectrogram_plot 
b/gr-qtgui/apps/gr_spectrogram_plot
index 73ccd2f..db79f9d 100755
--- a/gr-qtgui/apps/gr_spectrogram_plot
+++ b/gr-qtgui/apps/gr_spectrogram_plot
@@ -52,8 +52,8 @@ class spectrogram_plot_c(plot_base.plot_base):
         self.dsize = gr.sizeof_gr_complex
         self.src_type = blocks.vector_source_c
         self.gui_snk = qtgui.waterfall_sink_c(self._psd_size,
-                       filter.firdes.WIN_BLACKMAN_hARRIS,self._center_freq, 
-                       self._samp_rate,"GNU Radio Spectrogram Plot (CPX 
Float)", 
+                       filter.firdes.WIN_BLACKMAN_hARRIS,self._center_freq,
+                       self._samp_rate,"Complex Float",
                        self._nsigs)
         self.setup()
 
@@ -66,10 +66,10 @@ class spectrogram_plot_f(plot_base.plot_base):
         self.read_samples = plot_base.read_samples_f
         self.dsize = gr.sizeof_float
         self.src_type = blocks.vector_source_f
-        self.gui_snk = qtgui.waterfall_sink_f(self._psd_size, 
-                       filter.firdes.WIN_BLACKMAN_hARRIS,self._center_freq, 
+        self.gui_snk = qtgui.waterfall_sink_f(self._psd_size,
+                       filter.firdes.WIN_BLACKMAN_hARRIS,self._center_freq,
                        self._samp_rate,
-                       "GNU Radio Spectrogram Plot (float)", 
+                       "Float",
                        self._nsigs)
         self.setup()
 
@@ -82,9 +82,9 @@ class spectrogram_plot_b(plot_base.plot_base):
         self.read_samples = plot_base.read_samples_b
         self.dsize = gr.sizeof_float
         self.src_type = plot_base.source_chars_to_float
-        self.gui_snk = qtgui.waterfall_sink_f(self._psd_size, 
-                       filter.firdes.WIN_BLACKMAN_hARRIS,self._center_freq, 
-                       self._samp_rate, "GNU Radio Spectrogram Plot (bin)", 
+        self.gui_snk = qtgui.waterfall_sink_f(self._psd_size,
+                       filter.firdes.WIN_BLACKMAN_hARRIS,self._center_freq,
+                       self._samp_rate, "Bytes",
                        self._nsigs)
         self.setup()
 
@@ -94,12 +94,29 @@ class spectrogram_plot_i(plot_base.plot_base):
         plot_base.plot_base.__init__(self, filelist, fc, samp_rate,
                                      psdsize, start, nsamples,
                                      max_nsamples, avg)
+        self.read_samples = plot_base.read_samples_i
         self.dsize = gr.sizeof_float
         self.src_type = plot_base.source_ints_to_float
-        self.gui_snk = qtgui.waterfall_sink_f(self._psd_size, 
+        self.gui_snk = qtgui.waterfall_sink_f(self._psd_size,
                        filter.firdes.WIN_BLACKMAN_hARRIS,
                        self._center_freq, self._samp_rate,
-                       "GNU Radio Spectrogram Plot (int)", 
+                       "Integers",
+                       self._nsigs)
+        self.setup()
+
+class spectrogram_plot_s(plot_base.plot_base):
+    def __init__(self, filelist, fc, samp_rate, psdsize, start,
+                 nsamples, max_nsamples, avg=1.0):
+        plot_base.plot_base.__init__(self, filelist, fc, samp_rate,
+                                     psdsize, start, nsamples,
+                                     max_nsamples, avg)
+        self.read_samples = plot_base.read_samples_s
+        self.dsize = gr.sizeof_float
+        self.src_type = plot_base.source_shorts_to_float
+        self.gui_snk = qtgui.waterfall_sink_f(self._psd_size,
+                       filter.firdes.WIN_BLACKMAN_hARRIS,
+                       self._center_freq, self._samp_rate,
+                       "Shorts",
                        self._nsigs)
         self.setup()
 
@@ -108,7 +125,7 @@ def read_header(filelist):
    try:
       handle = open(filename,"rb")
    except IOError:
-      return 
+      return
    hdr_start = handle.tell()
    header_str = handle.read(parse_file_metadata.HEADER_LENGTH)
    if( len(header_str) == 0 ):
@@ -121,9 +138,9 @@ def read_header(filelist):
       sys.exit(1)
    info = parse_file_metadata.parse_header(header,False)
    return info
-   
+
 def main():
-   description = 'Plots the spectrogram (waterfall) of a file with detached 
header.'  
+   description = 'Plots the spectrogram (waterfall) of a file with detached 
header.'
    description += ' Assumes header is <input_filename>.hdr'
    (options, args) = plot_base.setup_options(description)
    filelist = list(args)
@@ -133,7 +150,7 @@ def main():
    if not info:
       sys.stderr.write('Header not found\n')
       sys.exit(1)
-      
+
    max_nsamples = plot_base.find_max_nsamples(filelist)
    srate = info["rx_rate"]
 
@@ -187,4 +204,3 @@ if __name__ == "__main__":
         main()
     except KeyboardInterrupt:
         pass
-



reply via email to

[Prev in Thread] Current Thread [Next in Thread]