[Discuss-gnuradio] Usrp_spectrum_sense.py doubts

2008-11-12 Thread Santi Ortega
Can anyone explain me this from usrp_spectrum_sense.py (line 55)?

for tap in mywindow:
power += tap*tap

mywindow is done with window.py but I didn't find where is "tap" and what it
means...
Furthermore, Does "+=" means that increase one unit to the result of
tap*tap?

Sorry if I am a little useless...
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Where is gr.fft_vcc??

2008-11-11 Thread Santi Ortega
I have been working with usrp_spectrum_sense.py but I haven't found the file
where it does the fft:

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

I've found the file window.py and self.fft_size is taken from the options...
But I dont't know the fft file!

Could anyone tell me??


Thanks in advance!
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Wideband Spectrum Analyzer

2008-11-04 Thread Santi Ortega
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

# 

Re: [Discuss-gnuradio] Wideband Spectrum Analyzer

2008-10-28 Thread Santi Ortega
*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 
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

2008-10-22 Thread Santi Ortega
I obtain this plot from 2.23GHz to 2.90GHz (with a Flex2400) but I
don't know how to put the correct frecuency on the x axis.
Because if I put this:
g('set xrange[223000:29]') # I can't see anything!

To plot I have done this:

g = Gnuplot.Gnuplot(debug=1) # Out of the while loop

g.plot(m.data) # Inside the while loop


Please help me as soon as possible and thanks in advance!

Regards,

Santiago Ortega.


spectrum.ps
Description: PostScript document
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Usrp_sense_spectrum.py doubts

2008-10-21 Thread Santi Ortega
*Usrp_sense_spectrum.py doubts*

I obtain this plot from 2.3GHz to 2.5GHz (with a Flex2400) but I don't know
how to put the correct frecuency on the x axis.
Because if I put this:
g('set xrange[23:25]') # I can't see anything!

To plot I have done this:

g = Gnuplot.Gnuplot(debug=1) # Out of the while loop

g.plot(m.data) # Inside the while loop


Please help me as soon as possible and thanks in advance!

Regards,

Santiago Ortega.


spectrum.ps
Description: PostScript document
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Re: [Patch-gnuradio] Fixing Bug in usrp_spectrum_sense.py

2008-10-17 Thread Santi Ortega
> What do you mean by reason?
I mean if you're right about this Fixing Bug in usrp_spectrum_sense.py.

> Yes it is possible. You can use gnuPlot or something like the GUI used in
fft_sink.
How?? It's seems to be too easy but I don't know so much python to do it...
Could you write me some initial code to start trying?

Thanks in advance!



2008/10/14 Firas Abbas <[EMAIL PROTECTED]>

> Hi,
>
>
> > *Santi Ortega <[EMAIL PROTECTED]>* wrote:
> >
> > Does anyone give you the reason?
>
> What do you mean by reason?
>
> > Is it possible to show the wideband spectrum in a Graphic Window?
>
> Yes it is possible. You can use gnuPlot or something like the GUI used in
> fft_sink.
>
>
> Regards,
>
> Firas
>
>
> --- On *Tue, 10/14/08, Santi Ortega <[EMAIL PROTECTED]>* wrote:
>
> From: Santi Ortega <[EMAIL PROTECTED]>
> Subject: [Patch-gnuradio] Fixing Bug in usrp_spectrum_sense.py
> To: [EMAIL PROTECTED]
> Cc: discuss-gnuradio@gnu.org
> Date: Tuesday, October 14, 2008, 8:58 PM
>
>
> Hi!
>
> about this:
>
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg00039.html
>
> Does anyone give you the reason?
>
> Furthermore, Is it possible to show the wideband spectrum in a Graphic
> Window? (Not at real-time, but introducing the data-flow and showing it in
> the computer while it comes)
>
> Thanks in Advance!
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Save the Output file in usrp_sense_spectrum

2008-10-14 Thread Santi Ortega
Hi!

How can I save the output file m.data in USRP_SENSE_SPECTRUM to plot it in
Matlab like some people say?

Thanks in advance!
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] [Patch-gnuradio] Fixing Bug in usrp_spectrum_sense.py

2008-10-14 Thread Santi Ortega
Hi!

about this:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg00039.html

Does anyone give you the reason?

Furthermore, Is it possible to show the wideband spectrum in a Graphic
Window? (Not at real-time, but introducing the data-flow and showing it in
the computer while it comes)

Thanks in Advance!
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Wideband Spectrum Analyzer

2008-10-14 Thread Santi Ortega
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

2008-10-14 Thread Santi Ortega
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

2008-10-14 Thread Santi Ortega
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


[Discuss-gnuradio] Wideband Spectrum Analyzer

2008-10-14 Thread Santi Ortega
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] How to Kill a previous Audio process

2008-10-07 Thread Santi Ortega
How to Kill a previous Audio process?
I obtain this error: audio_alsa_sink[hw:0,0]: Device or resource busy
And I remember there is a command to do it... but I don't know which!
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Simple Code

2008-10-07 Thread Santi Ortega
But i don't understand the whole code of this file (usrp_fft.py)... I just
want a simple code to pick up a signal y show it in a graphic window. I
think it's better to walk step by step...


2008/10/7 Dimitris Symeonidis <[EMAIL PROTECTED]>

> use the usrp_fft.py
>
>
> Dimitris Symeonidis
> "If you think you're too small to make a difference, try sleeping with
> a mosquito!" - Amnesty International
>
>
>
> On Tue, Oct 7, 2008 at 16:48, Santi Ortega <[EMAIL PROTECTED]>
> wrote:
> > Hi! I'm very new on this...
> > And I would like to know how to just pick up a signal of 2.4GHz (I have
> > Flex2400) and show it in a graphic window.
> >
> > Thanks!
> >
> > Regards,
> >
> > Santiago ortega.
> >
> > ___
> > 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


[Discuss-gnuradio] Simple Code

2008-10-07 Thread Santi Ortega
Hi! I'm very new on this...
And I would like to know how to just pick up a signal of 2.4GHz (I have
Flex2400) and show it in a graphic window.

Thanks!

Regards,

Santiago ortega.
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio