# Creating an OOT block similar to Corr & Sync using Python

**URL:** <https://www.ruby-forum.com/t/creating-an-oot-block-similar-to-corr-sync-using-python/241456>\
**Category:** GNU Radio\
**Created:** [April 7, 2015, 8:10pm UTC](https://www.ruby-forum.com/t/creating-an-oot-block-similar-to-corr-sync-using-python/241456 "2015-04-07T20:10:30Z")\
**Posts on this page:** 1\
**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:** [April 7, 2015, 8:10pm UTC](https://www.ruby-forum.com/t/creating-an-oot-block-similar-to-corr-sync-using-python/241456/1 "2015-04-07T20:10:30Z")

</div>

Hi All,

I am trying to implement a MIMO algorithm in a custom Python block  
with vectors in & out. What i want to accomplish in this custom block is  
to first correlate the input vectors with a given pilot matrix(e.g.  
vector size 2), for example, the pilot length could be 1000, the  
correlation will be a 2x2 matrix, then if the correlation satisfies some  
condition, the block will output this 2x2 matrix. My questions are:

1. Since the output depends on if a pilot signal is transmitted, we  
should use general block. But if I want this block to output all the  
correlations whether the condition is satisfied or not, then what type  
of block should i use? I am confused here because after the first 1000  
vectors are received, the block will produce 2 vectors for every input  
vector, so should i use an interpolation block?

2. How do i use forecast and set\_history functions in a Python block?  
Since I need 1000 input vectors for every 2 output vectors(if there are  
any), So the history should be set to 1000. I guess I can make it work  
without using these 2 functions by introducing a self.previous variable  
to store the last 999 input vectors, am I right?

3. Are there any python block examples that might help me?

Thank you!

best,  
Hai
