Re: Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
Hello I wonder someone can help me out. While testing this code, the media with the different size of fft shows different value. I would like to know how I can get the same media value regardless of using different fft size. Thanks, Kyungtae-- Santix wrote : media=str(mean(m.data))# todo= p + + media + '\n'# power.write(todo)# -- This message was sent on behalf of kyung...@nec-labs.com at openSubscriber.com http://www.opensubscriber.com/message/discuss-gnuradio@gnu.org/10657497.html ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
See how the logpwrfft in gnuradio adjusts for different windows and fft lengths: http://gnuradio.org/redmine/repositories/entry/gnuradio/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py -Josh kyung...@nec-labs.com wrote: Hello I wonder someone can help me out. While testing this code, the media with the different size of fft shows different value. I would like to know how I can get the same media value regardless of using different fft size. Thanks, Kyungtae-- Santix wrote : media=str(mean(m.data))# todo= p + + media + '\n'# power.write(todo)# -- This message was sent on behalf of kyung...@nec-labs.com at openSubscriber.com http://www.opensubscriber.com/message/discuss-gnuradio@gnu.org/10657497.html ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
Firas, have to written a detailed explanation about usrp_spectrum_sense.py ? I am unable to find it. Please let us know the link for the same... Shesh Firas A. wrote: Hi, Santi Ortega wrote : ok, so I have to modify this program to show in a Frame the results I want, haven't I? Yes, OR, you can wait for me to write a detailed explanation (may be in two weeks) about usrp_spectrum_sense.py. I think the understanding of this program is very important to every gnuradio user (practical FFT implementation + FSM control in its cpp code and weird Python commands in its .py) Best regards, Firas -- View this message in context: http://www.nabble.com/Wideband-Spectrum-Analyzer-tp19974701p24162627.html Sent from the GnuRadio mailing list archive at Nabble.com. ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
shesh wrote: Firas, have to written a detailed explanation about usrp_spectrum_sense.py ? I am unable to find it. Please let us know the link for the same... Shesh http://www.nabble.com/Some-usrp_spectrum_sense.py-code-Explanation-td21209623.html#a21209623 -- View this message in context: http://www.nabble.com/Wideband-Spectrum-Analyzer-tp19974701p24163935.html Sent from the GnuRadio mailing list archive at Nabble.com. ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
Hi everybody! I have modified usrp_spectrum_sense.py to plot the results with gnuplot. There are two files: widespectrum.py and plot.p I would like everybody to test it and report me the errors and how can I improve it. I've used USRPv1 + Flex2400. Thanks in advance! Here it goes... WIDESPECTRUM.PY: #!/usr/bin/env python # # Copyright 2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. # from gnuradio import gr, gru, eng_notation, optfir, window from gnuradio import audio from gnuradio import usrp from gnuradio.eng_option import eng_option from optparse import OptionParser from usrpm import usrp_dbid import sys import math import struct import Gnuplot, Gnuplot.funcutils # Added to view the results class tune(gr.feval_dd): This class allows C++ code to callback into python. def __init__(self, tb): gr.feval_dd.__init__(self) self.tb = tb def eval(self, ignore): This method is called from gr.bin_statistics_f when it wants to change the center frequency. This method tunes the front end to the new center frequency, and returns the new frequency as its result. try: # We use this try block so that if something goes wrong from here # down, at least we'll have a prayer of knowing what went wrong. # Without this, you get a very mysterious: # # terminate called after throwing an instance of 'Swig::DirectorMethodException' # Aborted # # message on stderr. Not exactly helpful ;) new_freq = self.tb.set_next_freq() return new_freq except Exception, e: print tune: Exception: , e class parse_msg(object): def __init__(self, msg): self.center_freq = msg.arg1() self.vlen = int(msg.arg2()) assert(msg.length() == self.vlen * gr.sizeof_float) # FIXME consider using Numarray or NumPy vector t = msg.to_string() self.raw_data = t self.data = struct.unpack('%df' % (self.vlen,), t) class my_top_block(gr.top_block): def __init__(self): gr.top_block.__init__(self) usage = usage: %prog [options] min_freq max_freq # Example: ./widespectrum.py 2.23G 2.93G # that is the maximun range of the USRP Flex2400 device. parser = OptionParser(option_class=eng_option, usage=usage) parser.add_option(-R, --rx-subdev-spec, type=subdev, default=(0,0), help=select USRP Rx side A or B (default=A)) parser.add_option(-g, --gain, type=eng_float, default=None, help=set gain in dB (default is midpoint)) parser.add_option(, --tune-delay, type=eng_float, default=1e-3, metavar=SECS, help=time to delay (in seconds) after changing frequency [default=%default]) parser.add_option(, --dwell-delay, type=eng_float, default=10e-3, metavar=SECS, help=time to dwell (in seconds) at a given frequncy [default=%default]) parser.add_option(-F, --fft-size, type=int, default=256, help=specify number of FFT bins [default=%default]) parser.add_option(-d, --decim, type=intx, default=64, help=set decimation to DECIM [default=%default]) parser.add_option(, --real-time, action=store_true, default=False, help=Attempt to enable real-time scheduling) parser.add_option(-B, --fusb-block-size, type=int, default=0, help=specify fast usb block size [default=%default]) parser.add_option(-N, --fusb-nblocks, type=int, default=0, help=specify number of fast usb blocks [default=%default]) (options, args) = parser.parse_args() if len(args) != 2: parser.print_help() sys.exit(1) self.min_freq = eng_notation.str_to_num(args[0]) self.max_freq = eng_notation.str_to_num(args[1]) if self.min_freq self.max_freq: self.min_freq, self.max_freq = self.max_freq, self.min_freq # swap them # FIXME We set MANUALLY the physical limits of the device. In this case the USRP
[Discuss-gnuradio] Wideband Spectrum Analyzer
Hi everybody! I have modified usrp_spectrum_sense.py to plot the results with gnuplot. There are two files: widespectrum.py and plot.p I would like everybody to test it and report me the errors and how can I improve it. I've used USRPv1 + Flex2400. Thanks in advance! Here it goes... *WIDESPECTRUM.PY:* #!/usr/bin/env python # # Copyright 2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. # from gnuradio import gr, gru, eng_notation, optfir, window from gnuradio import audio from gnuradio import usrp from gnuradio.eng_option import eng_option from optparse import OptionParser from usrpm import usrp_dbid import sys import math import struct import Gnuplot, Gnuplot.funcutils # Added to view the results class tune(gr.feval_dd): This class allows C++ code to callback into python. def __init__(self, tb): gr.feval_dd.__init__(self) self.tb = tb def eval(self, ignore): This method is called from gr.bin_statistics_f when it wants to change the center frequency. This method tunes the front end to the new center frequency, and returns the new frequency as its result. try: # We use this try block so that if something goes wrong from here # down, at least we'll have a prayer of knowing what went wrong. # Without this, you get a very mysterious: # # terminate called after throwing an instance of 'Swig::DirectorMethodException' # Aborted # # message on stderr. Not exactly helpful ;) new_freq = self.tb.set_next_freq() return new_freq except Exception, e: print tune: Exception: , e class parse_msg(object): def __init__(self, msg): self.center_freq = msg.arg1() self.vlen = int(msg.arg2()) assert(msg.length() == self.vlen * gr.sizeof_float) # FIXME consider using Numarray or NumPy vector t = msg.to_string() self.raw_data = t self.data = struct.unpack('%df' % (self.vlen,), t) class my_top_block(gr.top_block): def __init__(self): gr.top_block.__init__(self) usage = usage: %prog [options] min_freq max_freq # Example: ./widespectrum.py 2.23G 2.93G # that is the maximun range of the USRP Flex2400 device. parser = OptionParser(option_class=eng_option, usage=usage) parser.add_option(-R, --rx-subdev-spec, type=subdev, default=(0,0), help=select USRP Rx side A or B (default=A)) parser.add_option(-g, --gain, type=eng_float, default=None, help=set gain in dB (default is midpoint)) parser.add_option(, --tune-delay, type=eng_float, default=1e-3, metavar=SECS, help=time to delay (in seconds) after changing frequency [default=%default]) parser.add_option(, --dwell-delay, type=eng_float, default=10e-3, metavar=SECS, help=time to dwell (in seconds) at a given frequncy [default=%default]) parser.add_option(-F, --fft-size, type=int, default=256, help=specify number of FFT bins [default=%default]) parser.add_option(-d, --decim, type=intx, default=64, help=set decimation to DECIM [default=%default]) parser.add_option(, --real-time, action=store_true, default=False, help=Attempt to enable real-time scheduling) parser.add_option(-B, --fusb-block-size, type=int, default=0, help=specify fast usb block size [default=%default]) parser.add_option(-N, --fusb-nblocks, type=int, default=0, help=specify number of fast usb blocks [default=%default]) (options, args) = parser.parse_args() if len(args) != 2: parser.print_help() sys.exit(1) self.min_freq = eng_notation.str_to_num(args[0]) self.max_freq = eng_notation.str_to_num(args[1]) if self.min_freq self.max_freq: self.min_freq, self.max_freq = self.max_freq, self.min_freq # swap them # FIXME We set MANUALLY the physical limits of the device. In this case the USRP Flex2400
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
*USRP_SPECTRUM_SENSE.PY* How can I use the *self.max_freq* and *self.min_freq* like a global variable? I want to use it in the *def main_loop(tb):* but if I use it *That's the given error:* *Traceback (most recent call last): File ./spectrum_output.py, line 309, in module main_loop(tb) File ./spectrum_output.py, line 246, in main_loop print min_freq, max_freq NameError: global name 'min_freq' is not defined* I tried to put *max_freq = self.max_freq min_freq = self.min_freq* in the class my_top_block(gr.top_block): def __init__(self): gr.top_block.__init__(self) where it's the first time it's used. ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
On Tue, Oct 28, 2008 at 11:43:15AM +, Santi Ortega wrote: *USRP_SPECTRUM_SENSE.PY* How can I use the *self.max_freq* and *self.min_freq* like a global variable? I want to use it in the *def main_loop(tb):* but if I use it Please see the Python tutorial. It and lots of other good stuff can be found here: http://python.org/doc Eric ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] Wideband Spectrum Analyzer
Hi! I need help to modify the usrp_fft.py file to show the spectrum of a input range (for example from 2.3GHz to 2.9GHz) ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
santi, such a wide frequency range is not possible due to limitations in the bandwidth between the usrp and the host currently you give usrp_fft a center frequency and a decimation rate, and from that it calculates the start and end frequencies... Dimitris Symeonidis If you think you're too small to make a difference, try sleeping with a mosquito! - Amnesty International On Tue, Oct 14, 2008 at 16:28, Santi Ortega [EMAIL PROTECTED] wrote: Hi! I need help to modify the usrp_fft.py file to show the spectrum of a input range (for example from 2.3GHz to 2.9GHz) ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
Yes, but I think we can take the spectrum of every 8MHz band and put it into the computer so it can memorize and show it. Sorry for my english... 2008/10/14 Dimitris Symeonidis [EMAIL PROTECTED] santi, such a wide frequency range is not possible due to limitations in the bandwidth between the usrp and the host currently you give usrp_fft a center frequency and a decimation rate, and from that it calculates the start and end frequencies... Dimitris Symeonidis If you think you're too small to make a difference, try sleeping with a mosquito! - Amnesty International On Tue, Oct 14, 2008 at 16:28, Santi Ortega [EMAIL PROTECTED] wrote: Hi! I need help to modify the usrp_fft.py file to show the spectrum of a input range (for example from 2.3GHz to 2.9GHz) ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
On Tue, Oct 14, 2008 at 11:33 AM, Santi Ortega [EMAIL PROTECTED] wrote: ok, but this program doesn't show you anything... just uOuOuO... Please reference: http://gnuradio.org/trac/wiki/UsrpFAQ/Gen#OUuainoutput Brian ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
Hi, Santi Ortega wrote : ok, so I have to modify this program to show in a Frame the results I want, haven't I? Yes, OR, you can wait for me to write a detailed explanation (may be in two weeks) about usrp_spectrum_sense.py. I think the understanding of this program is very important to every gnuradio user (practical FFT implementation + FSM control in its cpp code and weird Python commands in its .py) Best regards, Firas -- View this message in context: http://www.nabble.com/Wideband-Spectrum-Analyzer-tp19974701p19977090.html Sent from the GnuRadio mailing list archive at Nabble.com. ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
ok, so I have to modify this program to show in a Frame the results I want, haven't I? 2008/10/14 Brian Padalino [EMAIL PROTECTED] On Tue, Oct 14, 2008 at 11:33 AM, Santi Ortega [EMAIL PROTECTED] wrote: ok, but this program doesn't show you anything... just uOuOuO... Please reference: http://gnuradio.org/trac/wiki/UsrpFAQ/Gen#OUuainoutput Brian ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
ok, but this program doesn't show you anything... just uOuOuO... 2008/10/14 Firas Abbas [EMAIL PROTECTED] Hi, *Santi Ortega [EMAIL PROTECTED]* wrote: Yes, but I think we can take the spectrum of every 8MHz band and put it into the computer so it can memorize and show it. See usrp_spectrum_sense.py, it implements this technique to scan the entire spectrum available to each USRP daughter board. Regards, Firas ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Wideband Spectrum Analyzer
Hi, Santi Ortega [EMAIL PROTECTED] wrote: Yes, but I think we can take the spectrum of every 8MHz band and put it into the computer so it can memorize and show it. See usrp_spectrum_sense.py, it implements this technique to scan the entire spectrum available to each USRP daughter board. Regards, Firas ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio