[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] How to write vector to a file
From: |
Marcus D. Leech |
Subject: |
Re: [Discuss-gnuradio] How to write vector to a file |
Date: |
Sat, 12 Nov 2011 00:47:44 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Thunderbird/3.1.15 |
Thanks Josh,
You got it right, self.u is USRP2. I am converting the stream which
comes from self.u into vector by using the s2v (stream to vector)
function. And now I want to capture the IQ data.
gr.file_sink() writes only streams into a file I guess, so I was
looking for any other gnuradio class which can write vectors too into
a file. Do you think that gr.file_sink() can do the same thing?
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
frequency then.
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?
Thank you;
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 to
be fixed-sized "vectors", but a simple stream-record-to-disk has no
such requirement.
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 it
wakes up, it calls tb.stop(), where "tb" is whatever you've named
your top flow-graph block.
--
Marcus Leech
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org