discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] a two blocks synchronizing problem


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] a two blocks synchronizing problem
Date: Mon, 29 Jun 2015 18:13:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

Hi David,

GNU Radio really makes sure you are only greeted with samples you did
not already consume, and you don't miss a single one, so in principle,
this should work.

Do you check that you a) don't produce more samples than you are allowed
to (noutput_items) in your encoder and b) don't consume more input items
then there are (ninput_items) in your decoder?

There's a handy trick to ensure that GNU Radio always calls you with a
multiple of 8 (encoder) or 11 (decoder) items:
set_output_multiple as well as set_relative_rate allow you to define how
GNU Radio handles the amount of items.

Best regards,
Marcus


On 06/29/2015 04:55 PM, dcardona wrote:
> Hello
>
> I created 2 new blocks, one is an encoder and the other one a decoder. I
> needed the encoder block to had 8 input items (from a vector source) and 11
> output items, so I set: consume each(8) and return(11). I did not have any
> problem with it.
>
> Now, for the decoder block, I needed to had 11 input items and 8 output
> items, so I set: consume each(11) and return (8). 
>
> I printed out the outputs with "cout << out[i];" .
>
> The problem: The encoder´s outputs are fine, they are what I expected them
> to be.
> But, the decoder´s outputs are giving me trouble: At first, it behaves well,
> the decoder´s input corresponds with encoder´s output and the decoder´s
> output corresponds with the vector source´output. But then, after a while,
> the decoder´s input do not begin in the first value as the encoder´s output
> and thus, the decoder´s output is not equal to the vector source´s output.
>
> For example, if the encoder´s output is: 20.57, 11.45, 14.82, 17.81, 16.95,
> 16.63, 20.57, 15.14, 16.95, 11.45, 20.57.  At first, the decoder´s input is
> exactly the same, but after a while, are: 17.81, 16.95, 16.63, 20.57, 15.14,
> 16.95, 11.45, 20.57, 20.57, 11.45, 14.82. It begins in the fourth value
> instead the first.
>
> Is there a way to synchronize these two bloks? So the decoder´s input is
> always the same as the encoder´s output?
>
> am I missing something? What should I do?
>
> Thank you
>
> David
>
>
>
> --
> View this message in context: 
> http://gnuradio.4.n7.nabble.com/a-two-blocks-synchronizing-problem-tp54499.html
> Sent from the GnuRadio mailing list archive at Nabble.com.
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio




reply via email to

[Prev in Thread] Current Thread [Next in Thread]