Also, When I use gr.file_sink(), the sensing does not automatically
and I have to stop it manually(ctrl+z) after a while. I am wondering
if there is any other way so that the usrp2 can sense a certain
frequency band for a certain period and can switch to another
And one more thing, using gr,file_sink() and storing the raw complex
data, I found that many data are giving 0 value. I think regardless of
the frequency band, the raw data should contain some value, it might
be very small but not zero. Do you any reason for that?
Not sure why you want the vector format. A vector in Gnu Radio is just
a fixed-sized “slab” of samples, and since you’re just recording them
to disk, there’s no reason to treat them in a vector format inside
the flow-graph. Certain transforms, like the FFT, require their inputs
be fixed-sized “vectors”, but a simple stream-record-to-disk has no
You haven’t discussed your hardware setup in detail. What
daughtercards? What frequency are you tuning to? Have you set the RF
gain controls appropriately?
The I/Q data are voltage-samples of a quasi-sinusoidal phenomenon–why
would you not expect such a phenomenon to regularly and
frequently pass-through the zero point?
If you’re programming in raw Python, can I suggest you look into Gnu
Radio companion? It makes things easier in many ways.
Also, if you want to “sample for a little while then stop”, you can
create a separate thread that simply goes to sleep for awhile, and when
wakes up, it calls tb.stop(), where “tb” is whatever you’ve named
your top flow-graph block.
Shirleys Bay Radio Astronomy Consortium