Forum: GNU Radio Scope sink + multiple channels

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ad81d1e6e8493baa75befee55a8dce64?d=identicon&s=25 Jeffrey Karrels (Guest)
on 2007-07-06 21:00
(Received via mailing list)
Hello all

I have a complex signal coming in from the USRP that I am filtering
and sending to a scope_sink.  Now I wish to add a channel on that same
scope and output a square wave  It seems like I can do it, I am just
having issues of figuring out how to do it.

Any suggestions?

Thanks
Jeff
3596cfe1d579c65b9babd35e8787977c?d=identicon&s=25 Matt Ettus (Guest)
on 2007-07-06 21:56
(Received via mailing list)
Jeffrey Karrels wrote:
> Hello all
>
> I have a complex signal coming in from the USRP that I am filtering
> and sending to a scope_sink.  Now I wish to add a channel on that same
> scope and output a square wave  It seems like I can do it, I am just
> having issues of figuring out how to do it.


Just connect more signals to it:

    self.connect(other_thing,(scopesink,1))
    self.connect(yet_another_thing,(scopesink,2))

Matt
Ad81d1e6e8493baa75befee55a8dce64?d=identicon&s=25 Jeffrey Karrels (Guest)
on 2007-07-06 22:18
(Received via mailing list)
Sorry I was being lazy, I should have further defined my issue.
...
from gnuradio.wxgui import scopesink
...
self.scope = scopesink.scope_sink_c(self, panel,
sample_rate=input_rate,...)
...

self.connect(xf, (self.scope,0))
self.connect(d, (self.scope,1))
-------------------------------------------------------------
The second connect gives me the following error:

raise ValueError, 'port number out of range.'
ValueError: port number out of range.

Am I using the wrong scope? Do I have to add channels some how?


Thanks
Jeff
3596cfe1d579c65b9babd35e8787977c?d=identicon&s=25 Matt Ettus (Guest)
on 2007-07-06 22:21
(Received via mailing list)
Jeffrey Karrels wrote:
> -------------------------------------------------------------
> The second connect gives me the following error:
>
> raise ValueError, 'port number out of range.'
> ValueError: port number out of range.
>
> Am I using the wrong scope? Do I have to add channels some how?
>
>

I think you may need to use the _f version, and pass your complex
signals through a complex to float conversion.  The float scope takes up
to 4 signals.

Patches welcome :)

Matt
Ad81d1e6e8493baa75befee55a8dce64?d=identicon&s=25 Jeffrey Karrels (Guest)
on 2007-07-06 22:43
(Received via mailing list)
Thanks I will take a look at it.
Ad81d1e6e8493baa75befee55a8dce64?d=identicon&s=25 Jeffrey Karrels (Guest)
on 2007-07-06 22:48
(Received via mailing list)
Indeed the float allows more than 2 channels. I will take a look at
the complex scope to see what needs to be fixed.  You know I am
continually amazed by this software! I was just thinking how nice it
would be to have the magnitude displayed and BAM, complex_to_mag
presented itself.

This is great stuff!
141689c528c5212754cbead4acd52b46?d=identicon&s=25 Josh Blum (Guest)
on 2007-07-17 10:19
(Received via mailing list)
I dont see how the current scope sink can have more than one channel.
However, you could change the scopesink2's scope_sink_f to connect all
possible 16 inputs. Of course, this would only work with the hier2
stuff, but you would be able to use any number of inputs (1-16) without
fuss. This little trick will not work for the complex inputs. For
complex, you would have to use the scope_sink_f, and place a bunch of
complex to floats on the outside of the block.

-Josh

Possible Patch:

--- scopesink2.py       2007-07-17 04:04:18.000000000 -0400
+++ scopesink2_16.py    2007-07-17 04:06:09.000000000 -0400
@@ -38,12 +38,12 @@
                   v_scale=default_v_scale, t_scale=None):

          gr.hier_block2.__init__(self, "scope_sink_f",
-                                gr.io_signature(1, 1, gr.sizeof_float),
+                                gr.io_signature(1, 16,
gr.sizeof_float),
                                  gr.io_signature(0,0,0))

          msgq = gr.msg_queue(2)         # message queue that holds at
most 2 messages
          self.guts = gr.oscope_sink_f(sample_rate, msgq)
-        self.connect(self, self.guts)
+        for i in range(16): self.connect((self, i), (self.guts, i))

          self.win = scope_window(win_info (msgq, sample_rate,
frame_decim,
                                            v_scale, t_scale, self.guts,
title), parent)
This topic is locked and can not be replied to.