Stream selector and changing variable after N samples

I have been experimenting with the stream selector in gnuradio
companion, but am stuck in situation.

First, how do I change a variable after N samples? I want the signal
to switch from a filter to another at a fixed rate, but blks2.selector
uses a variable to do the switching.

So, how could I change the value of this variable after N samples?

Am I missing any documentation on using variables to dynamically
change block behaviour? Looks like gr-extras is full of these
situations, but I can’t find documentation on how to use it.

On 12/05/2013 12:41 PM, Aylons H. wrote:

change block behaviour? Looks like gr-extras is full of these
situations, but I can’t find documentation on how to use it.

That stream selector block probably has about 4 different incarnations
:slight_smile: But in any case, it switches the stream based on a property which is
set asynchronously to the data flow.

In your case, you probably want to create a custom block that will
direct a flow of samples from the input to one of several outputs – the
key here being that the decision of how to direct the sample stream is
implemented in the work function so it can be synchronous with the
stream.

Hope that helps,
-josh