# Question on state machine implementation in GNURadio

**URL:** <https://www.ruby-forum.com/t/question-on-state-machine-implementation-in-gnuradio/242148>\
**Category:** GNU Radio\
**Created:** [May 31, 2015, 7:37am UTC](https://www.ruby-forum.com/t/question-on-state-machine-implementation-in-gnuradio/242148 "2015-05-31T07:37:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [May 31, 2015, 7:37am UTC](https://www.ruby-forum.com/t/question-on-state-machine-implementation-in-gnuradio/242148/1 "2015-05-31T07:37:07Z")

</div>

Hi

I was just wondering if it is possible to implement a state machine  
logic  
using GNURadio. Where each state is a block and incoming data passes  
through these states. I want to be able to control which block gets  
executed when, based on some state transition logic which I will define.

For example in a receiver model, energy detect, synchronisation, channel  
estimation, equalisation and detection could be the states and each  
state  
would operate on incoming data based on a transition logic. Programming  
wise, each state will have its own class and there could be a state  
class  
to define the transitions. Just wondering if it’s possible to integrate  
this into GNURadio.

Even if you could point me to already existing material on this, that  
would  
be enough.

Thanks a lot

Anil

---

<div class="post-metadata">

**Author:** ![anil\_y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/22d042/32.png) [@anil\_y](https://www.ruby-forum.com/u/anil_y)\
**Post date:** [May 31, 2015, 4:48pm UTC](https://www.ruby-forum.com/t/question-on-state-machine-implementation-in-gnuradio/242148/2 "2015-05-31T16:48:33Z")

</div>

Hi Anil,

On 05/31/2015 07:36 AM, Anil K. Yerrapragada wrote:

> Hi
> 
> I was just wondering if it is possible to implement a state machine  
> logic using GNURadio. Where each state is a block and incoming data  
> passes through these states.  
> No. I don’t know what you really have in mind, but blocks are blocks and  
> not states.  
> I want to be able to control which block gets executed when, based on  
> some state transition logic which I will define.  
> You can always halt the flow graph and reconfigure it; for the problem  
> you’ve described I’d definitely use the tagged stream logic I tried to  
> explain.
> 
> For example in a receiver model, energy detect, synchronisation,  
> channel estimation, equalisation and detection could be the states and  
> each state would operate on incoming data based on a transition logic.  
> You should have a look at reconfiguration. But much more, I think it’s a  
> good idea to have a look at existing frameworks – maybe you’d want to  
> understand the ofdm\_rx example in gr-digital/examples?

Best regards,  
Marcus
