discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] how send random values to selector every n-times


From: sreeraj r
Subject: Re: [Discuss-gnuradio] how send random values to selector every n-times
Date: Mon, 8 Dec 2014 15:11:26 +0100

Hi,

Please go through the tutorial [1].

Short version,

1. Use one 5in-1out selector block 
2. Use on "Function Probe" block 
3. Set the "Poll Rate" based on your delay
4. Generate python file using "Generate flowgraph" button
5. Set your selector's input index in the function probe 
        
Sample function probe 

>>def _fn_probe_probe():
>>            while True:
>>                try:
>>                    self.blks2_selector_0.set_input_index(random.randint(0,4)) 
>>                except AttributeError:
>>                    pass
>>                time.sleep(1.0 / (0.3))

6.Run your python code 


[1] https://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorial_GNU_Radio_in_Python#315-Modifying-the-GRC-Generated-Python-File

Sreeraj

On Sun, Dec 7, 2014 at 10:59 PM, Vitt Benv <address@hidden> wrote:
Hi everybody,
I need to "switch" randomly 5 different signal generator via selector block every [say] 3 seconds....

So , in GRC, I've a vector_source with values coming from [random.randint(0, 4) for p in range(0,4)]. This put some random values displayed right.

Now how I can scan the vector, a values at time sending this index to selector, every n-seconds ???

I'm not with a USRP , simple sound card.

Tnx in advance for any answer!

Victor

_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio




--
Regards
Sreeraj Rajendran
http://radioninja.in/

reply via email to

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