0

I am working on GNU radio project and I need block that have two inputs and one output that do the following:

1.transfer the data from the first input to the output.

2.when the stream of data stops on the first input, the block switch to the second input - I mean that the stream of data from the second input transfer to the output until the stream of the first input start again...

do you familiar with such a block? if not, do you have idea how to do it?

thanks

1 Answers1

1

There's no such thing as a stream "stopping", unless the upstream block signals "I'm done", but then it can't start again.

So: What you want is impossible, architecturally.

I presume this is a bit due to a slight misconception about the signal processing being done: the "wall clock" time doesn't matter to the processing at all; to the processing, all that counts is the sequence of numbers, not when it comes. The signal is the same when there's 10 µs between two batches of samples, or 10 hours.

Therefore, there can't be a block that does what you want; you're trying to break the DSP abstraction; GNU Radio has no means for that.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • second, I will describe to you my problem. I have two UDP sources, I use the ADD block to add the two signals I got from the UDP sources. if suddenly one of the sources is stoped - all the signals are stopped because of the ADD block. I am trying to figure out a way to overcome this problem. I thought about the block I described earlier - this block will come before the ADD block and solve my problem ( the second input will be a stream of zeros). if you have another idea to help me I will be happy to hear. thanks – ohad avraham Nov 09 '20 at 22:11
  • sorry, still the same answer: an UDP source doesn't "stop"; the block can't know whether it's just a few more milliseconds between UDP packets or a "temporary stop". The UDP source can say "I'm done"; but then it can never be started again without restarting the whole flow graph. – Marcus Müller Nov 09 '20 at 22:22
  • 1
    So, you need a different architecture, altogether. – Marcus Müller Nov 09 '20 at 22:23