# USRP Source replaced with a file source

**URL:** <https://www.ruby-forum.com/t/usrp-source-replaced-with-a-file-source/209684>\
**Category:** GNU Radio\
**Created:** [July 20, 2011, 9:46am UTC](https://www.ruby-forum.com/t/usrp-source-replaced-with-a-file-source/209684 "2011-07-20T09:46:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [July 20, 2011, 9:46am UTC](https://www.ruby-forum.com/t/usrp-source-replaced-with-a-file-source/209684/1 "2011-07-20T09:46:49Z")

</div>

Hi all

To test my program several times with the same data I replaced the “USRP  
source” with a “file source” and a throttle:

Old situation:  
self.uhd\_usrp\_source\_0 = uhd.usrp\_source(  
device\_addr=“addr=192.168.10.2”,  
io\_type=uhd.io\_type.COMPLEX\_FLOAT32,  
num\_channels=1,  
)  
self.uhd\_usrp\_source\_0.set\_samp\_rate(samp\_rate)  
self.uhd\_usrp\_source\_0.set\_center\_freq(227360000, 0)  
self.uhd\_usrp\_source\_0.set\_gain(31.5, 0)

New situation:  
self.file\_source = gr.file\_source(gr.sizeof\_gr\_complex_1,  
“/home/hoim/WorkDAB/Record8.dat”, False)  
self.throttle\_0 = gr.throttle(gr.sizeof\_gr\_complex_1, samp\_rate)

My problem is that the generated output isn’t every time the same. Has  
GNU Radio something like a “Master reset” that I had to use before I  
start my programm? Or have somebody an idea what the origin of the  
inconsistence could be?

Any help will be appreciated

Thanks  
Michael

---

<div class="post-metadata">

**Author:** ![SSMichael\_HSSinSS\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@SSMichael\_HSSinSS\_S](https://www.ruby-forum.com/u/SSMichael_HSSinSS_S)\
**Post date:** [July 21, 2011, 2:00am UTC](https://www.ruby-forum.com/t/usrp-source-replaced-with-a-file-source/209684/2 "2011-07-21T02:00:55Z")

</div>

On Wed, Jul 20, 2011 at 3:27 AM, Michael H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> )
> 
> ```
> 
> GNU Radio something like a “Master reset” that I had to use before I  
> start my programm? Or have somebody an idea what the origin of the  
> inconsistence could be?
> 
> Any help will be appreciated
> 
> Thanks  
> Michael

If you are running your program from the start each time and therefore  
removing your flow graph and rebuilding it, there is no need for a  
“reset”  
as all blocks have no state left over from the last run. There is some  
concept of a reset on certain blocks if you are running the flow graph  
multiple times in a row, though, but only the ones that store memory.

So to answer your question is the always reliable “it depends.” It  
really  
depends on what you are doing to your signal. Most blocks will  
behave deterministically, but some (very few) use random numbers that  
might  
indicate a problem. If you have your own block(s) in there somewhere,  
they  
could also be causing a problem.

Tom

---

<div class="post-metadata">

**Author:** ![SSMichael\_HSSinSS\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@SSMichael\_HSSinSS\_S](https://www.ruby-forum.com/u/SSMichael_HSSinSS_S)\
**Post date:** [July 21, 2011, 5:30pm UTC](https://www.ruby-forum.com/t/usrp-source-replaced-with-a-file-source/209684/3 "2011-07-21T17:30:22Z")

</div>

Thanks for your answer Tom.

I can isolate the fault to one of my blocks:  
[http://www.zhaw.ch/~hoim/howto\_ofdm\_symbol\_cutter\_cc.cc](http://www.zhaw.ch/~hoim/howto_ofdm_symbol_cutter_cc.cc)

This block has two inputs, both have the same rate. If I connect the  
input to a file with throttle and the output to a “vector\_sink\_c” I see  
that the amount of data produced by the block is not always the same. My  
conclusion is that my block looses data.

In this block I cut data out of a stream. Hence from time to time there  
are rest periods between the data production. Is this a problem for gnu  
radio? Should I allocate more memory for this block (how can I do that)?

Any help will be appreciated

Thanks  
Michael
