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 https://github.com/gnuradio/gnuradio/commit/cc12277f64207ff79a40094268c843e6b3e2d2d3#L0R286) 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 = 10*math.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 Jameson M0MIK BSc MIET Email: m...@scanoo.com Web: http://scanoo.com On Thu, Jul 25, 2013 at 10:11 PM, Ahmed Saeed <ah...@gmx.us> wrote: > 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: ahmed.sa...@ejust.edu.eg > mobile: +201112389430 > web: http://wrc.ejust.edu.eg/people/saeed > > _______________________________________________ > Discuss-gnuradio mailing list > Discuss-gnuradio@gnu.org > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > >
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio