Scanning desired frequenies

I have been trying to make my NI-B200 scan frequencies that I have in a
text file for a couple days now. I was introduced to this mailing list
through the GNU website and it has helped me alot these past few day,
Thank
you all, but I haven’t completed my task yet so I’m going to be as
specific
as possible with what I need help with and with what I have been doing.

I have a list of about 1000+ frequencies and I need to scan all of them
with my NI-B200 and record their power(dB). I am currently using using
usrp_spectrum_sense.py (
https://github.com/gnuradio/gnuradio/blob/master/gr-uhd/examples/python/usrp_spectrum_sense.py)
to scan the frequencies but it scans a range and not the specific
frequencies I want so I made my own py file that simply loop the
execution
of usrp_spectrum_sense.py until the end of the list. It is a very crude
way
of going about things. Is there a better, much cleaner way I can
accomplish
my goal?

Hi Ashraf,

thanks for the nice words and the detailed problem description.

Yes, I think there are ways to achieve what you want; you will have to
write a few GNU Radio blocks, but I think it’s possible to do after
lecture of the GNU Radio guided tutorials [1]; if you encounter any
obstacles, the mailing list probably will have an open ear for you :slight_smile:

You could write your own block that passes through samples, and controls
the USRP. For starters, that could be done in python, if that feels more
familiar to you than C++. It will have to be a general block.

As a first step, that block would simply wait for a tx_time tag coming
in. That tag value contains the time at which tuning happened.
Use that time to calculate the time at which the next tuning should
occur.
Give your block the ability to call your usrp_source’s
set_command_time() with that time.
Use message passing to issue the tuning command [2].
After each tag, pass a fixed amount of samples <=
(inter_tune_time*sampling rate), and just consume the rest, until the
next tag appears. Pass through the rx_freq tag to the first passed
sample.

Connect your block’s input to your usrp_source’s output, and
message_connect your block’s message output to the usrp_source’s message
input.

Connect the output of your block to a stream to vector; connect that to
whatever processing you want to do. For example, you can do an FFT.
After the FFT, you could attach another block that you’d write yourself,
that would take the rx_freq tag again,and based on that, would for
example put the FFT vector into the right position in an array of FFT
vectors.

Best regards,
Marcus

[1] https://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials
[2] GNU Radio Manual and C++ API Reference: UHD Interface

I’m sorry but this is all too much. I need some help breaking this
process
down.
What do you mean by samples, Is that the frequency list?
My first block is reading the data from the file, and has an input for
tx_tune?
What is a tag?
When I do all this I will run it in GRC, correct?

On Mon, Jun 15, 2015 at 12:31 PM, Marcus Müller
[email protected]

This scans the B200 through GSM channels, compares to a calibrated
threshold,
and logs if it exceeds the threshold. You would just populate the
Python
list with your frequencies and iterate through them. Note this uses the
old
message queues, which as been deprecated, and I have not figured out a
way
around it. The usrp_spectrum_sense also uses message queues though, so
someone will have to update them eventually.

Lou

Ashraf Y. wrote

I have been trying to make my NI-B200 scan frequencies that I have in a
text file for a couple days now.


View this message in context:
http://gnuradio.4.n7.nabble.com/Scanning-desired-frequenies-tp54189p54199.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Samples are what comes out of your USRP, and what you process in GNU
Radio.

What a tag is, how blocks work, and how you can write your own is all
covered in the guided tutorials; I’d recommend reading those from first
to 6, because that will cover all these topics, including dealing with
Hardware like the USRP.

Best regards,
Marcus

Well googling that error points to something with the B200. I ran it
last
night with latest UHD/GR and it runs fine. Python has no issues with
1000
length list of floats.
Lou

Ashraf Y. wrote

Amazing, this seems to do what I needed. Thank you. It seems my list is
too
big because I get a RuntimeError: AssertionError: accum_timeout <
_timeout.


View this message in context:
http://gnuradio.4.n7.nabble.com/Scanning-desired-frequenies-tp54189p54210.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Amazing, this seems to do what I needed. Thank you. It seems my list is
too
big because I get a RuntimeError: AssertionError: accum_timeout <
_timeout.

I see, I will try to update my system and hope that it works. Thank you.

Dear Ashraf,

that error is not very common. It means that your PC didn’t get an “OK”
from the USRP in time.
Did you get “O”, or “U”, or “S” printed to your console?
If you did, did upgrading UHD help?

If it didn’t, please contact [email protected].

Best regards,
Marcus

I was not sure how to upgrade the UHD, so I updated my OS and it seemed
to
work. Just to be sure we’re talking about the same thing, this is the
full
description of the error;
terminate called after throwing an instance of ‘uhd::assertion_error’
what(): AssertionError: accum_timeout < _timeout
in uint64_t radio_ctrl_core_3000_impl::wait_for_ack(bool)
at /home/ashraf/uhd/host/lib/usrp/cores/radio_ctrl_core_3000.cpp:230

On Tue, Jun 16, 2015 at 10:15 AM, Marcus Müller
[email protected]