# Received Signal Power question

**URL:** <https://www.ruby-forum.com/t/received-signal-power-question/233208>\
**Category:** GNU Radio\
**Created:** [November 24, 2014, 2:09pm UTC](https://www.ruby-forum.com/t/received-signal-power-question/233208 "2014-11-24T14:09:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [November 24, 2014, 2:09pm UTC](https://www.ruby-forum.com/t/received-signal-power-question/233208/1 "2014-11-24T14:09:03Z")

</div>

I found one modified example from usrp\_spectrum\_sense.py which mentioned  
the  
power and noise calculation, could u plz help me figure out how it  
works?

```
    for i_bin in range(bin_start, bin_stop):

        center_freq = m.center_freq
        freq = bin_freq(i_bin, center_freq)
        #noise_floor_db = -174 + 10*math.log10(tb.channel_bandwidth)
        noise_floor_db = 10*math.log10(min(m.data)/tb.usrp_rate)
        power_db = 10*math.log10(m.data[i_bin]/tb.usrp_rate)

```

-noise\_floor\_db

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/Received-Signal-Power-question-tp51409.html](http://gnuradio.4.n7.nabble.com/Received-Signal-Power-question-tp51409.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Leo\_Yang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/439d5e/32.png) [@Leo\_Yang](https://www.ruby-forum.com/u/Leo_Yang)\
**Post date:** [November 24, 2014, 4:12pm UTC](https://www.ruby-forum.com/t/received-signal-power-question/233208/2 "2014-11-24T16:12:10Z")

</div>

I assume m.data is a list of FFT magnitude-squared data; it can’t be  
complex  
otherwise math.log10() won’t work. It must be magnitude-squared since  
it is  
using 10_math.log10(), otherwise it needs to be 20_math.log10().

It finds the minimum out of all the bins and calls that the noise floor.

For each bin it subtracts the noise floor and calls that the power.  
Although this is calculation is really the SNR, not the power.

It needs to be calibrated against a known reference to give the power.  
Problem is you would have to do that for each hardware. It’s also  
assuming  
the lowest valued bin is noise (which isn’t necessarily true).

It’s scaling the values by the usrp\_rate, probably since it’s using a  
fixed-length FFT, therefore if the usrp\_rate increases, then the  
bandwidth  
for each bin increases. They want the noise level to stay constant with  
bandwidth, so it is really calculating power-spectral-density.

I’d do it like so:

power\_dbm\_per\_Hz = 10\*math.log10(m.data[i\_bin]/tb.usrp\_rate) +  
cal\_factor\_dBm

Lou

Leo Yang wrote

> ```
> power_db = 10*math.log10(m.data[i_bin]/tb.usrp_rate)
> 
> ```
> 
> -noise\_floor\_db

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/Received-Signal-Power-question-tp51409p51414.html](http://gnuradio.4.n7.nabble.com/Received-Signal-Power-question-tp51409p51414.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).
