Dynamically changing input index of Selector block

Hi all,

In my flow graph I am using two different inputs. At particular time,
only
one input is selected.
For this I am using ‘Selector’ block with two inputs and only one
output.

I want to change ‘input index’ of ‘Selector’ block when flow graph is
running. I used ‘WX GUI Slider’ block, it works but each time I have to
change input index manually from top_block window.

My GRC flow graph design is as follows:

Two different signal sources => selector (with 2 input & 1 output) =>
scope

Now I want to change input index of ‘Selector’ block automatically so
that
for fixed time 1st input is selected and then 2nd.

Please help me how to do this ?

Thanks and Regards,

Dushyant


View this message in context:
http://gnuradio.4.n7.nabble.com/Dynamically-changing-input-index-of-Selector-block-tp48550.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Tue, May 27, 2014 at 3:07 PM, dushyant.marathe
<[email protected]

wrote:

My GRC flow graph design is as follows:

Two different signal sources => selector (with 2 input & 1 output) => scope

Now I want to change input index of ‘Selector’ block automatically so that
for fixed time 1st input is selected and then 2nd.

You may try to use Stream Mux, not Selector.
When its Lengths is determined correctly, it select 1st input for a
predetermined fixed time, then select 2nd input.
In this case the second number of Length is a big number, approximate
infinity.

Hi Activecat,

Thanks for the reply.

As suggested by you, I used “Stream Mux” and it worked for me.

Now I want to de-multiplex the output of “Stream Mux” so as to get back
both
the inputs separately.

If you have any suggestions, please let me know.

Thanks and Regards,
Dushyant


View this message in context:
http://gnuradio.4.n7.nabble.com/Dynamically-changing-input-index-of-Selector-block-tp48550p48614.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Thu, May 29, 2014 at 2:59 PM, dushyant.marathe
<[email protected]

wrote:

Hi Activecat,

Thanks for the reply.

As suggested by you, I used “Stream Mux” and it worked for me.

Now I want to de-multiplex the output of “Stream Mux” so as to get back
both
the inputs separately.

[email protected]

Use both “Head” and “Skip Head” blocks in parallel.

For example, the Head block let you get the first 1000 elements.
The “Skip Head” block let you get elements 1001 onwards.

Hi Activecat,

I used both “Head” and “Skip Head” blocks in parallel to separate out
multiplexed input stream.
The Head block correctly gives me first 240k elements but, “Skip Head”
block doesn’t give me any elements after skipping 240k elements. For
your
reference I have attached image of my flow graph (Head_Skip_Head.jpg).

http://gnuradio.4.n7.nabble.com/file/n48637/Head_Skip_Head.jpg

Moreover when I used “Skip Head” block alone, it gives me correctly all
the
elements after skipping 240k elements.

Why is it so ? I could not find out. Please give me some insight.

Thanks & Regards,
Dushyant


View this message in context:
http://gnuradio.4.n7.nabble.com/Dynamically-changing-input-index-of-Selector-block-tp48550p48637.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Fri, May 30, 2014 at 4:57 PM, dushyant.marathe
<[email protected]

wrote:

Moreover when I used “Skip Head” block alone, it gives me correctly all the
elements after skipping 240k elements.

Why is it so ? I could not find out. Please give me some insight.

Try with “File Sink” first instead of “Wave File Sink”, this may make a
difference.

On Fri, May 30, 2014 at 10:20 PM, Mike J. [email protected]
wrote:

FYI, the head block “copies the first N items to the output then signals
done”:
GNU Radio Manual and C++ API Reference: gr::blocks::head Class Reference

Instead of using the “Head” block, the “Keep M in N” block should do the
trick.

You know your requirements well, let’s pick whichever suits you best.

Problem being is that as soon as the head block signals “done”, the
flowgraph might come to a halt, effectively breaking the skip head
subgraph;
how many samples are still produced after head is done depends on timing
and buffer size…
I think that’s why Mike recommended the “M in N”, so you only have one
runtime-limiting block in your flowgraph.

Greetings,
Marcus

On Sat, May 31, 2014 at 5:37 PM, Marcus Müller
[email protected]
wrote:

Problem being is that as soon as the head block signals “done”, the
flowgraph might come to a halt, effectively breaking the skip head
subgraph;

Thanks for highlighting this.
Now I recall that the Head block return -1 when it is done.
This makes a very good sense to use alternative likes “M in N” block.
Thanks.

FYI, the head block “copies the first N items to the output then signals
done”:

http://gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1head.html

Instead of using the “Head” block, the “Keep M in N” block should do the
trick.

Mike


Mike J. M0MIK BSc MIET
Ettus R. Technical Support
Email: [email protected]
Web: http://ettus.com