# Sense spectrum by usrp_spectrum_sense.py

Hi All,

I am using usrp_spectrum_sense.py 1400M 2000M -F 512 -d 16 --tune-delay
1e-3
–dwell-delay 10e-3 to sense the spectrum.

In main_loop(tb), I print m.center_freq and m.data.
freq_step = 0.75 * usrp_rate=0.75*(64M/16)=3M. So
m.center_freq[0]=1401.5M,
m.data[0]~m.data[511] are 512 bins corresponding to m.center_freq[0];
m.center_freq[1]=1404.5M, m.data[0]~m.data[511] are 2nd 512 bins
corresponding to m.center_freq[1], and so on.

There are some comment lines say:
# m.data are the mag_squared of the fft output (they are in the
# standard order. I.e., bin 0 == DC.)
# You’ll probably want to do the equivalent of “fftshift” on
them
# m.raw_data is a string that contains the binary floats.
# You could write this as binary to a file.

So actually, for each 512 bins, (m.data[0]) to (m.data[255]) are
mag_squared
values for (m.center[0]) to (m.center[0] +freq_step/2), and
(m.data[256]) to
(m.data[511]) are mag_squared values for (m.center[0]-freq_step/2) to
(m.center[0]). Am I right? How to use fftshift here? Dose
fftshift(m.data)
give me regular order? Are fftshift(m.data) mag_squared values
corresponding
to [(m.center[0]-freq_step/2):(m.center[0]+freq_step/2)]?

If I plot all m.data or fftshift(m.data) versus all the m.center_freq
from
1400M to 2000M, I should get the whole spectrum from 1400M upto 2000M.
Did I
do right here? Can I get time domain signal if I do ifft(m.data)? I
suppose
not. Because m.data are mag_squared rather than mag. If not, how can I
get
the time-domain signal before fft, from 1400M to 2000M?

Thanks,
Brook

View this message in context:
http://www.nabble.com/Sense-spectrum-by-usrp_spectrum_sense.py-tp16261178p16261178.html
Sent from the GnuRadio mailing list archive at Nabble.com.