[Discuss-gnuradio] ADC Specs

2008-12-15 Thread Aadil Volkwin
  Hi, I have read this information regarding the USRP ADC

The full range on the ADCs is 2V peak to peak, and the input is 50 ohms
differential. This is equates to 40mW, or 16dBm.

Please may someone enlighten me, how the 40mW and 16dBm values were
calculated?

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


[Discuss-gnuradio] top_block/flowgraph problem

2008-03-24 Thread Aadil Volkwin
I am using two TVRx modules on the same motherboard to write a 1 second
sample every minute for 30mins. theoretically I should have 60 sample sets,
collectively.

I am able to write the first sample set succesfully but all writes after
that fail!

Please take a moment to look at what I may be doing wrong.

with thanks.

+

class my_top_block(gr.top_block):

def __init__(self):
gr.top_block.__init__(self)

usage=%prog: [options] output_filename0 output_filename1 

parser = OptionParser(option_class=eng_option, usage=usage)
parser.add_option(-R, --rx-subdev-spec0, type=subdev,
default=None,
help=first channel select USRP Rx side A or B
(default=A))
parser.add_option(-r, --rx-subdev-spec1, type=subdev,
default=None,
help=second channel select USRP Rx side A or B
(default=A))
parser.add_option(-d, --decim, type=int, default=256,
help=set fgpa decimation rate to DECIM
[default=%default])
parser.add_option(-f, --freq, type=eng_float, default=100e6,
help=set frequency to FREQ, metavar=FREQ)
parser.add_option(-g, --gain, type=eng_float, default=None,
help=set gain in dB (default is midpoint))
parser.add_option(-N, --nsamples, type=eng_float,
default=960,
help=number of samples to collect
[default=960])
parser.add_option(-t, --time, type=eng_float, default=0,
help=length of recording in seconds [default=0])

(options, args) = parser.parse_args ()

decim_rate = options.decim

if options.time:
options.nsamples = int(float(options.time) * 64e6 /
float(decim_rate))
else:
options.time = float(options.nsamples / (64e6 /
float(decim_rate)) )

if options.freq is None:
parser.print_help()
sys.stderr.write('You must specify the frequency with -f
FREQ\n');
raise SystemExit, 1

# setup USRP source
self.u = usrp.source_c(decim_rate = options.decim, nchan = 2)

# set up daughterboard positions and subdevices
if options.rx_subdev_spec0 is None:
options.rx_subdev_spec0 = (0,0)

if options.rx_subdev_spec1 is None:
options.rx_subdev_spec1 = (1,0)

# determine the daughterboard subdevice we're using
self.subdev0 = usrp.selected_subdev(self.u, options.rx_subdev_spec0)
self.subdev1 = usrp.selected_subdev(self.u, options.rx_subdev_spec1)

#setup Mux
mux_val0 = usrp.determine_rx_mux_value(self.u,
options.rx_subdev_spec0)
mux_val1 = usrp.determine_rx_mux_value(self.u,
options.rx_subdev_spec1)
mux_val0 |= (mux_val1   8)  0xff00
self.u.set_mux(mux_val0)


if options.gain is None:
# if no gain was specified, use the mid-point in dB
g0 = self.subdev0.gain_range()
g1 = self.subdev1.gain_range()
options.gain = float(g0[0]+g0[1])/2

self.subdev0.set_gain(options.gain)
self.subdev1.set_gain(options.gain)

ddc = -19.9e6
self.subdev = (self.subdev0, self.subdev1)


#Tune daughterboards
for n in range(2):
ok, baseband_freq = self.subdev[n].set_freq(options.freq)
print baseband Freq is: %s %
(eng_notation.num_to_str(baseband_freq))
dxc_freq, inverted = usrp.calc_dxc_freq(options.freq,
baseband_freq,
self.u.converter_rate())
print dxc Freq is: %s % (eng_notation.num_to_str(dxc_freq))
print ddc Freq is: %s % (eng_notation.num_to_str(ddc))
self.u.set_rx_freq(n, ddc)

input_rate = self.u.adc_freq() / self.u.decim_rate()
print Using RX d'board %s % (self.subdev0.side_and_name(),)
print Using RX d'board %s % (self.subdev1.side_and_name(),)
print USB sample rate: %s % (eng_notation.num_to_str(input_rate))
print Freq is set to: %s % (eng_notation.num_to_str(options.freq))
print Recording time is: %ss % (options.time)
print Mux value is: %x % (mux_val0  65535)

self.num_samples = options.nsamples

#return (self, num_samples)


def __del__(self):
# Avoid weak reference error
del self.subdev

def write_file(self, file_num, file_size):


# deinterleave two channels from FPGA
self.di = gr.deinterleave(gr.sizeof_gr_complex)

self.skiphead0 = gr.skiphead(gr.sizeof_gr_complex, 1000)
self.skiphead1 = gr.skiphead(gr.sizeof_gr_complex, 1000)

self.head0 = gr.head(gr.sizeof_gr_complex, file_size)
self.head1 = gr.head(gr.sizeof_gr_complex, file_size)

self.dst0 = gr.file_sink(gr.sizeof_gr_complex, ('moda%s' %
file_num))
self.dst1 = gr.file_sink(gr.sizeof_gr_complex, 

[Discuss-gnuradio] 2 TVRx Boards on 1 USRP

2008-03-16 Thread Aadil Volkwin
Hi,

I am trying to use 1 USRP with two TVRx daughter boards to capture Separate
FM signals and write them to file.

I get a noisy signal. I hope someone can tell me what i've done wrong. I
can't see the error.

I have included the code that i'm using. it's built from the
usrp_rx_cfile.py
---

class my_graph(gr.flow_graph):

def __init__(self):
gr.flow_graph.__init__(self)

usage=%prog: [options] output_filename0 output_filename1 
parser = OptionParser(option_class=eng_option, usage=usage)
parser.add_option(-R, --rx-subdev-spec0, type=subdev,
default=None,
help=first channel select USRP Rx side A or B
(default=A))
parser.add_option(-r, --rx-subdev-spec1, type=subdev,
default=None,
help=second channel select USRP Rx side A or B
(default=A))
parser.add_option(-d, --decim, type=int, default=128,
help=set fgpa decimation rate to DECIM
[default=%default])
parser.add_option(-f, --freq, type=eng_float, default=89e6,
help=set frequency to FREQ, metavar=FREQ)
parser.add_option(-g, --gain, type=eng_float, default=None,
help=set gain in dB (default is midpoint))
parser.add_option(-N, --nsamples, type=eng_float,
default=960,
help=number of samples to collect
[default=960])
parser.add_option(-t, --time, type=eng_float, default=0,
help=length of recording in seconds [default=0])

(options, args) = parser.parse_args ()
if len(args) != 2:
parser.print_help()
raise SystemExit, 1

filename0 = args[0]
filename1 = args[1]

decim_rate = options.decim

if options.time:
options.nsamples = int(float(options.time) * 64e6 /
float(decim_rate))
else:
options.time = float(options.nsamples / (64e6 /
float(decim_rate)) )

if options.freq is None:
parser.print_help()
sys.stderr.write('You must specify the frequency with -f
FREQ\n');
raise SystemExit, 1

# build the graph

self.u = usrp.source_c(decim_rate = options.decim, nchan = 2)

self.head0 = gr.head(gr.sizeof_gr_complex, int(options.nsamples ))
self.head1 = gr.head(gr.sizeof_gr_complex, int(options.nsamples ))

# deinterleave two channels from FPGA
self.di = gr.deinterleave(gr.sizeof_gr_complex)

self.dst0 = gr.file_sink(gr.sizeof_gr_complex, filename0)
self.dst1 = gr.file_sink(gr.sizeof_gr_complex, filename1)

# wire up the head of the chain
self.connect(self.u, self.di)

self.connect((self.di,0), self.head0, self.dst0)
self.connect((self.di,1), self.head1, self.dst1)

if options.rx_subdev_spec0 is None:
options.rx_subdev_spec0 = (0,0)
if options.rx_subdev_spec1 is None:
options.rx_subdev_spec1 = (1,0)

mux_val0 = usrp.determine_rx_mux_value(self.u,
options.rx_subdev_spec0)
mux_val1 = usrp.determine_rx_mux_value(self.u,
options.rx_subdev_spec1)

mux_val0 |= (mux_val1   8)  0xff00

self.u.set_mux(mux_val0)

# determine the daughterboard subdevice we're using
self.subdev0 = usrp.selected_subdev(self.u, options.rx_subdev_spec0)
print Using RX d'board %s % (self.subdev0.side_and_name(),)
self.subdev1 = usrp.selected_subdev(self.u, options.rx_subdev_spec1)
print Using RX d'board %s % (self.subdev1.side_and_name(),)

input_rate = self.u.adc_freq() / self.u.decim_rate()
print USB sample rate: %s % (eng_notation.num_to_str(input_rate))

print Freq is set to: %s % (eng_notation.num_to_str(options.freq))

print Recording time is: %ss % (options.time)

print Mux value is: %x % (mux_val0  65535)

if options.gain is None:
# if no gain was specified, use the mid-point in dB
g0 = self.subdev0.gain_range()
g1 = self.subdev1.gain_range()
options.gain = float(g0[0]+g0[1])/2


self.subdev0.set_gain(options.gain)
self.subdev1.set_gain(options.gain)

r0 = self.u.tune(0, self.subdev0, options.freq)
r1 = self.u.tune(0, self.subdev1, options.freq)

if not r0:
sys.stderr.write('Failed to set frequency\n')
raise SystemExit, 1

if not r1:
sys.stderr.write('Failed to set frequency\n')
raise SystemExit, 1


if __name__ == '__main__':
try:
my_graph().run()
except KeyboardInterrupt:
pass
--


thanks,

Aadil
___
Discuss-gnuradio mailing list

[Discuss-gnuradio] Re: AGC and PGC

2007-12-13 Thread Aadil Volkwin
Hi Pierre,

As far as I understand the TVRx board has two AGC stages: An RF and IF AGC.
Look in this file: (gnuradio-3.1.1/gr-usrp/src/db_tv_rx.py) to see how
GnuRadio models the gain characteristics in the data sheet and subsequently
sets the appropriate registers.

Here you will note that the PGA is also set, the PGA though does not reside
on the daughterboard, but is part of the AD9862.

I'm sure the list will correct me, if i'm mistaken.

I would be interested to see how your work in this area progresses and I
would appreciate it if you would keep me updated.
perhaps we could collaborate, i too am interested to investigate USRP and
TVRx performance in various characteristics.

I'm working towards eventually building a PCL radar.

regards,

Aadil


Date: Thu, 13 Dec 2007 09:40:27 +0100
From: JALLON Pierre 201932 [EMAIL PROTECTED]
Subject: [Discuss-gnuradio] AGC and PGC
To: discuss-gnuradio@gnu.org
Message-ID:
   [EMAIL PROTECTED]
Content-Type: text/plain; charset=us-ascii

Dear all,



I would like to compare two signals in two distinct bands of frequencies
(energy in particular) with the TVRX module.

Is there an AGC in the USRP/TVRX module ? If yes, how can I get its
value ?
How the programmable gain (set with the command set_gain of the sub
device) impacts on the energy signal ?



Thanks for your answer !

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


[Discuss-gnuradio] PS3

2007-12-13 Thread Aadil Volkwin
Hi,

I've noticed the increased interest in running GnuRadio and the USRP with
the PS3 as the computing platform.

My naive thought is that this is to explore the performance of the cell
processor architecture.

Would someone be willing to offer me their thoughts on this choice and what
are the pros and cons, from their experience?
I apologise in advance if its a silly question.


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


[Discuss-gnuradio] Sample size and data rates

2007-12-06 Thread Aadil Volkwin
Hi George, 

Thank you for your response, you've cleared up some confusion on my part.

Secondly Is anyone able to tell me where i've gone wrong with the calculation I 
mentioned in my third question?

3)If my file is 1 000 000 samples and my audio rate is 32KHz (I
understand this to be 32K samples/second) I expect my playback time to
be (1e6/32e3) = approx 30s, however when I play the file I get only
approx 3s playback time.
Im not sure where i've gone wrong.


Thanks for your input, it's much appreciated, 

Aadil


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


[Discuss-gnuradio] Re: Sample size and data rates

2007-12-06 Thread Aadil Volkwin
Hi Patrick,

Thank you for replying my msg:

when I say play I mean outputting the file to the audio sink.

The scripts and sample file can be found here:
http://rrsg.ee.uct.ac.za/members/aadil/

I've realised my calculation does not make sense.
The 1 000 000 are written at quad rate of 320KSps which is approx
3secs worth of FM signal captured. Hence playback time (to audio sink)
is approx 3secs.

My question now is how is the file being further decimated, during the
demodulation and outputting to audio sink process.

The scripts and sample file can be found here:
http://rrsg.ee.uct.ac.za/members/aadil/

regards,

Aadil


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


[Discuss-gnuradio] Sample size and data rates

2007-12-05 Thread Aadil Volkwin
Hi,

I have modified the usrp_wfm_rc.py script to capture samples of an FM
signal and write them to disk, and a second script to demodulate and
playback the samples.

The scripts are available here: http://rrsg.ee.uct.ac.za/members/aadil/

I have 3 questions:

1) 1 000 000 samples writes a file 8 000 000 bytes (7.6Mb)
This suggests each sample is 8bytes; 4bytes I and 4bytes Q.
Is my assumption correct?
Considering that the ADC produces 12bit samples, I would expect that
each I and Q sample pair would be 4bytes. 2bytes I and 2bytes Q.
Please can someone advise where i've missed some understanding.

2) With reference to the above question, where can I find further
details regarding the function of the gr.sizeof_item identifiers, in
particular gr.sizeof_gr_complex.

3)If my file is 1 000 000 samples and my audio rate is 32KHz( I
understand this to be 32K samples/second) I expect my playback time to
be (1e6/32e3) = approx 30s, however when I play the file I get only
approx 3s playback time.
Im not sure where i've gone wrong.

Thanks for your time, and I look forward to and appreciate your advice.

Aadil


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


Re: [Discuss-gnuradio] Signal reconstruction

2007-11-10 Thread Aadil Volkwin
Hi,

Firstly my apologies for posting known quantities, I guessed that members
would like to see in what way I tinkered with usrp_rx_cfile.py. point taken
though.

Screen shots of the MATLAB plots as well as the usrp_oscop.py output can be
found at:

https://rrsg.ee.uct.ac.za/members/aadil/

I'm pretty sure the MATLAB is correct.

I have upped the input freq to 250KHz, now attempting a square wave (in
desperation) and
set the options.freq to 0 in ---self.u.tune(0, self.subdev, options.freq)

I'm Still not getting sensible plots.

Thanks again,

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


Re: [Discuss-gnuradio] Signal reconstruction

2007-11-10 Thread Aadil Volkwin
Hi,

I've updated the scope screenshot on the website. Two shots are available,
notice there seems to be some kind of modulation??? I've tested the input
signal with an external scope and the input signal is fine. I don't know why
the usrp scope is misbehaving

The input signal level is set at -16.02dBm

Aadil

On 10/11/2007, Firas abbas [EMAIL PROTECTED] wrote:

 Hi,

 Use center frequency =0 in the usrp scope. If you use center frequency =
 250K, you will shift the signal to 0 Hz.

 What is your signal input level in dBm ?

 Firas

 *Aadil Volkwin [EMAIL PROTECTED]* wrote:

 Hi,

 Firstly my apologies for posting known quantities, I guessed that members
 would like to see in what way I tinkered with usrp_rx_cfile.py. point taken
 though.

 Screen shots of the MATLAB plots as well as the usrp_oscop.py output can
 be found at:

 https://rrsg.ee.uct.ac.za/members/aadil/

 I'm pretty sure the MATLAB is correct.

 I have upped the input freq to 250KHz, now attempting a square wave (in
 desperation) and
 set the options.freq to 0 in ---self.u.tune(0, self.subdev, options.freq)

 I'm Still not getting sensible plots.

 Thanks again,

 Aadil





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


Re: [Discuss-gnuradio] Signal reconstruction

2007-11-10 Thread Aadil Volkwin
It seems I need to hit return after i've entered the values, my error.

the new plot is on the website:

https://rrsg.ee.uct.ac.za/members/aadil/
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Signal reconstruction

2007-11-10 Thread Aadil Volkwin
Thanks for responding and for your input, I answer your questions below,

You're transmitting a 250kHz square source which is the summation of all
odd harmonics of 250kHz.  I believe that is why you were told to switch
over to a sine wave which you would probably just see a single tone.

I have switched over to a sine wave, but I still don't get the single peak
on the FFT as one would expect, that's the source of this conversation.

I am sorry if I am unfamiliar, but what exactly are you trying to
accomplish, and how do you expect to do it with a square wave?

What I want to do (for now) is be able to correctly digitise a signal and
write it to file (thereafter I will do various signal processing). My short
term objective is to digitise off air FM signals and perform ambiguity
measurements.

I'm using the sine wave as input and plotting it's FFT to see if I was able
to correctly digitise it.
This should be a fairly trivial 5min process but I've been at it for a
week!!

Thus far non of the suggestions have helped cure my problem.

Images of my matlab plots are available here:
https://rrsg.ee.uct.ac.za/members/aadil/

I hope you can help, I feel hopeless right now.
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Signal reconstruction

2007-11-10 Thread Aadil Volkwin
 Also, it's not clear to me what you're actually trying to do.


I'd like to capture FM signals and perform ambiguity measurements on them.

at the moment, i am failing to capture data correctly.


If you want to plot data in real time, please use either the
 usrp_fft.py or usrp_oscope.py applications.  You can capture data
 to disk using the usrp_rx_cfile.py example.

 I suggest you start with these, then do your own experiments.


These are the files that I have been using.
usrp_rx_cfile.py to write to file and usrp_fft.py and usrp_oscope.py for
realtime examination of the data and Matlab for post processing, based on
the utils in gnuradio-core.



Eric

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


[Discuss-gnuradio] Signal reconstruction

2007-11-08 Thread Aadil Volkwin
Hi,

I've been bashing my head for a couple of days on what should be a trivial
process.
I would really appreciate it if somebody could please come to my rescue.

I'd like to digitise a signal, intented to be off air FM signal, but for the
moment, i'm capturing a 50KHz sinusiod and doing the reconstruction in
MATLAB to test that im capturing the samples correctly.

on plotting the FFT in MATLAB, it's clear that something's a miss...I don't
know where :/ i've been at this for ages!!!

here's my code: I really hope somebody can help, I know this should be a
simple matter. The Matlab code follows below the Python stuff.

=

#!/usr/bin/env python


Read samples from the USRP and write to file formatted as binary
outputs single precision complex float values or complex short values
(interleaved 16 bit signed short integers).



from gnuradio import gr, eng_notation
from gnuradio import audio
from gnuradio import usrp
from gnuradio.eng_option import eng_option
from optparse import OptionParser

class my_graph(gr.flow_graph):

def __init__(self):
gr.flow_graph.__init__(self)

usage=%prog: [options] output_filename
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(-d, --decim, type=int, default=8,
  help=set fgpa decimation rate to DECIM
[default=%default])
parser.add_option(-f, --freq, type=eng_float, default=50e3,
  help=set frequency to FREQ, metavar=FREQ)
parser.add_option(-g, --gain, type=eng_float, default=None,
  help=set gain in dB (default is midpoint))
parser.add_option(-N, --nsamples, type=eng_float,
default=2000,
  help=number of samples to collect
[default=+inf])

(options, args) = parser.parse_args ()
if len(args) != 1:
parser.print_help()
raise SystemExit, 1

filename = args[0]

if options.freq is None:
parser.print_help()
sys.stderr.write('You must specify the frequency with -f
FREQ\n');
raise SystemExit, 1

# build the graph

self.u = usrp.source_c(decim_rate=options.decim)

self.dst = gr.file_sink(gr.sizeof_gr_complex, filename)

self.head = gr.head(gr.sizeof_gr_complex, int(options.nsamples))

self.connect(self.u, self.head, self.dst)


rx_subdev_spec = usrp.pick_rx_subdevice(self.u)
self.u.set_mux(usrp.determine_rx_mux_value(self.u,
options.rx_subdev_spec))

# determine the daughterboard subdevice we're using
self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
print Using RX d'board %s % (self.subdev.side_and_name(),)
input_rate = self.u.adc_freq() / self.u.decim_rate()
print USB sample rate %s % (eng_notation.num_to_str(input_rate))
print Freq is set to: %s % (options.freq)

if options.gain is None:
# if no gain was specified, use the mid-point in dB
g = self.subdev.gain_range()
options.gain = float(g[0]+g[1])/2

self.subdev.set_gain(options.gain)

r = self.u.set_rx_freq (0, options.freq) #self.u.tune(0, self.subdev,
options.freq)
if not r:
sys.stderr.write('Failed to set frequency\n')
raise SystemExit, 1


if __name__ == '__main__':
try:
my_graph().run()
except KeyboardInterrupt:
pass
==

MATLAB

ms = 1e-3;
kHz = 1e3;


count = 2000;
decim_rate = 8;
Fsamp = 64e6;
Fsamp_real = Fsamp./decim_rate;

%set the time axis
dt = 1./Fsamp_real;
T_end = count./Fsamp_real;
t = 0:dt:T_end-dt;
%t = dt:dt:T_end;


df = fopen('signal_samples.dat');
y = fread (df,[2, count], 'float');
fclose(df);


%plot I and Q
figure (1)
subplot(211)
plot(t/ms,y(1,:));
grid on;
xlabel('ms')
title ('I data')
subplot(212)
plot(t/ms,y(2,:));
grid on;
xlabel('ms')
title ('Q data')

%remove the artefact
z = y(:,601:end);
t0 = t(1:end-600); %new time!

%plot I and Q again
figure (2)
subplot(211)
plot(t0/ms,z(1,:));
grid on;
xlabel('ms')
title ('I data')

subplot(212)
plot(t0/ms,z(2,:));
grid on;
xlabel('ms')
title ('Q data')

%compute fft
z_spectrum = fftshift(fft(z));

%compute frequency axis
df = 1/(t0(end)-t0(1));
freq_axis = -Fsamp_real/2 :df :Fsamp_real/2;

%FFT module
figure (3)
subplot(211)
plot(freq_axis/kHz,abs(z_spectrum(1,:)))
xlabel('kHz')
title ('I data spectrum')

subplot(212)
plot(freq_axis/kHz,abs(z_spectrum(2,:)))
xlabel('kHz')
title ('Q data spectrum')

%FFT phase
figure (4);hold on;
plot(freq_axis/kHz,(angle(z_spectrum(1,:))*180/pi))
plot(freq_axis/kHz,(angle(z_spectrum(2,:))*180/pi),'r')
xlabel('kHz')
ylabel('deg')
title ('I and Q phases')


==

[Discuss-gnuradio] error with import

2007-08-01 Thread Aadil Volkwin
Hi,

when running this file, tvrx_total_power.py (attached) I run into the
following problem, output shown below, and the pc hangs. I have not
encountered this previously and am at a loss.
other usrp related examples from the examples folder do run.
I would appreciate some advice if you have any ideas.

thanks,


[EMAIL PROTECTED]:~/gnuradio-3.0.2/gnuradio-examples/python/usrp$
./tvrx_total_power.py
from: can't read /var/mail/gnuradio

from gnuradio import gr, gru, usrp
import usrp_dbid
from gnuradio import audio
from gnuradio import blks
import os
import time
import struct


fg=gr.flow_graph()

### Create the USRP ###
u = usrp.source_c(decim_rate=32) # decimation is even values in range [4, 256].
# 4 can only be used with 4 bit sampling
width = 8
shift = 8
format = u.make_format(width, shift)
#r = u.set_format(format)   # Uncomment to enable 8-bit sampling
#print set_format =, r# Uncomment to enable 8-bit sampling

usrp_rate = u.adc_freq() / u.decim_rate()


### determine the daughterboard subdevice we're using ###
rx_subdev_spec = usrp.pick_subdev(u, (usrp_dbid.TV_RX,))
u.set_mux(usrp.determine_rx_mux_value(u, rx_subdev_spec))
subdev = usrp.selected_subdev(u, rx_subdev_spec)


### Change the baseband lowpass filter on daughterboard to reduce bandwidth.
### Can be set anywhere from 4 to 33MHz ###
#subdev.set_bw(1e6)


 set initial values

# Set gain to max
# Gain is 0 to 104, in steps of 1
g_range = subdev.gain_range()
subdev.set_gain(0)


# Set frequency to mid-point
# Frequency is 500MHz to 2.6GHZ, in steps of 1MHz
f_range = subdev.freq_range()
freq = 100e6# frequency to tune to
r = u.tune(0, subdev, freq) # 0 is DDC channel


#Complex to Float Conversion
c2f=gr.complex_to_float()

#Multiplier
multiplier = gr.multiply_ff ()
multiplier1 = gr.multiply_ff ()

#Adder
adder = gr.add_ff()


#Vector sink
sink = gr.file_sink(gr.sizeof_float, temp_power.dat)

#Wiring it all together
fg.connect(u,c2f)

fg.connect((c2f,0),(multiplier,0))
fg.connect((c2f,0),(multiplier,1))

fg.connect((c2f,1),(multiplier1,0))
fg.connect((c2f,1),(multiplier1,1))

fg.connect(multiplier,(adder,0))
fg.connect(multiplier1,(adder,1))

fg.connect(adder, sink)

fg.start()


#Set number of samples
num_samples = 1000
repeat = 20 #repeat 20 times

#Run graph until correct number of samples written to file
while os.path.getsize(temp_power.dat)  num_samples * (repeat+1) * gr.sizeof_float:
time.sleep(0.0001)

#Stop the graph
fg.stop()

#Read in num_samples at a time, and display the average
fin = open(temp_power.dat, 'rb')
total_sum = 0

#Dump the first set of samples as they will be erroneous (bug in USRP)
fin.read(num_samples * gr.sizeof_float)


for i in range(repeat):

# Read in first set of samples to a list
data = struct.unpack(str(num_samples) + 'f' ,fin.read(num_samples * gr.sizeof_float))

#Now average out the data and print the result
sum = 0
for val in data: sum += val
print sum / num_samples * 1.0

total_sum += sum / num_samples * 1.0

#Now print average of all samples
print Overall Average:  , total_sum/repeat * 1.0___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Re: error with import

2007-08-01 Thread Aadil Volkwin
Hi again,

I found my error.

im sorry, ive realised I was being silly... its been a long a day.

I cant believe its taken me as long as it has to figure that one out.

regards,

Aadil

 Message: 6
 Date: Wed, 1 Aug 2007 13:47:55 +0200 (SAST)
 From: Aadil Volkwin [EMAIL PROTECTED]
 Subject: [Discuss-gnuradio] error with import
 To: discuss-gnuradio@gnu.org
 Message-ID:
   [EMAIL PROTECTED]
 Content-Type: text/plain; charset=iso-8859-1

 Hi,

 when running this file, tvrx_total_power.py (attached) I run into the
 following problem, output shown below, and the pc hangs. I have not
 encountered this previously and am at a loss.
 other usrp related examples from the examples folder do run.
 I would appreciate some advice if you have any ideas.

 thanks,


 [EMAIL PROTECTED]:~/gnuradio-3.0.2/gnuradio-examples/python/usrp$
 ./tvrx_total_power.py
 from: can't read /var/mail/gnuradio

 -- next part --
 A non-text attachment was scrubbed...
 Name: tvrx_total_power.py
 Type: text/x-python
 Size: 2795 bytes
 Desc: not available
 Url :
 http://lists.gnu.org/pipermail/discuss-gnuradio/attachments/20070801/9be3d396/tvrx_total_power.py

 --

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


 End of Discuss-gnuradio Digest, Vol 57, Issue 1
 ***





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


[Discuss-gnuradio] microtune RF TUNER MODULE query

2007-07-05 Thread Aadil Volkwin
Hi,

I'm doing some tests on the microtune 4937 DI5 RF TUNER MODULE (3x7702) to
determine the modules gain sensitivity.

Essentially, i'd like to reproduce the IF AGC and RF AGC graphs, shown in
the modules datasheet.

I intend on using the _set_rfagc and _set_ifagc methods in the db_tv_rx.py
module to set the gain but am not able to determine the actual RF and IF
Levels from the amps on the module.

Does anyone know how I can access these values, from within the GNU Radio
modules

Thanks,

Aadil




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


[Discuss-gnuradio] Re: Installation problems

2007-07-03 Thread Aadil Volkwin
Hi Ziad,

Thanks for your help, it worked.

However, Is this something that I must do each time I restart, as I did
previously do this step, as suggested in the Installation instructions on
the gnuradio website.

thanks again,

Aadil


 Message: 5
 Date: Mon, 2 Jul 2007 13:18:21 -0700 (PDT)
 From: Ziad ElMarakshy [EMAIL PROTECTED]
 Subject: Re: [Discuss-gnuradio] Installation problems
 To: Discuss-gnuradio@gnu.org
 Message-ID: [EMAIL PROTECTED]
 Content-Type: text/plain; charset=us-ascii


 hey aadil
 try writing this code in your terminal

 $ cp /etc/ld.so.conf /tmp/ld.so.conf
 $ echo /usr/local/lib  /tmp/ld.so.conf
 $ sudo mv /tmp/ld.so.conf /etc/ld.so.conf
 $ sudo ldconfig

 hope it works
 ziad




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


[Discuss-gnuradio] Installation problems

2007-07-02 Thread Aadil Volkwin
Hi,

I'm having trouble with the installation of gnu radio on my laptop (acer
travelmate 230series).

I'm running ubuntu Edgy and have installed all the neccessary packages via
Synaptic package manager.

The following is the output once I try to run one of the example programs,

[EMAIL PROTECTED]:~/gnuradio-3.0.2/gnuradio-examples/python/audio$ 
./mono_tone.py
Traceback (most recent call last):
  File ./mono_tone.py, line 23, in ?
from gnuradio import gr
  File /usr/local/lib/python2.4/site-packages/gnuradio/gr/__init__.py,
line 27, in ?
from gnuradio_swig_python import *
  File
/usr/local/lib/python2.4/site-packages/gnuradio/gr/gnuradio_swig_python.py,
line 4, in ?
import _gnuradio_swig_python
ImportError:
/usr/local/lib/python2.4/site-packages/gnuradio/gr/_gnuradio_swig_python.so:
undefined symbol: _ZTI11gr_feval_ll
[EMAIL PROTECTED]:~/gnuradio-3.0.2/gnuradio-examples/python/audio$


I believe I have installed all the packages correctly.

Thanks,

Aadil



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


[Discuss-gnuradio] FFT Spectral smoothing

2007-06-21 Thread Aadil Volkwin
Hi,

i'd like to do spectral smoothing on an FFT in real time through
GNU_RADIO.

Is there a function that will allow me to do this in the GNU_RADIO
modules?

If not has anyone attempted it before, or have any suggestions as to how
I should go about implementing it myself.

Perhaps any ideas of cascading blocks that do exit.

Thanks,

Aadil



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