Hi,
I’m having the same problem: the output of my spectrum analyzer and the
output of the spectrum_sense.py doesn’t match. I’m trying to detect
activity
int the GSM900 band, but it’s impossible with the outputs I obtain.
I was trying to correct the code and I think that your formula is
incorrect. I’ll try to explain:
P=E/N, with P=power of signal, E=energy of signal and N=number of
points

The output of the c2mag (gr.complex_to_mag_squared) is the energy of
the
signal, so the power of the same signal will be these values divided by
N
(number of points), I think the square root is not necessary. 
For the same reason, when you make
10math.log(tb.power/tb.fft_size/tb.fft_size) I think it should be
10math.log(tb.power/tb.fft_size) 
After that, the last operation (signalPower /= tb.fft_size) is
unnecessary, it’s already done in 1)
The incorrect range of values could be a problem of the refscale
parameter.
I tried to correct the output values using 20*math.log10(tb.ref_scale)
but
they’re still out of range.
In my case, either the maximum values of the output doesn’t match with
the
ones in the spectrum analyzer view.
Does anybody have an answer to this problem? It seems that the
spectrum_sense is used in several projects, but how does it function?
Thanks in advance.
adib_sairi wrote:
power in the returned data vector using the following formula:
and FFT size per default I get values from 28 through +5 (dBm) which
Thanks,
–
View this message in context:
http://old.nabble.com/usrp_spectrum_sensevs.usrp_ffttp21708925p28819417.html
Sent from the GnuRadio mailing list archive at Nabble.com.