Would set_output_multiple() do what you want?
https://gnuradio.org/doc/doxygen/classgr_1_1block.html#a63d67fd758b70c6f2d7b7d4edcec53b3

However, you might want to consider passing your packets as messages,
not as streams.

-- M

On 11/09/2017 07:06 AM, Muhammad Zulqarnain wrote:
> Dear All!
> 
> I am new to GNU-Radio. I have previously used MATLAB for packet
> transmission and detection. Here is the problem, I am facing:
> 
> I have inserted zeros between the packets and transmitting the same
> packet over and over again. In the packet formation, I have appended two
> preambles side-by-side and using auto-correlation approach to detect
> coarse estimate of frequency and start of the packet. This was already
> done in MATLAB, but in GNURadio I am stuck in buffer things. I want the
> output buffer to contain exactly one packet so I can do processing on
> each packet (i.e. doing synchronization, demodulating etc.) 
> 
> My approach of doing auto-correlation is similar to Schmidl & Cox
> synchronization but all I find in GNURadio is for OFDM. Where this is a
> case of simple packetized transmission.
> 
> As I am inserting zeros between the packets so detection of individual
> packets at the receiver won't be a problem. 
> 
> I have already set the max output buffer to packet length
> i.e.  set_max_noutput_items (495);
> 
> Here is what I am doing in work function. but somehow I am not getting
> any output.
> 
> 
>       float curr_sample;
>       int i =0;
>       int y = 0;
>       // Do <+signal processing+>
>       while(i<=noutput_items){
>         curr_sample = abs(in[y]);
>           if (curr_sample >= 0.5 && packet_start == 0){ //0.5 is the
> threshold that signal is coming
>                 packet_start = 1;
>                 packet_length_count = 0;
>           }
>           if (packet_start == 1){
>               out[i] = in[y];
>               packet_length_count++;
>               i++;
>           }
>           if (curr_sample <= 0.2 && packet_start == 1){  //0.2 is the
> threshold that zero is coming
>               packet_start = 0;
>               packet_length_count = 0;
>             //  printf("curr_packet_length: %d \n",packet_length_count);
>               return i;
>           }
>         y++;
>       }
>       consume_each (y);
> 
> 
> 
> Awaiting reply!
> 
> Regards,
> Muhammad Zulqarnain
> 
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to