[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] How to know that the last sample has arrived
From: |
Ruben Undheim |
Subject: |
Re: [Discuss-gnuradio] How to know that the last sample has arrived |
Date: |
Fri, 31 Mar 2017 16:38:05 +0200 |
Thank you both for answering.
> I would totally agree with Marcus. Especially you first approach can't
> work reliably.
It appeared quite stable for file_source, but I got some problems
today with one of my custom blocks which suddenly caused the following
block to be called with ninput_items[0] == 1, without it being the
last sample...
> What about using tagged streams or just a tag on the last sample? Is
> that an option?
The reason for posting the question was mainly to make sure I am not
missing something obvious. Putting a tag on the last sample sounds
like the best solution so far. Thanks. The only complication is that
then I will have to CLONE the implementations for vector_source,
file_source, random_source... Would it be an idea to modify these
blocks so that they always add an "END" tag on the last sample in the
main code base?
I am just wondering, how would one go about to make blocks for
"concatenating" input streams, or "repeating" the finite-length input
stream, or "zero-padding" finite-length input streams if we do not
have such an "END" tag? I am a bit surprised if nobody has never
wanted to do this before.
An example is if I want to make an input signal which consists of 100
zeros, followed by 1000 random bits, then followed by the content of a
file?
With a concatenation block, it could be done with 4 blocks:
vector_source, random_source, file_source, contatenate_inputs_ff.
Cheers,
Ruben