[Discuss-gnuradio] A simple analogue question.

2010-04-11 Thread Sebastiaan Heunis
Hi everyone.

I was wondering if someone could please answer the following question?

If I have two signals entering a receiver, both with a power of 0 dBm,
what would be the total input power seen by the receiver?  Is it 3 dBm
or 6 dBm?

Thanks.

Sebastiaan

-- 
Sebastiaan Heunis
Tel:  +27 72 950 9370


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


Re: [Discuss-gnuradio] Multiple Channel USRP Confusion

2010-03-10 Thread Sebastiaan Heunis
Dan

I haven't used GNURadio companion before, but what you need to do is the
following:

Set the mux to (0xf1f0f1f0).  This will connect ADC0 (which is the first ADC
on side A) to the I input of the first DDC in the USRP.  ADC1 (which is also
on side A) will be connected to the I input of the second ADC.  Then you
just wire up your two chains in your GNURadio apps and use a deinterleaver
to connect the appropriate channel to the right blocks in your app.  There
is an example app somewhere in the Gnuradio installation directory that
shows how to receive 4 real channels with 2 LFRX boards.

Sebastiaan



>
> On Tue, Mar 9, 2010 at 10:33 PM, dan s  wrote:
>
>> Hi all,
>>
>> I am looking to simultaneously record two real signals (not with IQ) using
>> a single LFRX daughtercard.
>>
>> How can I do this with GNURadio companion?  I have spent a while looking
>> at the USRP Source and Dual USRP Source blocks and could not figure out.
>>
>> I am looking to record from Side A with RXA and RXB.  I tried setting the
>> RX Antenna setting to RXAB and used the complex to real block to extract
>> channel RXA, and complex to imaginary block to extract RXB.  I don't think
>> this worked properly.
>>
>> I also tried using two separate USRP source blocks, each on side A but one
>> for RXA and the other for RXB.  When I did this I got an error related to
>> already having one USRP side A block running.
>>
>> Any help would be greatly appreciated
>>
>> Thanks,
>> Dan
>>
>>
>>
>>
>>
>>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] data from adc

2010-01-18 Thread Sebastiaan Heunis
Kyungtae

Do you mean directly after it is sampled, before any of the DDC
functions?  Then the answer is no.  You will have to decimate by a
factor of at least 4 when using real sampling and 8 when using complex
sampling to be able to get the data over the USB link (for the USRP1).

Sebastiaan

-- 
Sebastiaan Heunis
Radar Remote Sensing Group, University of Cape Town, South Africa
Tel:  +27 72 950 9370


On Mon, Jan 18, 2010 at 7:46 PM, Kyungtae Kim  wrote:
> Hi,
>
>
>
> Is there a way to get the data from ADC directly? I can find some examples
> to get it with using FFT, however without FFT, I wonder how it can be
> gotten.
>
>
>
> Thanks,
>
> Kyungtae
>
> ___
> 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] Maximum number of DDCs?

2009-12-12 Thread Sebastiaan Heunis
> You can just bring the whole 8MHz in a single block then split it on the
> PC side. It'll be horribly CPU expensive but if you code a special CUDA
> block that would work.

The analysis filterbank block should easily do the above task (only a
couple of multiplies for the prototype filter and a 32/64 point FFT).

-- 
Sebastiaan Heunis
Radar Remote Sensing Group, University of Cape Town, South Africa
Tel:  +27 72 950 9370


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


Re: [Discuss-gnuradio] USRP2 Halfband filter coefficients help

2009-11-11 Thread Sebastiaan Heunis
Hi

I can help a bit with the implementation of the one HBF.  It has
31taps, of which every second one, apart from the center one is zero.
the center one is scaled relative to one (2^18 on the FPGA).  In total
there is therefore (16+the center one) non-zero taps.  This requires 8
multiplications (because of the symmetry, we can simply add the 1st
and 31st,3rd and 29th values,etc. and then multiply by the appropriate
tap value.  For the center tap,we just need to bit-shift the sample at
that position appropriately.

Hope this helps a bit.

Sebastiaan


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


Re: [Discuss-gnuradio] USRP2 Halfband filter coefficients help

2009-11-10 Thread Sebastiaan Heunis
Hi

I think Brian is just referring to the fact that you can see that the
HBFs are implemented as symmetric FIR filters (the coefficients).  A
HBF is just a special filter that is designed so that the cutoff
frequency will always be at fs/2, so if you filter with it and
decimate by 2 afterwards (which is why you would use an HBF), you
don't get aliasing.  Also, the decimation in the CIC filters can be
set to a wide range of values, so the HBF will always have to cut at
fs/2 regardless of the decimation in the CIC.  From what I've read,
Goodman and Carey came up with them so you can probably look for some
papers if you're interested.

Sebastiaan

-- 
Sebastiaan Heunis
Radar Remote Sensing Group, University of Cape Town, South Africa
Tel:  +27 72 950 9370


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


Re: [Discuss-gnuradio] CMA equalizer

2009-11-07 Thread Sebastiaan Heunis
Hi

For the CMA equaliser, the modulus refers to the desired I^2+Q^2
(modulus) value that each sample pair should have.  This is a constant
value, since any variations are due to multipath.  The algorithm tries
to remove amplitude variations given what the modulus of the signal
should be in the absence of multipath.

mu is the step size.  I don't exactly know how to calculate the
boundaries for mu to ensure convergence, but you're right, it is
related to the higher-order statistics of the signal.  I know that mu
should be very small (something like 1*10^-9) to ensure convergence.
All the times I've used it, I've used trial and error to get a value
for mu.

I implemented a CMA equaliser in Matlab that I can send you if you're
interested.

Sebastiaan

-- 
Sebastiaan Heunis
Radar Remote Sensing Group, University of Cape Town, South Africa
Tel:  +27 72 950 9370


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


Re: [Discuss-gnuradio] FM receiver doesn't work

2009-10-06 Thread Sebastiaan Heunis
Fatih

The fm receiver demo will work when you use a TVRX daughterboard.  You
can use a BasicRX daughterboard, but then you would have to use an
analogue filter to prevent aliasing and you would also need to read up
on bandpass sampling to figure out where your frequency of interest
would end up after being sampled at 64Msps.

Sebastiaan


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


Re: [Discuss-gnuradio] USRP decimation range change while upgrading from gnuradio 3.1.2 to 3.2.2

2009-08-19 Thread Sebastiaan Heunis
Hi Todd

I had a look at convig.vh which determines what gets included with
different fpga firmware builds.  It seems as if the 4 receiver, 0
transmitter version only uses CIC filters and no halfband filters
which explains why you should only be able to decimate by 128.

I don't know what happened previously where you decimated by 250.  The
low level C code which writes the FPGA registers checks whether the
build includes HB filters.  If there are some, you are able to
decimate by up to 256.  If there aren't any, an exception should be
thrown when the decimation rate is above 128.  In your case this
didn't happen.  This is all I know about your problem.  Hopefully it
helps a bit.  This from usrp_standard.cc:

bool
usrp_standard_rx::set_decim_rate(unsigned int rate)
{
  if (has_rx_halfband()){
if ((rate & 0x1) || rate < 4 || rate > 256){
  fprintf (stderr, "usrp_standard_rx::set_decim_rate: rate must be
EVEN and in [4, 256]\n");
  return false;
}
  }
  else {
if (rate < 4 || rate > 128){
  fprintf (stderr, "usrp_standard_rx::set_decim_rate: rate must be
in [4, 128]\n");
  return false;
}
  }

Sebastiaan

--
Sebastiaan Heunis
Radar Remote Sensing Group, University of Cape Town, South Africa
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] USB transfers speeds with USRP 1

2009-07-28 Thread Sebastiaan Heunis
Thanks, I managed to sort the problem out.  Firstly, I enabled
realtime scheduling by looking at usrp_spectrum_sense.py.  Next I used
the RAMdisk in Ubuntu /dev/shm to run my application in (thanks
Jason).

Result is that I am able to sample two channels at 4Msps IQ each and
write it to disk afterwards.

Sebastiaan


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


[Discuss-gnuradio] USB transfers speeds with USRP 1

2009-07-27 Thread Sebastiaan Heunis
Can anyone please help me with something?

I have an application using 2 tv tuner modules that I need to capture
samples from.  The code that explains what the setup follows.

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

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, int(options.nsamples ))
self.head1 = gr.head(gr.sizeof_gr_complex, int(options.nsamples ))

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)

self.connect(self.u, self.di)

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

self.u.set_mux(gru.hexint(0xf2f0f2f0))

After this I set the gains of the tv tuners and the ddc and tuner
frequencies.  When I use a decimation of 16 (resulting in two IQ
channels at 4Msps each) and try to capture 10seconds of data, I get a
lot of 'uO' messages on the console.  When I use a decimation of 32, I
still get some 'uO' messages on the console.  Only when using a
decimation of 64 (two 1Msps IQ channels) do I not get any 'uO'
messages when capturing 10s of data.

Now, the funny thing is that when I run test_usrp_standard_rx in
/usrp/host/apps using sudo ./test_usrp_standard_rx -D 8 -M 900, I get
noverruns=0.  So with my PC and USRP I can actually get a transfer
rate of 32MB/s which leads me to believe that something in the setup
of my application might cause the problems with the USB transfer rate.

Does anyone have any ideas to what might be happening?

Thank you in advance.

Sebastiaan

-- 
Sebastiaan Heunis
Radar Remote Sensing Group, University of Cape Town, South Africa
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] TVRX question

2009-06-21 Thread Sebastiaan Heunis
Martin

Thanks for the reply.  How do I set the mux then?  Is 0xf2f0f2f0
correct when I have 2 TV tuner modules and 0xf0f0f0f0 correct when I
have only one?

Just to recap, in case you can't remember what the mux, etc. looks
like.  ADC 0 and 1 are on the first IC and ADC 2 and 3 are on the
second IC.  The mux bits look as follows.

Chan3 Chan2 Chan1 Chan0
Q I  Q I  Q I  Q I

So 0xf2f0f2f0 connects ADC0 to the I of Chan0, a zero to the Q of
Chan0, ADC2 to the I of Chan1 and a zero to the Q of Chan1.  Is this
fine?  Then I just use a deinterlever on the PC and connect Chan0 and
Chan1 to separate file sinks?

Thanks

Sebastiaan


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


[Discuss-gnuradio] TVRX question

2009-06-21 Thread Sebastiaan Heunis
Hi all

For some reason I always thought that the TVRX daughterboards support
IQ sampling.  Turns out I was wrong.  How do I modify my applications
for I sampling?  Can I just wire up a whole IQ chain, save files in IQ
format, use read_complex_binary.m to read it in and discard the Q
part?  How do I setup the USRP to only have an I path on the inside?
Do I just use usrp_source_s and then read saved files using
read_float_binary.m?

Thanks in advance.

Sebastiaan

-- 
Sebastiaan Heunis
Radar Remote Sensing Group, University of Cape Town, South Africa
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] New to gnuradio - Complex sampling question - urgent

2009-06-12 Thread Sebastiaan Heunis
Jason

>From what I've picked up, you need two external sampled signals to get
an I-Q signal.  With the TV tuner daughterboard, you automatically get
two signals.  You just need to set the mux accordingly.  When you use
a BasicRX, you need to feed the same signal to both inputs and use a
mux value of 0x32103210.

Sebastiaan

On Fri, Jun 12, 2009 at 5:50 PM, Jordan J Riggs wrote:
> If I understand correctly, the real signal picked up by the antenna is mixed
> with two sine waves, 90 degrees out of phase, to create the I and Q
> components at baseband (depending on the daughterboard, there may be an
> intermediate frequency involved). The I and Q signals are then sampled by
> the ADCs. I and Q are then interleaved and sent over USB.
> See page 9 of the USRP FAQ for more info.
> http://www.scribd.com/doc/9688095/USRP-Documentation
>
> Jordan
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>



-- 
Sebastiaan Heunis
Radar Remote Sensing Group, University of Cape Town, South Africa
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] Re: analysis_filterbank question

2009-06-12 Thread Sebastiaan Heunis
This is the same reason why Matlab has an 'fftshift' function.

Sebastiaan


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


[Discuss-gnuradio] Question about the USB of USRP1

2009-06-04 Thread Sebastiaan Heunis
Hi all

I've got a question about the bandwidth that the USRP1 can support
across the USB.  We have 32MB/s across the USB corresponding to 8Msps
for a single I-Q stream.  When we have two I-Q streams, this becomes
4Msps for each stream.

This means that when I have two I-Q sampled channels, I should be able
to set the decimation for each channel to 16.  This does however not
work.  With two I-Q channels, if I set decimation to 16, I get about
40 of those 'uO' s printed on my screen.  With a decimation of 32, I
get about 4.  With a decimation of 64, I get none.  So, currently I am
only able to support 8MB/s accross my USB without losing any samples.

I ran the usrp_benchmark_usb.py and got the following:

Testing 32MB/sec... usb_throughput = 32M
ntotal= 1600
nright= 1565
runlength = 1565
delta = 35
OK

So here I'm also losing 35 samples?

I have an HP Pavilion dv6500 laptop with a 1.5GHz Core2Duo CPU and 2GB
of RAM.  I'm also using a CPU frequency scaling utility to make sure
that my PC is running at full blast.  Might it be that the USB
controllers of laptops aren't that great, or is it normal to lose some
samples at 32MBps?

Thanks.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town, South Africa
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] Spectrum Analysis with FFT plotting

2009-06-01 Thread Sebastiaan Heunis
Ujala

That looks like an FM signal at DC with another FM signal about 150kHz
away.  The modulating signal of the FM wave in your picture is
probably speech.  If you capture another set of samples using the same
procedure, but with rock/rap/hip hop music, etc. (in other words
anything with a lot of spectral content), you should see a better bell
shape.  The signal should then sit between about -50kHz and 50kHz on
your plot.  FM's maximum frequency deviation is 75KHz either way of
the carrier, so music should give you something close to that (hence
the -50kHz to 50kHz).  Hope this helps.

Regards

Sebastiaan


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


Re: [Discuss-gnuradio] Does USRP do phase estimation when down convertion?

2009-05-31 Thread Sebastiaan Heunis
Isulsz

The DDC on the USRP only mixes the signal down using the CORDIC
algorithm.  The CORDIC only multiplies the input signal by scale
values corresponding to cos and sine.  The phase estimation should
happen in the C++ code on the PC then.

Sebastiaan


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


Re: [Discuss-gnuradio] Spectrum Analysis with FFT plotting

2009-05-31 Thread Sebastiaan Heunis
Ujala

You have to use usrp.tune(self.u, 0, self.subdev,106.2e6).  This will
mix whatever is at 106.2MHz down to DC.  set_rx_freq is used to
control the DDC in the USRP and only works from -32e6 to 32e6MHz.

The tune function first uses the mixer in the TVRX db to mix the
signal down to 5.75MHz (the TVRX db that I'm using mixes the signal
down to 44MHz).  If you're using your db, the signal gets sampled and
sits at 5.75MHz.  The DDC now needs to mix it down to DC.  The tune
function takes care of both of these functions for you.

Try to capture a signal by setting decimation to 250 and tuning to
106.2MHz.  The result should be a signal shaped like a bell that
nearly spans the entire length of the plot.

Sebastiaan


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


Re: [Discuss-gnuradio] USRP/LFRX ADC Saturation and Range

2009-05-31 Thread Sebastiaan Heunis
Hi Dan

I tried similar experiments to determine what sample level corresponds
to saturation when using a BasicRX.  I think the maximum sample level
that I got to was around 8000->-8000 when using a 10dBm input.  I
guess this might also be dependent on the decimation in the CIC, etc.
I've also noticed that the ADC doesn't clip at saturation.  The gain
just becomes much smaller.

One thing that you might try is the following (just a suggestion).
Connect a signal generator to your USRP.  Then use an FFT sink to
display your signal.  Set it so that the y-axis resolution is 1dB.
Now you can vary your input signal and see where a 1dB change in input
signal does no longer correspond to a 1dB change in the sampled
signal.  If you digitise an input signal at this level, you should
have the maximum sample value before saturation.

As I've said, I'll do the Icarus simulations sometime and see what the
maximum sample value is.

Sebastiaan


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


Re: [Discuss-gnuradio] Spectrum Analysis with FFT plotting

2009-05-31 Thread Sebastiaan Heunis
Ujala

With a decimation of 250, your USRP will only provide you with the
samples from -128kHz to 128kHz-1.  So, unless your station of interest
is very close to DC, you won't see it on an FFT of your data.  If your
signal is at an IF of 5.75MHz, you will need to sample at 16Msps in
order to digitise it.

Try an experiment.  Tune your USRP to 106.2MHz (so that your radio
station now sits at DC).  Set the decimation to 250
(Fs=64e6/250=256ksps).  Now capture 1s of data and do a 256000 point
FFT in Matlab.  You should now see a nice FM signal at DC.

You can use the usrp_wfm_rcv.py gnuradio-examples script to see what
happens in the FM band where you are.

Sebastiaan


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


Re: [Discuss-gnuradio] Spectrum Analysis with FFT plotting

2009-05-30 Thread Sebastiaan Heunis
Ujala

I don't know what you mean by the range of frequencies?  I'm guessing
you're just referring to the x-axis labels in Matlab.  That would
depend on your sampling frequency after the decimation and the number
of points that you use for the FFT.  Let's say your sampling frequency
is 16Msps and you're taking 1s of data for the FFT.  Your x-axis will
look as follows:

-1600/2:1:(1600/2)-1 or
-samp_freq/2:samp_freq/no_samples:(samp_freq/2)-1

If you get a peak in the middle of your data, then you have a DC
offset somewhere.

Sebastiaan


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


Re: [Discuss-gnuradio] USRP/LFRX ADC Saturation and Range

2009-05-30 Thread Sebastiaan Heunis
Hi Dan.

I don't think 2^16 denotes the maximum sample value in the USRP.  We
have a 12bit ADC, so we start off with -2048->2047.  This then gets
bit shifted to the right by 3 places when it enters the USRP, so we
have x8.  The CORDIC causes our sample values to be divided by about
1.6.  Then we also have the CIC and HBF.  The CIC's gain varies
depending on the decimation and the HBF's gain is 1bit (6dB).

Looking at the ADC's datasheet, we need 2Vp-p to fully utilise its
dynamic range.  The input impedance of the ADC is around 220ohms so
this is equal to an input signal level of about 6dBm.  If you go above
this you will get saturation.

I want to do some simulations with input signals and the algorithms on
the USRP to determine the maximum sample value.  I'll post the results
of this when I'm done.

Sebastiaan


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


Re: [Discuss-gnuradio] Ways to limit stored vector length with file_sink( )

2009-05-23 Thread Sebastiaan Heunis
YC

I only have Gnuradio with a USRP1, but I assume the procedure should
be similar.  There are two blocks, head and skiphead that allow you to
play around with where you want to start recording samples and how
many you record.

Sebastiaan


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


Re: [Discuss-gnuradio] USRP Quartus project same version as GNURadio ?

2009-05-22 Thread Sebastiaan Heunis
Mark

Have you made sure that the .rbf is in /usr/local/share/usrp/rev4?
Also, I think that when you issue ls -l when you are in the directory
containing the .rbf file, you should get:

-rw-r--r-- usrp_std.rbf

Sebastiaan


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


Re: [Discuss-gnuradio] Problem downloading firmware to USRP

2009-05-20 Thread Sebastiaan Heunis
Natalia

Maybe you should have a look at /usr/local/share/usrp where the .rbf
files that get downloaded to the USRP are?  Try specifying a .rbf file
when you initialise the USRP in your script.

I'm just guessing a bit here.

Sebastiaan

Hello Sebastiaan,

Thanks a lot for your prompt answer. Yes I am using Ubuntu and I
execute the scripts as root.  However, I also configured once the
access for another user in the system called default. So the commands
you suggested look like:

$ cat /etc/group|grep usrp
usrp:x:1002:default
$ cat /etc/udev/rules.d/10-usrp.rules
ACTION=="add", BUS=="usb", SYSFS{idVendor}=="fffe",
SYSFS{idProduct}=="0002", GROUP:="usrp", MODE:="0660"

The thing is that I can use the same gnuradio installation with a
different USRP and it works, so I would say this is a USRP problem
rather than a permissions problem.

There is also this issue with the LED only blinking at higher speed
and never slowing down that I mentioned in my email to the list. What
could be happening?

Best regards
Natalia Olano

2009/5/20 Sebastiaan Heunis :
> Natalia
>
> I don't know which Linux you're using.  I'm guessing Ubuntu.  I'll try to 
> help.
>
> When you sudo gedit /etc/group, do you get a line similar to this somewhere?
>
> usrp:x:1001:user
>
> where user is your username on your system?
>
> Also, when you sudo gedit /etc/udev/rules.d/10-usrp.rules, do you get
> something similar to the following?
>
> ACTION=="add", BUS=="usb", SYSFS{idVendor}=="fffe",
> SYSFS{idProduct}=="0002", GROUP:="usrp", MODE:="0660"
>
> Sebastiaan
>
> --
> Sebastiaan Heunis
> Radar and Remote Sensing Group, University of Cape Town, South Africa
> Tel:  +27 83 305 5667
>


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


Re: [Discuss-gnuradio] Creating .dat file from .mp3 or.wav file!

2009-05-20 Thread Sebastiaan Heunis
Salman

Somewhere on a website I found a way to transmit mp3 files using the
USRP.  Just can't remember where.  What you do is the following:

Use sox to decode the mp3 to a raw file:

sox myfile.mp3 -r 44100 -l -f -c 1 myfile.raw

You can then just open this file in a Gnuradio script and proceed from
there.  It works.  I'm only doing mono at the moment, but I'm sure sox
can do stereo.  I think Gnuradio has a filetype to import wav files if
you need that.

Sebastiaan


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


Re: [Discuss-gnuradio] Cordic question

2009-05-17 Thread Sebastiaan Heunis
Brian

Thanks for that.  The power averaging in the FFT makes sense.  Dynamic
range includes any spurious, etc?  In that case I would be referring
to a SNR of 72dB.  I'm going to leave the CORDIC then and just improve
some filtering on the USRP.

Sebastiaan


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


[Discuss-gnuradio] USRP 1 dynamic range

2009-04-01 Thread Sebastiaan Heunis
Hi everyone

I have a question about the dynamic range of the USRP 1.  Let's say I
have 2 input signals.  The power of the one signal is such that it
uses just about all the dynamic range of the ADC.  How low can the
second signal be in order for both to be detected when they reach the
PC (after DDC and decimation)?  Theoretically this should be around
72dB.

I did a simulation in Icarus where I fed a 6MHz wide chirp signal with
a dynamic range of 72dB into the CORDIC module and looked at the
output.  The output signal only has a dynamic range of around 50dB.
Does this mean that I did something wrong, or could we in fact lose
that much dynamic range in the CORDIC?

Thanks in advance.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] Maximum value of samples

2009-03-10 Thread Sebastiaan Heunis
Don

> In fact, at
> 10dBm input and 20dB PGA gain I expect your ADC is clipping.  Have you
> looked at a plot of your recieved waveform?

I agree with you on this.  According to the ADC datasheet, we need a
2Vp-p signal at the ADC to utilise the full dynamic range.  One of the
graphs on the datasheet also shows that the input impedance of the
ADC, when the input signal is between 20MHz and 60MHz, varies between
220 and 230 ohms.

This means that anything above around 7dBm should cause the signal to
get clipped.  With input=10dBm and PGA gain = 20dB, I captured a
signal and plotted it in Matlab.  It's just a normal sine wave with
its peak around 8600.  No clipping, which is surely wrong?

I just need to figure out how efficiently the TVRx uses the dynamic
range of the ADC, so I want to compare the maximum sample value that I
get using the TVRx with the maximum possible sample value.

Thanks for the help.

Sebastiaan


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


[Discuss-gnuradio] Maximum value of samples

2009-03-10 Thread Sebastiaan Heunis
Hi

Can anyone please suggest a setup that I can use to test the maximum
value of samples?  I know that we have 16bit signed values.  Looking
at the ADC interface on the USRP, we sign extend each 12-bit sample
and add 3 zeros to the right.  This should give us a maximum value of
16376 for samples?

I tried using a BasicRX daughterboard.  I have a function generator,
inputting a 20MHz, 10dBm signal into the db.  In my app I mix this
down to 100kHz using the cordic.  I also decimate by 16.  The PGA gain
is set to 20dB.  The FPGA build is the standard 2rx/2tx with hbf.  The
maximum sample value that I get with this is 8635, so I'm using about
half of the ADC's dynamic range.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] TVRx and BasicRx gain questions

2009-03-05 Thread Sebastiaan Heunis
Matt

Sorry to bother.  Please tell me why I lose 6dB when measuring the
signal at pins 17 and 18?  I have the RF transformer from Minicircuits
that is supposed to match the 200ohm output of the TVRX to a 50ohm so
that I can measure it on a spectrum analyser.  Because it is matched,
I should not have a 6dB loss?

I believe the input impedance of the ADC is around 220ohms?  How does
the BasicRx work?  The input is 50ohms, so is there an RF transformer
on the BasicRx that matches this to the ADC?

Thanks in advance.

Sebastiaan


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


[Discuss-gnuradio] Maximum value of samples

2009-02-27 Thread Sebastiaan Heunis
Hi

Does anyone have an idea as to what the maximum value of a sample when
read in matlab is?  I've got a BasicRx board and I'm injecting a 10dBm
signal into RX-A.  Using max(abs(sig)) in matlab results in
8.6458e+03.  Is this what I should get, or should the maximum reading
be higher?

Also, can someone quickly tell me about the two inputs on the BasicRx
board.  Are they two different channels for sampling two different
signals?  If so, how do I get access to both in a Gnuradio app?

Thank you in advance.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] TVRx and BasicRx gain questions

2009-02-25 Thread Sebastiaan Heunis
Hi all

Can someone please provide me with some guidance?  We are working on a
passive radar project and the aim is to implement a pcl radar receiver
on the USRP1 using TVRx daughterboards.  I have the Microtune 7901.

I did some tests to see what the effects of the RF and IF amplifiers
in the tuner are (linear region,etc.).  I noticed that the maximum
output of the TVRx is -15dBm regardless of the input signal and the
gains.  For this measurement, I've got the test circuit that they have
in the Microtune datasheet with the Minicircuits RF transformer to
match the 200 ohm output of the TV tuner to 50 ohms.  Also, I captured
a signal from the TVRx and looked at it in Matlab.  The maximum I
value is 17 and the maximum Q value is 16, which means that we are not
close to using the whole dynamic range.

I also did a test with the BasicRx db.  This time I injected a 13dBm
signal into RX-A.  The maximum value in Matlab is 7919 which looks
much better.

Now I have 2 questions:
-Does anyone know anything about the TVRx and why I only get an output
of -15dBm?  The Microtune datasheet is a bit vague.  It only says that
the signal level for 1dB RF gain compression is 72dBuV (-113dBm) with
AGC deactivated.  Maybe the TVRx wasn't designed to utilise the entire
dynamic range of the ADC??
-What is the maximum signal level after the DDC+filtering,etc?  My
guess is around 2047*8 because of the bit-shifting at the ADC
interface.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] Setting taps for analysis_filterbank

2009-02-17 Thread Sebastiaan Heunis
Marcus

I was wondering about the same thing earlier this year.  Have a look
at gr-pager/src/usrp_flex_band.py.  Some of the code:

taps = gr.firdes.low_pass(1.0,
  1.0,
  1.0/40.0*0.4,
  1.0/40.0*0.1,
  gr.firdes.WIN_HANN)

if options.verbose:
print "Channel filter has", len(taps), "taps"

bank = blks2.analysis_filterbank(40, taps)
self.connect(self.src, bank)

Just remember to connect every output of the filterbank to at least
something.  Otherwise none of the outputs output correct data.


Sebastiaan


On Tue, Feb 17, 2009 at 8:53 PM, Marcus D. Leech  wrote:
> How are the taps supposed to be set for Analysis Filterbank,
> particularly in GRC?
>
> --
> Marcus Leech
> Principal Investigator, Shirleys Bay Radio Astronomy Consortium
> http://www.sbrac.org
>
>
>
> ___
> 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] Audio_alsa_sink question

2009-01-15 Thread Sebastiaan Heunis
Hi

I have a problem with the audio sink.  I'm playing around with the
analysis_filterbank block.  I have a GUI allowing the user to pick a
channel.  That channel then gets connected to an FM demodulator,volume
control and finally an audio sink.  At the start of the app, I
initialise everything and the audio sink works.  As soon as I change a
channel by reconnecting everything, I get this error:

audio_alsa_sink[plughw:0,0]: snd_pcm_hw_params failed: File descriptor
in bad state
terminate called after throwing an instance of 'std::runtime_error'
  what():  check topology failed on audio_alsa_sink(8) using
ninputs=1, noutputs=0
Aborted

Can someone please tell me what might be wrong?

Thanks.

Sebastiaan


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


[Discuss-gnuradio] Analysis_filterbank solution

2009-01-15 Thread Sebastiaan Heunis
Eric

I fixed my filterbank trouble.  You were right when you said that one
needs to connect EVERYTHING.  For instance, let's say you channelised
a signal into 20 channels and you wanted to write channel 5's output
to a file.  Then you need to connect  channels 0-4 to a null sink (or
whatever), as well as channels 6-19.  My previous mistake was to not
connect the higher channels to something.  This results in a correct
output when looking at channel 0 and junk outputs for the rest.

Thanks for all the other help.

Regards

Sebastiaan


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


[Discuss-gnuradio] Analysis_filterbank

2009-01-13 Thread Sebastiaan Heunis
Eric

Sorry for the pointer to pointer question.  I now understand how it
works.  As for the polyphase filter.

# build mpoints fir filters...
for i in range(mpoints):
f = gr.fft_filter_ccc(1, sub_taps[mpoints-i-1])
self.connect((self.s2ss,i), f)
self.connect(f, (self.ss2v, i))
self.connect((self.v2ss, i), (self, i))

The existing wiring is correct from what I understand.  The fact that
the sub filters get connected from last to first
(f=gr.fft_filter_ccc(1,sub_taps[mpoints-i-1])) does the same as
feeding the input samples in from bottom to top.

Looking at everything now, it seems to be fine.  I just can't get it
to work correctly.  I'll play around to try and see what I'm doing
wrong.

Thanks for all the help so far.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] Analysis_filterbank

2009-01-13 Thread Sebastiaan Heunis
Hi

I think I have found what might be my problem with the
analysis_filterbank.  When using it as a polyphase channeliser, you
need to start feeding samples in from the bottom channel, upwards.
The gr.analysis_filterbank uses gr.stream_to_streams to split the
input into a number of streams starting at the top.  For a polyphase
channeliser, this should be the other way round.  I guess I need to
make a different version of stream_to_streams to do this.  Can someone
please just help me with some c++ code?  In particular the work()
function of gr_stream_to_streams:

const char *in = (const char *) input_items[0];
  char **outv = (char **) &output_items[0];
  int nstreams = output_items.size();

  for (int i = 0; i < noutput_items; i++){
for (int j = 0; j < nstreams; j++){
  memcpy(outv[j], in, item_size);
  outv[j] += item_size;
  in += item_size;
}
  }

Firstly, why do we use a pointer to a pointer for the output data?
For what I intend to do, I need to do the following, right?

memcpy(outv[nstreams-j-1],in,item_size);
outv[nstreams-j-1] -= item_size;   //or out[nstreams-j-1] += item_size?
in += item_size;

Thanks

Sebastiaan


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


[Discuss-gnuradio] Analysis_filterbank

2009-01-13 Thread Sebastiaan Heunis
Hi

I managed to figure the connect mistakes that I made out.  Now there's
something different that's not working.  From what I understand about
the analysis_filterbank, it works as follows (in my case).

You send it a signal with a bandwidth of 4MHz.
You have a lowpass filter with fc = 70kHz and fs = 100kHz.
You tell it that you have 20 channels.

The result should be that you have 20 outputs corresponding to the
lowpass filtered signals at frequencies of
-2MHz,-1.8MHz,..,-200kHz,0,200kHz,...,1.8MHz (the order would just be
a bit mixed up because of the FFT).

The problem is that I tested this block by opening a file in Gnuradio
with a signal with a BW of 4MHz with carriers that are 200kHz apart.
Each carrier has a different bandwidth.  When I look at different
analysis_filterbank output, I should see each carrier in turn.

I only get a sensible output at channel 20 (output 19 of the
filterbank).  The rest don't make sense.

I'm thinking about writing my own block for this.  I already have
normal C++ and Matlab code that works.  Can someone please point me to
some examples that might be helpful?

What I need is a big polyphase filter and an FFT.  The input of the
block should be a single complex stream running at a high rate.  The
output should then be up to M channels each running at f_input/M.  I'm
struggling to find a nice example on how filter channel memory and the
variable number of outputs work.

Thank you.

Sebastiaan


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


[Discuss-gnuradio] Re: Analysis_filterbank connect trouble

2009-01-12 Thread Sebastiaan Heunis
Hi

I got my previous problem to work, so no need to respond.  I needed to
cast channel to an int.

Thanks for any trouble.

Sebastiaan

On Mon, Jan 12, 2009 at 3:54 PM, Sebastiaan Heunis  wrote:
> Hi
>
> Thanks Eric for helping me with the analysis_filterbank and the fact
> that all the channels up to the one that I'm interested in should be
> connected to something.  I do however have another problem now.  I
> have an app that allows me to pick a channel from a slider.  The
> slider goes from 1 to 20 (so it's channels 1 to 19)).  This is the
> slider's callback:
>
> def set_channel(self,channel):
>self.lock()
>self.disconnect_all()
>
>self.connect(self.source_i,(self.conv,0))
>self.connect(self.source_q,(self.conv,1))
>self.connect(self.conv,self.throttle)
>self.connect(self.throttle,self.pfb)
>self.connect(self.throttle,self.src_fft)
>
>chan_no = channel-1
>if (chan_no == 0):
>self.connect((self.pfb,0),self.final_fft)
>else:
>for x in range(0,chan_no):
>
> self.connect((self.pfb,x),gr.null_sink(gr.sizeof_gr_complex))
>print x
>self.connect((self.pfb,chan_no),self.final_fft)
>self.unlock()
>
>self.myform['channel'].set_value(channel)
>self.myform['channel_slider'].set_value(channel)
>
> I get the following error when changing the slider value:
>
> Traceback (most recent call last):
>  File "/usr/local/lib/python2.5/site-packages/gnuradio/wxgui/form.py",
> line 233, in 
>lambda evt: callback(self._map_out(evt.GetInt(
>  File "test_gui.py", line 100, in set_channel
>self.connect((self.pfb,chan_no),self.final_fft)
>  File "/usr/local/lib/python2.5/site-packages/gnuradio/gr/top_block.py",
> line 70, in connect
>self._connect(points[i-1], points[i])
>  File "/usr/local/lib/python2.5/site-packages/gnuradio/gr/top_block.py",
> line 76, in _connect
>dst_block.basic_block(), dst_port)
>  File 
> "/usr/local/lib/python2.5/site-packages/gnuradio/gr/gnuradio_swig_py_runtime.py",
> line 1493, in connect
>return _gnuradio_swig_py_runtime.gr_top_block_sptr_connect(*args)
> NotImplementedError: Wrong number of arguments for overloaded function
> 'gr_top_block_sptr_connect'.
>  Possible C/C++ prototypes are:
>connect(boost::shared_ptr *,gr_basic_block_sptr)
>connect(boost::shared_ptr
> *,gr_basic_block_sptr,int,gr_basic_block_sptr,int)
>
> Where line 100 is this:
>
> self.connect((self.pfb,chan_no),self.final_fft)
>
> Can anyone please help with this?
>
> Thanks a lot.
>
> Sebastiaan
>
> --
> Sebastiaan Heunis
> Radar and Remote Sensing Group, University of Cape Town
> Tel:  +27 83 305 5667
>



-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] Analysis_filterbank connect trouble

2009-01-12 Thread Sebastiaan Heunis
Hi

Thanks Eric for helping me with the analysis_filterbank and the fact
that all the channels up to the one that I'm interested in should be
connected to something.  I do however have another problem now.  I
have an app that allows me to pick a channel from a slider.  The
slider goes from 1 to 20 (so it's channels 1 to 19)).  This is the
slider's callback:

def set_channel(self,channel):
self.lock()
self.disconnect_all()

self.connect(self.source_i,(self.conv,0))
self.connect(self.source_q,(self.conv,1))
self.connect(self.conv,self.throttle)
self.connect(self.throttle,self.pfb)
self.connect(self.throttle,self.src_fft)

chan_no = channel-1
if (chan_no == 0):
self.connect((self.pfb,0),self.final_fft)
else:
for x in range(0,chan_no):

self.connect((self.pfb,x),gr.null_sink(gr.sizeof_gr_complex))
print x
self.connect((self.pfb,chan_no),self.final_fft)
self.unlock()

self.myform['channel'].set_value(channel)
self.myform['channel_slider'].set_value(channel)

I get the following error when changing the slider value:

Traceback (most recent call last):
  File "/usr/local/lib/python2.5/site-packages/gnuradio/wxgui/form.py",
line 233, in 
lambda evt: callback(self._map_out(evt.GetInt(
  File "test_gui.py", line 100, in set_channel
self.connect((self.pfb,chan_no),self.final_fft)
  File "/usr/local/lib/python2.5/site-packages/gnuradio/gr/top_block.py",
line 70, in connect
self._connect(points[i-1], points[i])
  File "/usr/local/lib/python2.5/site-packages/gnuradio/gr/top_block.py",
line 76, in _connect
dst_block.basic_block(), dst_port)
  File 
"/usr/local/lib/python2.5/site-packages/gnuradio/gr/gnuradio_swig_py_runtime.py",
line 1493, in connect
return _gnuradio_swig_py_runtime.gr_top_block_sptr_connect(*args)
NotImplementedError: Wrong number of arguments for overloaded function
'gr_top_block_sptr_connect'.
  Possible C/C++ prototypes are:
connect(boost::shared_ptr *,gr_basic_block_sptr)
connect(boost::shared_ptr
*,gr_basic_block_sptr,int,gr_basic_block_sptr,int)

Where line 100 is this:

self.connect((self.pfb,chan_no),self.final_fft)

Can anyone please help with this?

Thanks a lot.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] gdb help

2009-01-09 Thread Sebastiaan Heunis
Eric

I think the unconnected output port is because I need to first connect
the filterbank to the USRP and then connect one of the channels to
whatever I want to do with it.  The code breaks in either the
self.connect(self.u,pfb) or the
self.connect((pfb,5),self.guts,self.volume_control,audio_sink) line.
I suspect that it is the former.

pfb = blks2.analysis_filterbank(20,taps)

#End PFB

print "Done init"

self.connect(self.u,pfb)

print "Done connect(self.u,pfb)"

self.connect((pfb,5),self.guts,self.volume_control,audio_sink)

I ran gdb again.  The "Done connect(self.u,pfb)" displays before the
program breaks.  When I remove the
self.connect((pfb,5),self.guts,self.volume_control,audio_sink), the
same thing happens.

Sebastiaan


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


Re: [Discuss-gnuradio] gdb help

2009-01-08 Thread Sebastiaan Heunis
Eric

Sorry about previously.  I guess I need to read more :).  I got the
gdb backtrace.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7dc18c0 (LWP 7143)]
PyErr_Restore (type=0x81422c0, value=0x8e36ac8, traceback=0x0)
at ../Python/errors.c:39
39  ../Python/errors.c: No such file or directory.
in ../Python/errors.c
(gdb) bt
#0  PyErr_Restore (type=0x81422c0, value=0x8e36ac8, traceback=0x0)
at ../Python/errors.c:39
#1  0x080d9e6e in PyErr_SetString (exception=0x81422c0,
string=0x8ffebac "vector_to_streams(13): missing connection from
output port 0") at ../Python/errors.c:57
#2  0xb5ffb5fa in SWIG_Python_SetErrorMsg ()
   from 
/usr/local/lib/python2.5/site-packages/gnuradio/gr/_gnuradio_swig_py_runtime.so
#3  0xb600bdf0 in _wrap_top_block_run_unlocked ()
   from 
/usr/local/lib/python2.5/site-packages/gnuradio/gr/_gnuradio_swig_py_runtime.so
#4  0x0805cb97 in PyObject_Call (func=0x0, arg=0x8e0ca4c, kw=0x0)
at ../Objects/abstract.c:1861
#5  0x080c7e04 in PyEval_EvalFrameEx (f=0x8fdb054, throwflag=0)
at ../Python/ceval.c:3853
#6  0x080cb1f7 in PyEval_EvalCodeEx (co=0x8780e30, globals=0x870c13c,
locals=0x0, args=0x8fdb03c, argcount=1, kws=0x8fdb040, kwcount=0,
defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:2836
#7  0x080c93fe in PyEval_EvalFrameEx (f=0x8fdaefc, throwflag=0)
at ../Python/ceval.c:3669
#8  0x080c96e5 in PyEval_EvalFrameEx (f=0x81770d4, throwflag=0)
at ../Python/ceval.c:3659
#9  0x080cb1f7 in PyEval_EvalCodeEx (co=0xb7d4f260, globals=0xb7d9aacc,
---Type  to continue, or q  to quit---
locals=0xb7d9aacc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
defcount=0, closure=0x0) at ../Python/ceval.c:2836
#10 0x080cb347 in PyEval_EvalCode (co=0xb7d4f260, globals=0xb7d9aacc,
locals=0xb7d9aacc) at ../Python/ceval.c:494
#11 0x080ea818 in PyRun_FileExFlags (fp=0x816b008,
filename=0xbf93b68a "test_channelise.py", start=257, globals=0xb7d9aacc,
locals=0xb7d9aacc, closeit=1, flags=0xbf93a5a8)
at ../Python/pythonrun.c:1273
#12 0x080eaab9 in PyRun_SimpleFileExFlags (fp=0x816b008,
filename=0xbf93b68a "test_channelise.py", closeit=1, flags=0xbf93a5a8)
at ../Python/pythonrun.c:879
#13 0x08059335 in Py_Main (argc=1, argv=0xbf93a674) at ../Modules/main.c:523
#14 0x080587f2 in main (argc=Cannot access memory at address 0x0
) at ../Modules/python.c:23

Sebastiaan


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


[Discuss-gnuradio] gdb help

2009-01-08 Thread Sebastiaan Heunis
Hi

I'm trying to debug an application using gdb.  I used the segment of
code in the how to write your own blocks page to print out the process
id and attach gdb to it.  When I try to set breakpoints, I get a
message saying

No line 110 in file ''../Modules/python.c''

Also, when I run the Python app, gdb tells me that the program has
been started already.  And and asks if it should start the program
from the beginning.  Choosing yes causes gdb to run the Python
interpreter itself.  Choosing no doesn't do anything.

Can anyone please help me with this?

Thank you in advance.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] analysis_filterbank problem

2009-01-07 Thread Sebastiaan Heunis
Eric

Thanks, I'll try gdb.  I used the same code with decim=16, only this
time connecting the USRP source to an FFT sink.  It works fine.  The
code definitely breaks when I try to connect the USRP to the
filterbank.

Regarding the halfband filter.  I'm in the process of investigating
ways of improving the response of the CIC or whichever technique I
implement in the end.  I've tried a 4 stage CIC with compensator as
well as an 8 stage one.  I get a nice flat passband in the end, but my
supervisor wants at least 40dB of SNR by the time the signal is
processed.  I've only managed around 33.  That's why I've been playing
around with HBF/no HBF.

Sebastiaan

On Wed, Jan 7, 2009 at 8:44 PM, Eric Blossom  wrote:
> On Wed, Jan 07, 2009 at 01:53:03PM +0200, Sebastiaan Heunis wrote:
>> Hi
>>
>> I looked at usrp_flex_band.py to see how blks2.analysis_filterbank is
>> implemented.  The example runs on my PC.
>>
>> I wrote a simple app where I want to decimate by 16 in the FPGA (no
>> HBF).  So I have samples coming in at 4Msps.  I then want to send this
>> stream to a 20 channel channeliser, resulting in output streams of
>> 200ksps each.  I want to test this by connecting an FM demodulator and
>> see if I can channelise a part of the FM band.  Here is some of my
>> code.
>>
>> self.u = usrp.source_c(decim_rate=16,fpga_filename="std_2rx_0tx.rbf")
>>
>> if options.rx_subdev_spec is None:
>>   options.rx_subdev_spec = pick_subdevice(self.u)
>>
>> self.subdev = usrp.selected_subdev(self.u,options.rx_subdev_spec)
>> self.u.set_mux(usrp.determine_rx_mux_value(self.u,options.rx_subdev_spec))
>>
>> print "Using RX d'board %s" % (self.subdev.side_and_name(),)
>>
>> self.set_freq(options.freq)
>>
>> taps = []
>>
>> f1 = open('fir_lowpass.txt','r')
>>
>> for line in f1:
>>   tap = float(line)
>>   taps.append(tap)
>> f1.close()
>>
>> #taps = optfir.low_pass(1,usrp_rate,70e3,100e3,0.1,60)
>>
>> pfb = blks2.analysis_filterbank(20,taps)
>>
>> self.connect(self.u,pfb)
>>
>> The application works until I try to connect the usrp source to the
>> filterbank.  I get a Segmentation fault when I try to do this.  Does
>> anyone know what might be wrong?
>>
>> Thanks in advance.
>>
>> Sebastiaan
>
>
> Run gdb to find out where the segfault is occurring.
> http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html#debugging
>
>
> Are you sure you want the half-band disabled?
> You can run decim=16 with it on.  The pass band will be flatter.
>
> Eric
>



-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] Daughter Boards frequencies

2009-01-07 Thread Sebastiaan Heunis
Hi

I can help with the RX bit.  Read up on undersampling.  This is how
you would do it with a BasicRX card.  You can basically sample a
signal higher than 64MHz provided that the bandwidth is less than
64MHz/2.  The signal then ends up between 0 and 32MHz and is either
inverted or not.  You then need to set the cordic frequency to that
frequency to mix it down to DC on the FPGA.

With the TVRX cards there is a tuner that downconverts a high
frequency signal (FM,UHF,VHF) down to somewhere below 64MHz (depending
on which TVRX revision you have).

Sebastiaan

On Wed, Jan 7, 2009 at 8:17 PM, Ronaldo Nunez  wrote:
> Hello Community,
>
> I read in the faq and in the usrp_stardard.cc that RF frequencies higher
> than 44MHz can't be tuned in URSP,
> so how BasicTX, and other daughter boards can tune hundreds, thousands of
> MHz ?
>
> Thank you all, Regards...
> --
> __
> Ronaldo A. Viera Nunez
> Acadêmico/Engenharia Elétrica
> Universidade Federal de Santa Maria
>
> Santa Maria - RS - Brasil
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>



-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] analysis_filterbank problem

2009-01-07 Thread Sebastiaan Heunis
Hi

I looked at usrp_flex_band.py to see how blks2.analysis_filterbank is
implemented.  The example runs on my PC.

I wrote a simple app where I want to decimate by 16 in the FPGA (no
HBF).  So I have samples coming in at 4Msps.  I then want to send this
stream to a 20 channel channeliser, resulting in output streams of
200ksps each.  I want to test this by connecting an FM demodulator and
see if I can channelise a part of the FM band.  Here is some of my
code.

self.u = usrp.source_c(decim_rate=16,fpga_filename="std_2rx_0tx.rbf")

if options.rx_subdev_spec is None:
options.rx_subdev_spec = pick_subdevice(self.u)

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

print "Using RX d'board %s" % (self.subdev.side_and_name(),)

self.set_freq(options.freq)

taps = []

f1 = open('fir_lowpass.txt','r')

for line in f1:
tap = float(line)
taps.append(tap)
f1.close()

#taps = optfir.low_pass(1,usrp_rate,70e3,100e3,0.1,60)

pfb = blks2.analysis_filterbank(20,taps)

self.connect(self.u,pfb)

The application works until I try to connect the usrp source to the
filterbank.  I get a Segmentation fault when I try to do this.  Does
anyone know what might be wrong?

Thanks in advance.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] Connect question

2009-01-06 Thread Sebastiaan Heunis
Hi

I would just like to know if it is possible to connect blocks
dynamically?  I'm implementing the analysis_filterbank block.  What I
would like to do is write a GUI application that allows one to select
the channel of interest.  This channel is then displayed on an FFT
sink.  Can I do it as such?

def pick_channel(self,event):
chan = spinctrl.GetValue()
self.channel = int(chan)
self.connect((bank,chan),self.demod)

or do I need to call fg.stop() and fg.start()?

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] analysis_filterbank question

2009-01-05 Thread Sebastiaan Heunis
Hi

I'm trying to use blks2.analysis_filterbank.  I assume that I need to
instantiate it like this:

self.channeliser = blks2.analysis_filterbank(num_fft,taps)

where num_fft refers to the number of channels and taps can be left empty.

I tried self.channeliser = blks2,analysis_filterbank(16) (and 8 and
20).  None of these work.  I get the following error:

terminate called after throwing an instance of 'std::out_of_range'
  what():  gri_fftw: invalid fft_size
Aborted

Does anyone know what's wrong?  If I get it to work, do I just connect
each output path that I'm interested in to a block, similar to when
using a mixer in the fm examples?

Thanks a lot.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] Writing own blocks

2009-01-04 Thread Sebastiaan Heunis
Hi everyone

I need to write a custom block or two.  I went through the tutorial on
the gnuradio website.  This only outlines the basics.  What I want to
do is to implement a polyphase filterbank channeliser that takes in an
input stream an breaks it up into a number of channels.  I should then
be able to select the channel that I want by passing it as a parameter
to the new block in a gnuradio application.  Does anyone have any
recommendations on code that I can look at to help me?  How does
history in filters work in gnuradio blocks?

Thanks a lot.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] Halfband filter,etc.

2008-10-29 Thread Sebastiaan Heunis
Hi people

Can I please ask a question or two about the HBF?  So I know that it
is has 31 taps and what the coefficients look like from reading a bit.
 Is it just a lowpass decimation filter from Goodman and Carey's list?
 How does it work?  Is it just like a standard FIR filter where the
input gets convolved with the filter taps?  Is the decimation achieved
because every second tap is 0?  I know that we receive an input value
every 64e6/(decimation/2) from the CIC filter.  I know for a
decimation of 16 the hb_strobe is supposed to be 4MHz.  I just don't
know where the last clocking down by 2 is done.  I've seen this bit of
Verilog:

always @(posedge clock)
 begin
start_d1 <= #1 start;
start_d2 <= #1 start_d1;
start_d3 <= #1 start_d2;
start_d4 <= #1 start_d3;
start_d5 <= #1 start_d4;
start_d6 <= #1 start_d5;
start_d7 <= #1 start_d6;
start_d8 <= #1 start_d7;
start_d9 <= #1 start_d8;
start_dA <= #1 start_d9;
start_dB <= #1 start_dA;
start_dC <= #1 start_dB;
start_dD <= #1 start_dC;
 end // always @ (posedge clock)

   regmult_en, mult_en_pre;
   always @(posedge clock)
 begin
mult_en_pre <= #1 phase!=8;
mult_en <= #1 mult_en_pre;
 end

   assign clear = start_d4; // was dC
   wire   latch_result = start_d4; // was dC
   assign strobe_out = start_d5; // was dD

Can anyone please help?

Thank you in advance.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] A Verilog question or two

2008-10-14 Thread Sebastiaan Heunis
Hi

Can someone with Verilog experience please help me with a question or
two?  I have done some VHDL before, so I am not entirely clueless.

Is it possible to bit selects with an array of registers?  How do I
select the upper eight bits from ram_array[2] if I have the following?

reg [15:0]  ram_array [0:15];

The difference between

val <= #1 input[15:12]; and
val = input[15:12];

when it is inside an always @(posedge clk) block is that the = sign
operation is sequential, right and that <= operations are in parallel?
The #1 means a delay of 1, right?  So if I for instance have data
going through a filter with the following code

always @(posedge clk)
begin
 tap1 <= #1 input;
 tap2 <= #1 tap1;
 tap3 <= #1 tap2;
end

the #1 ensures that tap1 gets updated before tap2?

And the last question is regarding the assign statement.  I know that
when we have commands inside a always @(posedge clk) block, we look at
clock changes and do certain things.  Do we use the assign statement
if we for instance want to change an output when in input changes or
if we have an output that is not dependent on a clock?  I still don't
exactly know when to use an assign instead if putting it inside an
always block?  What's the rule of thumb?

Thanks in advance.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] FIFO question

2008-10-11 Thread Sebastiaan Heunis
Hi

Can anyone please help me?  I have the following Gnuradio code to test
a C++ application:

self.src = gr.sig_source_f(500e3,gr.GR_SIN_WAVE,100e3,0.1)
self.dst0 = gr.file_sink(gr.sizeof_float,"myfifo")
self.connect(self.src,self.dst0)

I'm trying to capture 1000 samples every ten seconds with the
following bit of C++ code:

while (j < chunks)
 {
  result = fread(buffer1,sizeof(float),1000,fifo1);
  k = k + 1;
  if (k == skip)
  {
   for (l = 0;l < 1000;l++)
   {
big_buff[l+count] = buffer1[l];
   }
   k = 0;
   j = j + 1;
   count = count + 1000;
  }
 }

where chunks is equal to the amount of 1000 sample reads that I want
and skip is equal to 5000 to read 1000 samples out of every 5 000 000.
 So for instance if chunks is 4, this app should run for 40 seconds
since 500 000 samples should get written to the FIFO every second.
The app terminates after about 2 seconds.  I write big_buff to a text
file and it does indeed contain 4000 samples.  The FFT also shows that
it is a 100kHz sine wave.

What I intend to do is use 2 FIFOs to capture data from two TVrx
daughtercards.  I then want to see what the frequency drift between
the two oscillators after a certain amount of time is so obviously I
want to capture a certain amount of samples every now and then and
compare the FFTs from the two channels.

Does anyone know what I am doing wrong?

Thank you very much.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] Halfband filter questions

2008-10-09 Thread Sebastiaan Heunis
Hi there

I would like to know a thing or two about the HBF at the end of the
rx_chain.  From what it looks, it's a 31-tap lowpass FIR filter with
every second tap being a zero to make it a halfband filter?  Also,
because we're at least decimating by 4 in the CIC and 2 in the HBF, we
have 8 clocks to compute each output, right?  So we're using only one
multiplier to consume little FPGA resources.  From what I've read and
looked at, we have two RAM blocks.  One for the samples currently at
zero taps and one for the samples at non zero taps.  What then happens
then is that we add the two symmetric samples, multiply them by the
filter coefficient and add them to an accumulator this is done 8 times
for one output.  Finally we add the center sample multiplied by
32768/2.  I would just like to know some things about the flow of
samples.  I've done some GTKwave outputs, but it gets hard to follow
at a point.

The two RAMs are for the odd and even samples, so a new sample goes to
position 1 in the even RAM, right?  When we receive a new sample, this
sample goes to position 1 of the odd RAM, right?  So every time we get
a new sample, all the odd samples become even and vice versa as the
samples move through the filter?  Another thing that I thought of is
that there is only 15 odd taps and we have 16 registers declared in
the odd RAM.  Is this because we receive one new sample and hold it
while we perform one cycle of filtering.  When the second sample
arrives, it is buffered here and the previous sample moves into the
filter?  What then happens is that every 8 clocks we accept one sample
into the filter, buffer one and output one sample?

And then just a few other things.

The length of the multiplier is 31 bits because we're multiplying two
15 bit numbers plus the sign bit?
The length of the accumulator is 34 bits (31 bits for the multiplier
output plus log2(8) bits for the additions)?
In the following line:

wire signed [33:0] dout = sum_even +
{{4{middle_data[15]}},middle_data,14'b0}; // We already divided
product by 2

we only multiply middle_data by 16384.  Why?  Do we scale the output
of the HBF filter by two?

The last question is this:

data_out <= #1 dout[30:15] + (dout[33]& |dout[14:0]);

Is this just the correct way to convert a 34 bit number to a 16 bit one?

Thank you very much in advance.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] Some FM modulator questions

2008-09-29 Thread Sebastiaan Heunis
Hi all

Sorry if this question is stupid.  I want to generate an FM signal as
it would be seen by the adc_interface part on the USRP board after
coming from the TVRX module and then the ADC.  So obviously that would
be an FM signal sitting at 20MHz, sampled at 64MHz and quantisized to
12-bits.  Does anyone have any good ideas on doing this?  What I am
trying at the moment is to decode an mp3 using sox and grabbing 32kHz
mono PCM samples.  I then need to get this to an FM signal sampled at
64MHz before mixing it up to 20MHz.  I'm struggling with the FM
modulation part.  I have in the past used the FM modulator in
Gnuradio, but only to get the sampling rate up from 44.1kHz to 441kHz
when modulating an mp3.  I'm using this block:

fmtx = blks2.wfm_tx(32000,6400,tau=75e-6, max_dev=75e3)

The problem is with the 6400 part.  Interpolating a 32kHz signal
to 64MHz not funny.  I'm trying to do it in Gnuradio and my
application has been running for the last hour.  DOes anybody have any
suggestions?

Thank you very much.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


[Discuss-gnuradio] Contributing

2008-09-28 Thread Sebastiaan Heunis
Eric

Brian asked if I could make the USRP work that I am doing as part of
my M.Sc available to other Gnuradio users.  At the moment it's only
some simulations of the downconversion process, but it does give one a
good understanding of exactly what happens in the FPGA.  How do I get
this to you?  Can I email it or do I need to SVN it to Gnuradio?  I
still need some cleaning up and commenting of the source code.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel:  +27 83 305 5667


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


Re: [Discuss-gnuradio] ADC questions

2008-09-24 Thread Sebastiaan Heunis
Brian

Sorry to bother.  I have one more question for now.  I wrote a Python
app to generate an input signal, convert it to 12-bit two's complement
and then bitshift it left by 3 and sign-extend it to get it to the
representation used inside the FPGA.  My question now is that if I
feed this input signal into the cordic, I'll somehow get it back to
decimal in order to plot it in Matlab and see what happened.  Do I do
the inverse that I previously did (shift it right by 3 and remove the
sign extension and then take it from two's complement to decimal?)
Let's say I take the signal from the cordic and pass it to the CIC
filter.  When I want to have a look at the output of the CIC filter,
can I also do the above to get the output to 12-bit decimal?

Thanks in advance.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel: +27 83 305 5667


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


Re: [Discuss-gnuradio] ADC questions

2008-09-23 Thread Sebastiaan Heunis
Brian

Thanks.  I understand the offset part then.  Nothing happens if there
is no DC offset.  I want to simulate an FM signal coming from the
TVRX, so the TVRX output is 20MHz, I understand that I then need to
write 2952790016 to the FR_RX_FREQ_0 register in the phase_acc.  The
cordic will then multiply this input signal by a 20MHz cos and sine to
generate the I and Q channels.  I just need to generate an FM signal
and get it to 16-bits as previously described and send it to the
cordic with the phase value written to the freq register?

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel: +27 83 305 5667


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


Re: [Discuss-gnuradio] ADC questions

2008-09-23 Thread Sebastiaan Heunis
Brian

Thanks for the reply.  I see from this Verilog line that the adc input
gets sign extended and gets 3 zeros at the back as you mentioned.

rx_dcoffset #(`FR_ADC_OFFSET_0)
rx_dcoffset0(.clock(clock),.enable(dco_en[0]),.reset(reset),.adc_in({adc0[11],adc0,3'b0}),.adc_out(adc0_corr),

.serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe));

I just don't know how the rx_dcoffset part works.  I don't know where
in the c++ or Python code the FR_ADC_OFFSET registers get written, so
I can't follow it that well.  Does this remove a DC offset introduced
by the ADC chip?

What I'm busy doing is to test the Verilog code with iverilog.  I want
to know how input samples should look that I am using to test the
different FPGA blocks.  If I, for instance, generate an FM signal that
I want to send into the cordic block, do I generate a signal and
convert it to 12-bit two's complement, extend the sign bit and pad it
with 3 zeros at the beginning to get it to 16-bits?  Can I then send
this signal to the cordic block and assume that this is what it would
look like in the FPGA?

What does the AGC level sensing part in adc_interface do?  Does this
monitor the level of the incoming samples to see if clipping occurs?
The last part, the mux, only routes the different adc inputs to the
correct DDC channels in the FPGA, right?

Thanks in advance.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel: +27 83 305 5667


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


[Discuss-gnuradio] ADC questions

2008-09-23 Thread Sebastiaan Heunis
Hi

I have a few questions to ask about the ADC if anyone could please
help me?  I know that it has a 12-bit output, so our output is between
0 and 4095.  I would just like to know how this ADC input gets
converted after leaving the adc_interface block in the FPGA.  In other
words, how are positive and negative numbers represented, etc?  The
FPGA converts the 12bit input to a 16bit output.  What is done to get
it from the 0-4095 input to a 16bit output with + and - numbers?

Thank you very much.

Sebastiaan

-- 
Sebastiaan Heunis
Radar and Remote Sensing Group, University of Cape Town
Tel: +27 83 305 5667


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


Re: [Discuss-gnuradio] Icarus simulation help

2008-08-28 Thread Sebastiaan Heunis
Brian

Thanks again for the testbed file.  I see what phase_acc does now.
When we do a downconversion, the initial phase that gets written to
the FR_RX_PHASE_0 register is 0, right?  I just want to make sure of
that and that the phase value repeats after about 16 clock cycles.  I
would just like to know if you know of a good testbed tutorial around.
 What I would like to do now is generate a sine wave at 20MHz, sampled
at 64MHz and save this to a text file.  I would also like to save the
phase values generated by phase_acc to a text file.  I then want to
write a testbench for cordic.v with the incoming sine wave and phase
values and save the output from the cordic to a text or datafile.  If
you know how to access and read/write files in Iverilog, could you
please just show me a line of code or two to do it?

Thank you very much.

Sebastiaan Heunis


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


Re: [Discuss-gnuradio] TVRX module questions

2008-08-26 Thread Sebastiaan Heunis
Matt

My DSPing is a bit rusty.  With the TVRX card, we send -20MHz to the
DDC.  Is this because of 44-64 MHz?  The code where the actual FPGA
register gets written is in usrp_standard.cc?  Here is a function
called compute_fpga_freq_control_word which takes the -20MHz and
returns 2952790016 which is 1011 in
binary.  So for a DDC value of -20MHz, is that the value that gets
written to the FR_RX_FREQ_0 register?  What gets written to
FR_RX_PHASE_0?  Just zero?  I'm just trying to figure out how the
cordic and phase accumulator parts are implemented.

Thanks a lot.

Sebastiaan


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


[Discuss-gnuradio] Icarus simulation help

2008-08-26 Thread Sebastiaan Heunis
Hi

I want to write a testbench for phase_acc.v to help me to get started
in simulating the whole decimation scheme.  So this is the phase_acc.v
file:

module phase_acc
(clk,reset,enable,strobe,serial_addr,serial_data,serial_strobe,phase);
   `include "setting_reg.v"
   parameter FREQADDR = 0;
   parameter PHASEADDR = 0;
   parameter resolution = 32;

   input clk, reset, enable, strobe;
   input [6:0] serial_addr;
   input [31:0] serial_data;
   inputserial_strobe;

   output reg [resolution-1:0] phase;
   wire [resolution-1:0] freq;

   setting_reg #(FREQADDR)
sr_rxfreq0(.clock(clk),.reset(1'b0),.strobe(serial_strobe),.addr(serial_addr),.in(serial_data),.out(freq));

   always @(posedge clk)
 if(reset)
   phase <= #1 32'b0;
 else if(serial_strobe & (serial_addr == PHASEADDR))
   phase <= #1 serial_data;
 else if(enable & strobe)
   phase <= #1 phase + freq;

endmodule // phase_acc

I've looked at quite a few icarus and gtkwave examples.  I would just
like to know how I do the whole

setting_reg #(FREQADDR)
sr_rxfreq0(.clock(clk),.reset(1'b0),.strobe(serial_strobe),.addr(serial_addr),.in(serial_data),.out(freq));

part.  Setting_reg's verilog code is in setting_reg.v.  How do I write
a testbench for the phase accumulator so that the line where
sr_rxfreq0 is instantiated works?  Obviously I'll only have this:
module phase_acc
(clk,reset,enable,strobe,serial_addr,serial_data,serial_strobe,phase);
in my testbench file.  When I try to compile it, I get the following
error:

phase_acc.v:41: error: Unknown module type: setting_reg
Elaboration failed
*** These modules were missing:
setting_reg referenced 1 times.
***

I've tried adding 'include "setting_reg.v" in phase_acc.v, but then I
get the following error:

setting_reg.v:3: syntax error
setting_reg.v:3: error: invalid module item. Did you forget an initial
or always?
phase_acc.v:29: syntax error

Thank you very much.

Sebastiaan


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


[Discuss-gnuradio] Serial io questions

2008-08-14 Thread Sebastiaan Heunis
Hi

If have a few questions regarding the serial interface between the FX2
and the FPGA and the writing of registers.  I would just like to know
how serial_strobe, serial_data and serial_addr signals work?  I know
that serial_io.v handles this and generates a strobe to tell the
modules that something was written on the serial interface.

I would just like to know how these signals work.  When does
serial_strobe go up and how is serial_data and serial_addr stored?
For now I want to write a testbench for phase_acc.v.  I would like to
know how the serial input to this module should look in order to input
the address and a frequency value into this module and get it to
output freq.  I want to then see what the phase output that goes to
cordic.v looks like in order to simulate cordic.v.

setting_reg #(FREQADDR)
sr_rxfreq0(.clock(clk),.reset(1'b0),.strobe(serial_strobe),.addr(serial_addr),.in(serial_data),.out(freq));

Thank you very much.

Sebastiaan Heunis


Sebastiaan Heunis


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


[Discuss-gnuradio] Phase accumulator

2008-08-12 Thread Sebastiaan Heunis
Brian

I had a look at some of the Verilog again.  For a decimation of 8,
decim_strobe pulses every 64MHz/4 when FR_DECIM_RATE is equal to 3, so
this is correct.  hb_strobe will then be 16MHz/2.  I'm looking at the
phase_acc and cordic now.  When the DDC gets set to -20MHz as is the
case when we're using a 7901 tvrx, we have the following c++ code to
calculate the value to write to the FPGA:

compute_freq_control_word_fpga (double master_freq, double target_freq,
double *actual_freq, bool verbose)
{
  static const int NBITS = 14;

  int   v = (int) rint (target_freq / master_freq * pow (2.0, 32.0));

  if (0)
v = (v >> (32 - NBITS)) << (32 - NBITS);// keep only top NBITS

  *actual_freq = v * master_freq / pow (2.0, 32.0);

  if (verbose)
fprintf (stderr,
 "compute_freq_control_word_fpga: target = %g  actual = %g  delta = 
%g\n",
 target_freq, *actual_freq, *actual_freq - target_freq);

  return (unsigned int) v;
}

v then gets written to FR_RX_FREQ_0.  This is used for the phase
accumulator.  For -20MHz, v = 2952790016.  In the phase accumulator,
we have:

setting_reg #(FREQADDR)
sr_rxfreq0(.clock(clk),.reset(1'b0),.strobe(serial_strobe),.addr(serial_addr),.in(serial_data),.out(freq));

   always @(posedge clk)
 if(reset)
   phase <= #1 32'b0;
 else if(serial_strobe & (serial_addr == PHASEADDR))
   phase <= #1 serial_data;
 else if(enable & strobe)
   phase <= #1 phase + freq;

so when serial_strobe = 1 and serial_addr is the address of
FR_RX_FREQ_0, freq gets the value 2952790016?  enable comes from
rx_enable which gets set in master_control.  strobe comes from
sample_strobe, which gets set to 1 in master_control.  So on the first
clock pulse after writing to FR_RX_FREQ_0, phase will be 2952790016?
This value keeps on getting added to phase on every clock pulse?
Phase is 32 bits, so is the value then truncated?  I know that the top
16 bits of phase is used in cordic.v.

So does the following happen:  phase gets added each clock pulse, the
overflow is discarded and cordic uses the top 16 bits of phase?  At
the next clock pulse, phase changes, so phase[31:16] that enters
cordic is different?  Or does phase get a once-off value that is used
in cordic.v?  The word 'accumulator' gives me the idea that something
keeps on getting added.

Then another question to anyone who has used the cordic testbed.  In
cordic_tb.v included with Gnuradio, we have `include "sine.txt".  I'm
assuming that for a 20MHz signal that needs to be mixed down, this
will be a text file with samples of a 20MHz sine wave sampled at
64MHz?  So I can just generate it in Octave or Matlab and use it to
run the testbed?

Thank you very much for the help.

Sebastiaan


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


Re: [Discuss-gnuradio] Decimation questions

2008-08-12 Thread Sebastiaan Heunis
Brian

Thanks for the help so far.  I've really figured out a lot of the
decimation stuff so far.  I plan on simulating the decimation scheme
in Matlab/C++ to see exactly what happens and where unwanted effects
might be introduced.  I'm supposed to investigate the current scheme
to see if it meets our needs and maybe implement another scheme if
necessary.  This is a part of the master's degree that I am doing.  I
will make the decimation info available to anyone interested in it.

The value FR_RX_PHASE_0 is 0.  When the USRP is initialized,
FR_RX_PHASE_0 - 3 all get the value 0 and I don't see them being set
anywhere else when a normal downconversion is performed.
FR_DECIM_RATE gets set to decim/2 -1 when the FPGA has a halfband
filter in it.  The -1 is probably due to zero indexing as you
mentioned.

FR_RX_FREQ_0 - 3 still confuses me a little.  When a 7901 tv tuner
module is used, the second IF is at 20MHz.  I followed the code in
db_tv_rx.py and usrp.py and saw that in this case we have
set_rx_freq(0,-20e6).  In usrp_standard.cc we have the following code
in set_rx_freq:

compute_freq_control_word_fpga (double master_freq, double target_freq,
double *actual_freq, bool verbose)
{
  static const int NBITS = 14;

  int   v = (int) rint (target_freq / master_freq * pow (2.0, 32.0));

  if (0)
v = (v >> (32 - NBITS)) << (32 - NBITS);// keep only top NBITS

  *actual_freq = v * master_freq / pow (2.0, 32.0);

  if (verbose)
fprintf (stderr,
 "compute_freq_control_word_fpga: target = %g  actual = %g  delta = 
%g\n",
 target_freq, *actual_freq, *actual_freq - target_freq);

  return (unsigned int) v;
}

v then gets written to FR_RX_FREQ_0 for channel 0.  I still need to
figure out how this frequency value is used in the FPGA to generate
the sine and cosine waves used in the cordic algorithm since somehow a
20MHz signal is generated from v.  From what I understand, our I and Q
signals are multiplied by a sine and cosine and then passed to the cic
filter.  This leaves only the components centered at 0Hz, since the
cic low pass filters and decimates it.  The hbf also lowpass filters
and decimates by a further factor of 2.

So I understand most of the Python->C++->Verilog code.  It's just the
Verilog itself that I'm still stuck at.  I did some VHDL last year, so
I'm not totally lost.  What I would like to know is the following.  We
have this in the rx_chain part:

phase_acc #(FREQADDR,PHASEADDR,32) rx_phase_acc
 (.clk(clock),.reset(reset),.enable(enable),
  
.serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
  .strobe(sample_strobe),.phase(phase) );

and this in the phase_acc part:

setting_reg #(FREQADDR)
sr_rxfreq0(.clock(clk),.reset(1'b0),.strobe(serial_strobe),.addr(serial_addr),.in(serial_data),.out(freq));

   always @(posedge clk)
 if(reset)
   phase <= #1 32'b0;
 else if(serial_strobe & (serial_addr == PHASEADDR))
   phase <= #1 serial_data;
 else if(enable & strobe)
   phase <= #1 phase + freq;

>From the VHDL that I know, my guess is that serial_strobe gets
asserted whenever the FX2 chip writes to the FPGA, serial_addr is an
address that the FX2 sends to the FPGA and serial_data is the value
that gets written to that address.  Is this correct?

So, the setting_reg#... line above drives the freq wire with the value
that the FX2 writes to FREQADDR?  This only happens once when we tune
to the desired frequency, so we just keep adding the same freq value
to phase every 1/64MHz?

When I know the above, I should be fine in figuring the rest out.

Thanks for your help.

Sebastiaan Heunis


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


[Discuss-gnuradio] Decimation questions

2008-08-11 Thread Sebastiaan Heunis
Hi

I would like to ask some questions about the rx chain in the FPGA.

The following Verilog code is found in the rx_chain.v Verilog file

##

phase_acc #(FREQADDR,PHASEADDR,32) rx_phase_acc
 (.clk(clock),.reset(reset),.enable(enable),
  
.serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
  .strobe(sample_strobe),.phase(phase) );

##

and in usrp_std.v this is found for the first rx_chain

##

rx_chain #(`FR_RX_FREQ_0,`FR_RX_PHASE_0) rx_chain_0
 ( .clock(clk64),.reset(1'b0),.enable(enable_rx),
   
.decim_rate(decim_rate),.sample_strobe(rx_sample_strobe),.decimator_strobe(strobe_decim),.hb_strobe(hb_strobe),
   
.serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
   
.i_in(ddc0_in_i),.q_in(ddc0_in_q),.i_out(bb_rx_i0),.q_out(bb_rx_q0),.debugdata(debugdata),.debugctrl(debugctrl));

##

from the above FR_RX_FREQ_0 and FR_RX_PHASE_0 is passed to the
phase_acc which is used for the cordic algorithm.  I know that
FR_RX_FREQ_0 holds the value of the DDC center frequency and
FR_RX_PHASE_0 holds the starting phase value.

Now I would like to know if anyone could please help me with the following:

1.  When we use a tv_rx daughterboard, the FR_RX_FREQ_0 value is set
to -20MHZ, right?  From what I know it seems as if the Microtune
module mixes the signal down to 20MHz.
2.  Where does FR_RX_PHASE_0 come from?  Is this 0 because we start on
the x axis with zero degrees phase when using the cordic algorithm?
3.  sample_strobe gets set to 1 in master_control.v?  decimator_strobe
is a pulse signal with 64MHz/(decimation_rate-1) pulses per second?  I
assume that this has something to do with the rate changer in the CIC
filter that drops the sampling rate from 64MHz.  I would just like to
know why we use rate-1 in the strobe generator part in master_control?

I'm just a little confused with the strobe signals.  Logic tells me
that if we're decimating by 16, we have a decimation of 8 in the CIC
and 2 in the HBF, so strobe_decim should be 64MHz/8 and hb_strobe
should be 64MHz/(8*2).

Thank you in advance.

Sebastiaan Heunis


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


[Discuss-gnuradio] Strobe signals

2008-08-10 Thread Sebastiaan Heunis
Hi

I read a lot of the USRP's Verilog lately and sort of figured out what
happens on the FPGA.  master_control.v generates all the control
signals as far as I understand.  I would just like to know how the
strobe signals work.

Looking at master_control.v it seems as if rx_sample_strobe is always
1.  strobe_decim is a clock signal (if decim=8, strobe_decim is going
to be an 8MHz clock)?  Is this correct?  hb_strobe is going to be a
4MHz clock then and is used to tell the rx buffer how often we have
samples available for the USB link?

Thank you.

Sebastiaan


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


[Discuss-gnuradio] TVRX module questions

2008-08-06 Thread Sebastiaan Heunis
Hi

I need to figure out exactly what is happening to a captured signal
from the moment it enters the TVRX daughtercard to the moment it
enters the PC.  At this moment I am conducting some experiments on the
TVRX card.  I need to measure the signal that leaves the card and
enters the ADC.  My understanding is that pins 17 and 18 of this
module are a differential output.  We don't have a differential probe,
so I'm using CH1-Ch2 and displaying this.  My understanding is that if
I input a 100MHZ sine wave to the TVRX card, a 5.75MHZ sine should be
leaving it (we have a 3x7901 tuner module).  When I measure this
signal, I just get a random noise signal or something.  Could someone
please help me?

Thanks.

Sebastiaan Heunis


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


[Discuss-gnuradio] FIFOS

2008-07-23 Thread Sebastiaan Heunis
Hi

I managed to get the previous issue sorted.  You guys were right,
FIFOs are blocking, so you first need to open a read before you can
start writing to it.  Now I just have a question.  How do I read this
data in C++?  At the moment I am using

double *buf = new double;

 FILE* fifo = fopen("myfifo","rb");
 for (j=0;j<50;j++)
 {
  fread(buf,sizeof(float),1,fifo);
 }

to read it out.  Inside the for loop, I copy buf to an array.  This
doesn't work.  When I write the received data to a datafile, open it
in Matlab and plot it, I get all-zeros.  When I output the first 100
values on the shell, they are in the order of 1e-314.  Can anyone
please tell me how to do this?

Thank you very much.

Sebastiaan


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


[Discuss-gnuradio] FIFOs

2008-07-23 Thread Sebastiaan Heunis
Hi

I'm trying to write USRP data to a FIFO and read it out using a C++
app.  I can't get it to work.  What I did was to type 'mkfifo myfifo'
in the shell.  This is the output to ls -l myfifo.

prw-r--r-- 1 sebastiaan sebastiaan 0 2008-07-23 14:20 myfifo

I then tried to run my application, passing myfifo as a parameter.
This is the line of Python code that sets up the filesink.

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

When I run the application, it hangs and when I press CTRL+C, I get
the following output.

myfifo: Interrupted system call
terminate called after throwing an instance of 'std::runtime_error'
  what():  can't open file
Aborted

Can anyone please tell me if there are any other steps to get this to work?

Thank you very much.

Sebastiaan


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


[Discuss-gnuradio] usrp_rx_cfile.py

2008-07-22 Thread Sebastiaan Heunis
Hi

No need to reply to my previous post.  I found that usrp_rx_cfile.py
is in the utils directory and that it just uses the normal gnuradio
file sink, so I'll use that to write to a fifo.

Thank you

Sebastiaan


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


[Discuss-gnuradio] usrp_rx_cfile

2008-07-22 Thread Sebastiaan Heunis
Hi

I need to get USRP samples from Gnuradio to C++.  Eric mentioned that
a fifo with usrp_rx_cfile is the best approach to do this.  All the
examples that I see use file_sink.  How should I use usrp_rx_cfile?
Is it just like usrp_rx_cfile(gr.sizeof_gr_comples,filename)?  Then
just one more question.  If I am sampling at 500kHz (d=128), I will
get 1million samples per second when I read this in C++, real first,
then complex, and so on, right?

Thank you very much.

Sebastiaan


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


[Discuss-gnuradio] Decimation scheme

2008-07-16 Thread Sebastiaan Heunis
Hi

Can anyone please help me with some information on the CIC filters in
the USRP?  I need to know how many CIC stages there are, what the
cutoff frequency and out of band rejection is and how the decimation
is performed after filtering.  Which .v files should I have a look at?

Thank you very much.

Sebastiaan Heunis


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


[Discuss-gnuradio] Questions regarding the TVRx

2008-07-15 Thread Sebastiaan Heunis
Hi

I was wondering if anyone could please help me?  I'm doing some
measurements on the Microtune Cable modem module.  I already modified
the .py file to be able to set the 3 gain stages independently.  I am
trying to see how the gains should be set to get an input signal of
2Vp-p  to the ADC to be able to use the dynamic range as efficiently
as possible.  From what I understand, pins 17 and 18 of the cable
modem module are the outputs that go to the ADC.  This is a
differential signal, right?  We don't have a differential probe, so I
am measuring pins 17 and 18 on 2 oscilloscope channels and then
displaying the difference of the two.  This should give me the signal
that goes to the ADC, right?  I'm inputting a 100MHz sine wave, so
this should be a 43.75MHz sine wave?  Somewhere I am doing something
wrong, as this is not what I get.  Can anyone who has done something
similar please tell me how to do it?

Then I also have a few questions regarding the module itself.  From
what I understand, the signal gets captured, amplified by the RF amp,
mixed down to 43.75MHz, amplified by the IF amp and then sent to the
ADC, right?

Thank you for your help.

Sebastiaan


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


Re: [Discuss-gnuradio] Adding modified .py files to applications

2008-07-03 Thread Sebastiaan Heunis
George

Thanks.  So I just reinstall GnuRadio with the new .py file and next
time I use a TvRX daughterboard, I'll be able to access any newly
created functions?

Sebastiaan

On 7/3/08, George Nychis <[EMAIL PROTECTED]> wrote:
>
>
> Sebastiaan Heunis wrote:
>> Sorry if I'm double posting, but I don't know if yesterday's message
>> got to the mailing list.  I want to edit db_tv_rx.py in order to set
>> the three aplification gains independently.  How do I include a
>> modified .py file in the Gnuradio installation to make my Gnuradio
>> application use the new file?
>>
>
> When you're done modifying it, do a 'sudo make install'
>
> - George
>


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


[Discuss-gnuradio] Adding modified .py files to applications

2008-07-03 Thread Sebastiaan Heunis
Sorry if I'm double posting, but I don't know if yesterday's message
got to the mailing list.  I want to edit db_tv_rx.py in order to set
the three aplification gains independently.  How do I include a
modified .py file in the Gnuradio installation to make my Gnuradio
application use the new file?

Thank you

Sebastiaan Heunis


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


Re: [Discuss-gnuradio] Controlling individual gains

2008-07-02 Thread Sebastiaan Heunis
Eric

Thanks.  I read through the code in db_tv_rx.py and I know how that
works now.  You're first setting the gain of the rf amp up to a level
of 60dB, then the if amp up to a level of 35 dB and then the pga up to
a level of 20dB.  From what I understand I need to modify that .py
file and include my own set_gain() function, right?  If I did that,
how do I modify gnuradio in order to use my new db_tv_rx.py next time?

Thank you.

Sebastiaan


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


[Discuss-gnuradio] Controlling individual gains

2008-07-02 Thread Sebastiaan Heunis
Hi

Can anyone please tell me how to individually control the
amplification stages when using a Microtune tuner module with the usrp
(IF,RF and PGA)?  self.subdev0.set_gain() sets the total gain as far
as I understand.

Thank you in advance.

Sebastiaan Heunis


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


[Discuss-gnuradio] C++ interface to USRP

2008-06-21 Thread Sebastiaan Heunis
-- Forwarded message --
From: Sebastiaan Heunis <[EMAIL PROTECTED]>
Date: Sat, 21 Jun 2008 19:31:30 +0200
Subject: Re: [Discuss-gnuradio] C++ interface to USRP
To: [EMAIL PROTECTED]

Chuck

I know about the interp = 128, meaning that the data gets decimated to
decrease the number of samples.  I have captured some samples in
GnuRadio using the Python code.  I just need to figure out how to
reblock it from 500096 to 50 samples and still maintain all the
info or if there is a way to get 50 samples.  For what I need to
do, C++ will be better.  Something else for anyone that might be able
to know?  In the C++ code the data transfer from the USRP to the
application is started by urx->start(); and stopped by urx->stop();.
The calculations that I am doing in C++ takes about half a minute to
complete.  What I would like to do is capture 50 samples, do the
calculations, display the result, capture another 50 samples,
calculate, update the display and so forth.  So I would like to only
read in samples when one set of calculations are complete.  Otherwise
I might have to use 2 threads to handle the data reads and calculation
processes.  Has anyone done something similar?

Thank you.

Sebastiaan

On 6/21/08, Charles Swiger <[EMAIL PROTECTED]> wrote:
> Hi - Someone else should know this better, but a stab at it: The USRP
> samples at a fixed 64e6 rate, and you can control the amount of data
> sent over the usb by using interp.  You get a usrp rate of 50 by
> using interp = 128, which is very doable.   I think you can process
> units of 50 by reading in multiples of 128 and reblocking to 50
> somehow.  Just a guess. Read in enough to get over 50, tie a ribbon
> on that package and send it off to your app, use the residual and keep
> appending data until you get over 50 again, repeat. You don't *have*
> to read exactly 50 samples, just make sure your app can process,
> or buffer it somewhere, faster than the usrp can send it.
>
> --Chuck
>
>
> On Sat, 2008-06-21 at 11:48 -0400, Sebastiaan Heunis wrote:
>> Hi
>>
>> Can anyone please help me?  I want to use the C++ interface in order
>> to use the Qwt C++ library to create contour plots, etc.
>> UsrpFAQ/CppInterface has some code illustrating how to do this.  I
>> just have a few questions concerning this.  I'm sorry, but my
>> understanding of sampling is not what it is supposed to be.  In the
>> code samples per read needs to be a multiple of 128.  So if I'm
>> sampling at 500 000 samples per second in the USRP, I can only read in
>> 499968 samples into the C++ program?  Is the rest just discarded and
>> if I read again, do I read in 499968 samples of the next time sampling
>> time?  I would ideally like to sample at 50.  Can I set the USRP
>> to this, read in more than 50 samples and just discard the rest?
>>
>> Thank you very much.
>>
>> Sebastiaan
>>
>>
>> ___
>> 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] C++ interface to USRP

2008-06-21 Thread Sebastiaan Heunis
Hi

Can anyone please help me?  I want to use the C++ interface in order
to use the Qwt C++ library to create contour plots, etc.
UsrpFAQ/CppInterface has some code illustrating how to do this.  I
just have a few questions concerning this.  I'm sorry, but my
understanding of sampling is not what it is supposed to be.  In the
code samples per read needs to be a multiple of 128.  So if I'm
sampling at 500 000 samples per second in the USRP, I can only read in
499968 samples into the C++ program?  Is the rest just discarded and
if I read again, do I read in 499968 samples of the next time sampling
time?  I would ideally like to sample at 50.  Can I set the USRP
to this, read in more than 50 samples and just discard the rest?

Thank you very much.

Sebastiaan


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


[Discuss-gnuradio] Getting samples from Gnuradio to c++

2008-06-16 Thread Sebastiaan Heunis
Can anyone please help me?

I want to capture samples from Gnuradio and get them to a c++
application in real-time.  I then want to calculate the ambiguity
function and display it on a contour plot.  What is the best way to do
this?  What I have in mind is to use Qwt with Qt for this, but then I
will need to get the samples to c++ in real-time.

Thank you very much.

Sebastiaan Heunis


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


[Discuss-gnuradio] Mp3 decoding block

2008-02-27 Thread Sebastiaan Heunis
Hi

I need to write a Gnuradio application where I should be able to open
an mp3, decode it and FM modulate it.  I do not find any blocks in
Gnuradio that can do this.  The idea that I have is to write a C++
block using libmad to decode the mp3 and then use SWIG to make it
available in Gnuradio.  Is this correct or is there an easier way?

Thank you

Sebastiaan


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


[Discuss-gnuradio] RuntimeError: Unable to find USRP #0

2008-02-20 Thread Sebastiaan Heunis
Hi

Can anyone please help me?  I am using gnuradio3.1.1.  I had no build
problems and it installed fine.  When I try to run
usrp_benchmark_usb.py, I get the a RuntimeError: Unable to find USRP
#0.  I don't think that the firmware gets downloaded to the USRP,
since the one light keeps on flashing quite fast.  When I issue

ls -lR /dev/bus/usb | grep usrp,

I get

crw-rw 1 root usrp 189, 516 Feb 20 17:59 005.

Thanks a lot.

Sebastiaan


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