# USRP Spectrum Sensing - Power in dB or dBm?

**URL:** <https://www.ruby-forum.com/t/usrp-spectrum-sensing-power-in-db-or-dbm/244748>\
**Category:** GNU Radio\
**Created:** [June 7, 2016, 12:52pm UTC](https://www.ruby-forum.com/t/usrp-spectrum-sensing-power-in-db-or-dbm/244748 "2016-06-07T12:52:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [June 7, 2016, 12:52pm UTC](https://www.ruby-forum.com/t/usrp-spectrum-sensing-power-in-db-or-dbm/244748/1 "2016-06-07T12:52:12Z")

</div>

I’m a beginner working in Spectrum Sensing. I have been checking the  
code given in the usrp\_spectrum\_sense.py file in GNU Radio.  
([https://github.com/gnuradio/gnuradio/blob/master/gr-uhd/examples/python/usrp\_spectrum\_sense.py](https://github.com/gnuradio/gnuradio/blob/master/gr-uhd/examples/python/usrp_spectrum_sense.py))

The power calculated (at line 303) is in dB as given below :

power\_db = 10\*math.log10(m.data[i\_bin]/tb.usrp\_rate) - noise\_floor\_db

My query is whether the power calculated in dB is in reference to 1  
Watt??  
Can we convert this power to dBm?? What parameters are needed to be  
checked or tuned in this program??

Also, how can we calculate the Power Spectral Density (PSD) from power  
in dB with reference to given frequency??
