[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Is that possible combining usrp_fft.py and usrp_s
From: |
Brook Lin |
Subject: |
Re: [Discuss-gnuradio] Is that possible combining usrp_fft.py and usrp_spectrum_sense.py to do spectrum analysis and observe in GUI in a wider frequency range? |
Date: |
Mon, 10 Dec 2007 12:34:07 -0800 (PST) |
Thanks for your reply and kind reminder, Eric. I think usrp_spectrum_sense.py
works fine on my computer without segmentation fault.
I observe that there is a set_next_freq() function in usrp_spectrum_sense.py
file, which is used to tune the center freq used in set_freq() function,
isn't it? The target_freq is used to set the center freq of the USRP to
determine the value of DDC.
Here is the build graph part that I changed and I thought it fit my project
purpose: observing fft in larger bandwidth.
========================================
# build the graph
self.u =
usrp.source_c(which=options.which,decim_rate=options.decim)
if options.rx_subdev_spec is None:
options.rx_subdev_spec = pick_subdevice(self.u)
self.u.set_mux(usrp.determine_rx_mux_value(self.u,
options.rx_subdev_spec))
if options.width_8:
width = 8
shift = 8
format = self.u.make_format(width, shift)
print "format =", hex(format)
r = self.u.set_format(format)
print "set_format =", r
# determine the daughterboard subdevice we're using
self.subdev = usrp.selected_subdev(self.u,
options.rx_subdev_spec)
#input_rate = self.u.adc_freq() / self.u.decim_rate()
input_rate = self.u.adc_freq() / options.decim
#************************************************************
# Set the freq_step to 75% of the actual data throughput.
# This allows us to discard the bins on both ends of the spectrum.
self.min_freq = options.freq_min
self.max_freq = options.freq_max
self.freq_step = 0.75*input_rate
self.min_center_freq = self.min_freq + self.freq_step/2
nsteps = math.ceil((self.max_freq - self.min_freq) /
self.freq_step)
print "nsteps is ", nsteps
self.max_center_freq = self.min_center_freq + (nsteps *
self.freq_step)
for i in range(nsteps):
if i == 0:
self.next_freq = self.min_center_freq
else:
self.next_freq = self.next_freq + self.freq_step
print self.next_freq, "***", i, "***"
if not(self.set_freq(self.next_freq)):
print "Failed to set frequency to",
self.next_freq
self.set_freq(self.next_freq)
#************************************************************
self.scope = fftsink2.fft_sink_c (panel, title="Signal
Detection",fft_size=1024, sample_rate=input_rate,
baseband_freq=self.next_freq)
self.connect(self.u, self.scope)
self._build_gui(vbox)
# set initial values
.........................
.........................
==============================================
However, by given the lower bound and the upper bound of the freq range,
next_freq can be get and "Failed to set frequency to", self.next_freq" is
also get. and all the plots are the same, seems
self.set_freq(self.next_freq) doesn't work. Do you know why it failed to
set?
The 2nd question is, I know I call self._build_gui(vbox) within for loop. So
in GUI window, I will have several fft plots regarding the deferent center
freq. How can I get one GUI with one plot and show all the spectrum, say all
FM Stations?
I am new to Gnuradio, so any reply is helpful for me.
Thanks,
Brook
Eric Blossom wrote:
>
> Yes. Note however that at this moment there is a known problem with
> usrp_spectrum_sense.py (actually believed to be in gr_feval_dd) that
> causes a segmentation fault. See ticket:199
> http://gnuradio.org/trac/ticket/199
>
> Eric
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
--
View this message in context:
http://www.nabble.com/Is-that-possible-combining-usrp_fft.py-and-usrp_spectrum_sense.py-to-do-spectrum-analysis-and-observe-in-GUI-in-a-wider-frequency-range--tp14183248p14260983.html
Sent from the GnuRadio mailing list archive at Nabble.com.