About the latest submission of usrp_spectrum_sense.py

Dear all,

I checked your latest submission of “usrp_spectrum_sense.py” and I don’t
understand why there is a division of the value of each bin by the
sampling
rate. Also I don’t understand why there is a subtraction of the noise
floor from the power db value to calculate an actual db value.

Kindly explain those modifications.

I am working with a USRP N210 and when I run uhd_fft to display an
analog
TV channel I get values around -60’s db for the central frequencies of
both
the audio and video signals. When I used the latest version of
“usrp_spectrum_sense.py”, I got positive values for power_db and when I
removed the deduction of the noise floor, I got readings almost near the
noise floor for all bins (including the ones at the central frequency of
the audio and video signals). I hope you can point me to the right
direction and correct my misunderstanding of the code.

Thank you for your time.

Kind regards,
Ahmed Saeed.

Ahmed Saeed
Research Assistant
Department of Computer Science and Engineering
Egypt-Japan University of Science and Technology (E-JUST)

email: [email protected]
mobile: +201112389430
web: http://wrc.ejust.edu.eg/people/saeed

Hi Ahmed,

Dividing the bin power by the sample rate in the calculation for
noise_floor_db and power_db (lines 286 and 287 of
uhd: enhanced version of usrp_spectrum_sense.py · gnuradio/gnuradio@cc12277 · GitHub)
was done so that the power level stays constant if the sample rate is
increased. This is required because the bin statistics function sums
together more samples if the usrp_rate is increased and therefore
increases
the bin value result.

The noise_floor_db value is subtracted from the power_db value to give
a
relative signal strength above the noise floor to make it easier to set
the
squelch and catch signals:

noise_floor_db = 10math.log10(min(m.data)/tb.usrp_rate)
power_db = 10
math.log10(m.data[i_bin]/tb.usrp_rate) - noise_floor_db

Regards,

Mike


Mike J. M0MIK BSc MIET
Email: [email protected]
Web: http://scanoo.com

Hi Mike,

Thank you for your reply.

So what if I want to sense with the sensing threshold set by the FCC for
white spaces at -114 dBm or -107 dBm. How does the value of “power_db”
relates to the value I should compare against given the FCC thresholds ?

Kind regards,
Ahmed Saeed.

On Sat, Jul 27, 2013 at 1:35 PM, Mike J. [email protected] wrote:

The noise_floor_db value is subtracted from the power_db value to give a

understand why there is a division of the value of each bin by the sampling
noise floor for all bins (including the ones at the central frequency of
Department of Computer Science and Engineering


Ahmed Saeed
Research Assistant
Department of Computer Science and Engineering
Egypt-Japan University of Science and Technology (E-JUST)

email: [email protected]
mobile: +201112389430
web: http://wrc.ejust.edu.eg/people/saeed

Hi Ahmed,

You will need to use a calibrated rf source to compare your USRP N210
SDR
receiver against and adjust the power_db result (without subtracting the
noise floor result from it) to match. I assume it will be a simple case
of
adding or subtracting ‘X’ db’s to the power_db result for each
calibration
power level tested against. Unfortunately I haven’t any calibrated rf
signal sources to hand so am unable to confirm how easy it will be to
calibrate.

Regards,

Mike


Mike J. M0MIK BSc MIET
Email: [email protected]
Web: http://scanoo.com