Re: [Discuss-gnuradio] GRC:Suitable Sink required

2009-04-20 Thread Saleem Akhtar
Hi,
It appears that gr.message_sink and gr.msg_queues are for digital data. but my 
flowgraph (periodogram) is for analog samples,

complex baseband samples from usrp -- stream to vector (vectors of fft_size) 
-- FFT
 -- complex to mag squared  -- (sink or block to be determined)

Is their no choice other than file sink?

Thanks

 





--- On Mon, 4/20/09, Josh Blum j...@joshknows.com wrote:

From: Josh Blum j...@joshknows.com
Subject: Re: [Discuss-gnuradio] GRC:Suitable Sink required
To: Saleem Akhtar saleemakhta...@yahoo.com
Cc: discuss-gnuradio@gnu.org
Date: Monday, April 20, 2009, 4:37 AM

You can use a file sink to write the samples out to a file, and write some 
program to process the file.

Or, you need to create your own block in c++ or python. If c++, the how to 
write a block example is a good reference. If python, the wxgui sinks are a 
good reference (see gr.message_sink and gr.msg_queues to get data out of the 
stream and into
 python).

-Josh





  
-Inline Attachment Follows-

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio



  ___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] GRC:Suitable Sink required

2009-04-20 Thread Josh Blum
If you want to extract samples from a gnuradio data stream and process 
them in python, you should make a hierarchical block with a message sink 
inside. The wxgui blocks are all great examples for this.


Try 
http://gnuradio.org/trac/browser/gnuradio/trunk/gr-wxgui/src/python/fftsink_gl.py


-Josh

Saleem Akhtar wrote:

Hi,
It appears that gr.message_sink and gr.msg_queues are for digital data. but my 
flowgraph (periodogram) is for analog samples,

complex baseband samples from usrp -- stream to vector (vectors of fft_size) 
-- FFT
 -- complex to mag squared  -- (sink or block to be determined)

Is their no choice other than file sink?

Thanks

 






___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] GRC:Suitable Sink required

2009-04-20 Thread Firas Abbas

Hi,

 On Mon, 4/20/09, Saleem Akhtar saleemakhta...@yahoo.com wrote:
 Hi,
 It appears that gr.message_sink and gr..msg_queues are for
 digital data. but my flowgraph (periodogram) is for analog
 samples,

This is not true (see: usrp_spectrum_sense.py).


 complex baseband samples from usrp -- stream to vector
 (vectors of fft_size) -- FFT  -- complex to mag squared  -- (sink or
 block to be determined)
 
 Is their no choice other than file sink?
 
 Thanks


You can use vector sink. 

ex:

dst = gr.vector_sink_f()

then you can see the data in this vector by:

print dst.data()


Of course you have to run the graph for a while then stop it before doing the 
print.

See :
http://www.mail-archive.com/discuss-gnuradio@gnu.org/msg13693.html


BR

Firas



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] GRC:Suitable Sink required

2009-04-20 Thread Josh Blum
Ahh, no vector sink. The vector sink will queue up samples forever, and 
although you can clear the buffer, you will not stay vector aligned with 
the fft size.


Vector sink is good for the QA code with a finite number of samples in 
and out, but i would definitely not recommend it for dealing with live data.


You can use vector sink. 


ex:

dst = gr.vector_sink_f()

then you can see the data in this vector by:

print dst.data()




___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] GRC:Suitable Sink required

2009-04-19 Thread Josh Blum
You should probably start by looking at the existing wx gui sinks, copy 
and modify one: 
http://gnuradio.org/trac/browser/gnuradio/trunk/gr-wxgui/src/python


The vector sink is not what you want here.

-Josh

Saleem Akhtar wrote:

Hi,

I am trying to implement a periodogram in gnu radio.
http://img25.imageshack.us/img25/1606/powerdetectorgrc.png


Currently, I am stuck in deciding what sink i should use and how. I
want the output in the the form of an array so that I can have
calculations on the periodogram samples. As the input are the realtime complex
baseband samples from the USRP (here shown with a signal source), thus
the sink should be flexible enough to be updated. Thus I think that a
fixed length float vector sink doesnt suits here. I dont know how to
proceed from here :-)


Regards,
Ali



  





___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] GRC:Suitable Sink required

2009-04-19 Thread Saleem Akhtar
Thanks, but i dont want to use GUI sink. I want to get an array of samples 
which represent the periodogram. So that i can do further processing on them.

Regards


From: Josh Blum j...@joshknows.com
Subject: Re: [Discuss-gnuradio] GRC:Suitable Sink required
To: Saleem Akhtar saleemakhta...@yahoo.com
Cc: discuss-gnuradio@gnu.org
Date: Monday, April 20, 2009, 3:55 AM

You should probably start by looking at the existing wx gui sinks, copy and 
modify one: http://gnuradio.org/trac/browser/gnuradio/trunk/gr-wxgui/src/python

The vector sink is not what you want here.

-Josh






  ___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] GRC:Suitable Sink required

2009-04-19 Thread Josh Blum
You can use a file sink to write the samples out to a file, and write 
some program to process the file.


Or, you need to create your own block in c++ or python. If c++, the how 
to write a block example is a good reference. If python, the wxgui 
sinks are a good reference (see gr.message_sink and gr.msg_queues to get 
data out of the stream and into python).


-Josh

Saleem Akhtar wrote:

Thanks, but i dont want to use GUI sink. I want to get an array of samples 
which represent the periodogram. So that i can do further processing on them.

Regards


From: Josh Blum j...@joshknows.com
Subject: Re: [Discuss-gnuradio] GRC:Suitable Sink required
To: Saleem Akhtar saleemakhta...@yahoo.com
Cc: discuss-gnuradio@gnu.org
Date: Monday, April 20, 2009, 3:55 AM

You should probably start by looking at the existing wx gui sinks, copy and 
modify one: http://gnuradio.org/trac/browser/gnuradio/trunk/gr-wxgui/src/python

The vector sink is not what you want here.

-Josh






  





___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] GRC:Suitable Sink required

2009-04-19 Thread Saleem Akhtar
Thanks! I will look into it.


--- On Mon, 4/20/09, Josh Blum j...@joshknows.com wrote:

From: Josh Blum j...@joshknows.com
Subject: Re: [Discuss-gnuradio] GRC:Suitable Sink required
To: Saleem Akhtar saleemakhta...@yahoo.com
Cc: discuss-gnuradio@gnu.org
Date: Monday, April 20, 2009, 4:37 AM

You can use a file sink to write the samples out to a file, and write some 
program to process the file.

Or, you need to create your own block in c++ or python. If c++, the how to 
write a block example is a good reference. If python, the wxgui sinks are a 
good reference (see gr.message_sink and gr.msg_queues to get data out of the 
stream and into python).

-Josh





  ___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio