About usrp_spectrum_sense.py

Hi,

I have some difficulties in unserstanding the statements belowin
usrp_spectrum_sense.py.

fft = gr.fft_vcc(self.fft_size, True, mywindow)

power = 0

for tap in my wondow:

power += tap*tap

What is stored in window and what is tap? Where is the FFT data stored?
I turned to C++ file gr_fft_vcc.cc. And also I can not understand what
is stored in the out[]? Can anybody help me? Thank you!

Hey Lishan … or Wh … or whatever your name is…,

The part you posted from usrp_spectrum_sense.py is taken from
gr-wxgui/src/python/fftsink_nongl.py. There are some comments in the
code which tries to explain the gr.nlog10_ff-block: the variable
“power” is mentioned there.

The window is used to reduce the leakage [1, 2].

You have “self.connect(self.u, s2v, fft, c2mag, stats)”, where “stats”
is a gr.bin_statistics_f block. Thus you find the squared magnitudes
of the fft data in the msg-queue which “stats” uses.
gr.bin_statistics_f accumulates the incoming data over some time
(“dwell_delay”), which results in maximized bins of the squared
magnitudes: Please have a look at
gnuradio-core/src/lib/general/gr_bin_statistics_f.cc

Regards,
Gregor

[1] http://en.wikipedia.org/wiki/Spectral_leakage
[2] http://www.ee.iitm.ac.in/~nitin/_media/ee462/fftwindows.pdf

2010/6/14 lishan_wh [email protected]: