discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Different input/output rate


From: Holger von Malm
Subject: Re: [Discuss-gnuradio] Different input/output rate
Date: Tue, 30 Aug 2005 17:38:54 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)

Thanks a lot Martin.

Ok, now I can regulate the datastream, but one big problem has appeared. How do I know when the last item of an inputstream is handled in the general_work-function? This is necessary because I want to add after the last item some bytes and the number of incoming items is always unknown. I made some tests and when I changed the amount of the bytes going into my signal-block (coming from a file), I always got different chunks of input items in my general_work-function. The last chunk of input_items handled in "general_work" contains sometimes 1 or 4 or 16 or more input_items (so 2^x). How do I know when the last portion of input_items are handled in "general_work"?
Is there a function to check this?

Is it maybe possible to send some outgoing items directly from the forecast-function or from the deconstructor?

I hope you or someone else could help me!

Holger

Martin Dvh schrieb:

Hi Holger,

The input of my signal block is a bytestream b. The output should
also be a bytestream, but with a different number of outgoing items(not a
multiple of b).
In other words, after the transformation of the inputstream some extra-bytes
have to be appended. For example:

Input y Bytes -------> Output (y Bytes * x) + c ; where y and x are integers
and c Overhead-Bytes: independent from input items

The number of input items is not fixed.

Is this possible or must the number of output items always be a multiple of the
number of input items?

Yes, this is possible.
You have to extend from gr_block in stead of gr_sync_block.
You have to implement your own forecast block and call consume_all yourself.

Look at the gr_simple_framer block. It does just this.
(src/lib/general/gr_simple_framer.[cc,h,i)]

Greetings,
Martin





reply via email to

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