Re: [Discuss-gnuradio] SWIG related problem with new filter function

2011-07-03 Thread John Andrews
Here are all the related files.

C++ header
***
* dsss_firdes.h *
***
#ifndef _DSSS_FIRDES_H_
#define _DSSS_FIRDES_H_

#include 
#include 

class dsss_firdes {
public:
  dsss_firdes();

static std::vector raised_cosine (double gain, double sampling_freq,
double symbol_rate,  double alpha,  int ntaps);
};

#endif



C++ Source file -
*
* dsss_firdes.cc  *
*

#include "dsss_firdes.h"
#include 

using std::vector;

// Raised Cosine Filter

vector
dsss_firdes::raised_cosine (double gain, double sampling_freq, double
symbol_rate, double alpha, int ntaps)
{
   ntaps |= 1; // ensure that ntaps is odd

   double spb = sampling_freq/symbol_rate; // samples per bit/symbol
   vector taps(ntaps);
   double scale = 0;
   for(int i=0;i raised_cosine(double gain, double sampling_freq,
double symbol_rate, double alpha, int ntaps);
};

 ***
*  Makefile.am   *
 ***

include $(top_srcdir)/Makefile.common

# C/C++ headers get installed in ${prefix}/include/gnuradio
grinclude_HEADERS =  dsss_firdes.h

###
# SWIG Python interface and library

TOP_SWIG_IFILES = dsss.i

# Install so that they end up available as:
# import gnuradio.dsss
# This ends up at:
# ${prefix}/lib/python${python_version}/site-packages/gnuradio
dsss_pythondir_category = gnuradio


# additional sources for the SWIG-generated library
dsss_la_swig_sources =  dsss_firdes.cc

include $(top_srcdir)/Makefile.swig

# add some of the variables generated inside the Makefile.swig.gen
BUILT_SOURCES = $(swig_built_sources)

# Do not distribute the output of SWIG
no_dist_files = $(swig_built_sources)








On Sun, Jul 3, 2011 at 10:33 AM, Tom Rondeau  wrote:

> On Sun, Jul 3, 2011 at 3:25 AM, John Andrews  wrote:
>
>> Hi Tom,
>>
>>
>>
>>> Are you doing this in your own top-level block (dsss from the looks of
>>> it) or under a current GNU Radio directory like gnuradio-core where the
>>> gr_firdes currently is?
>>>
>> Yes, I am doing this in my own top-level directory named 'dsss'
>> (abbreviation for direct sequence spread spectrum)
>>
>>>
>>> You haven't mentioned adding anything to the Makefile so that it is built
>>> properly. If you are working under gnuradio-core/src/lib/general, you'll
>>> also want to add your .h and .i files to general.i so that it get's
>>> compiled.
>>>
>>
>> I added the names to Makefile.am like I added the remaining names of
>> files. The Makefile.am has been adapted from howto-write-a-block. The C++
>> part gets compiled without any problem but when importing in python it
>> throws an undefined_variable_dsss_firdes_Z*** type of error, which according
>> to my previous experience occurs with wrong SWIG interface problem. I am
>> pretty sure I am having a SWIG related issue here.
>>
>
> Ok, it _sounds_ like you are doing everything correctly. In my experience
> with this stuff, it usually comes down to a small typo somewhere. You can
> post your files here (.i, .h, and Makefile) so others to maybe have a look
> to see if there's anything incorrect in them.
>
>
>> Also, just curious, what application are you interested in that requires a
>>> raised cosine filter? And couldn't you just create a root raised cosine
>>> filter and convolve the the taps against themselves to make the raised
>>> cosine taps?
>>>
>>
>> I am developing a  BPSK based Direct sequence spread spectrum Tx/Rx and at
>> the transmitter i wanted to use a raised cosine filter when interpolating
>> from symbol to N samples before sending it to the USRP. I am not sure if
>> this is the preferred method but I haven't found any documentation  related
>> to DSSS that mentions pulse-shaping.
>>
>>>
>>> Tom
>>>
>>
> There is definitely some work on pulse shaping of DSSS systems. I believe,
> though, that they all use root raised cosine filters. This is done at both
> the transmitter and receiver so that the received signal has gone through
> two root raised cosine filters to make the raised cosine filter, which is a
> Nyquist filter.
>
> Tom
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] SWIG related problem with new filter function

2011-07-03 Thread John Andrews
Hi Tom,


> Are you doing this in your own top-level block (dsss from the looks of it)
> or under a current GNU Radio directory like gnuradio-core where the
> gr_firdes currently is?
>
Yes, I am doing this in my own top-level directory named 'dsss'
(abbreviation for direct sequence spread spectrum)

>
> You haven't mentioned adding anything to the Makefile so that it is built
> properly. If you are working under gnuradio-core/src/lib/general, you'll
> also want to add your .h and .i files to general.i so that it get's
> compiled.
>

I added the names to Makefile.am like I added the remaining names of files.
The Makefile.am has been adapted from howto-write-a-block. The C++ part gets
compiled without any problem but when importing in python it throws an
undefined_variable_dsss_firdes_Z*** type of error, which according to my
previous experience occurs with wrong SWIG interface problem. I am pretty
sure I am having a SWIG related issue here.

>
> Also, just curious, what application are you interested in that requires a
> raised cosine filter? And couldn't you just create a root raised cosine
> filter and convolve the the taps against themselves to make the raised
> cosine taps?
>

I am developing a  BPSK based Direct sequence spread spectrum Tx/Rx and at
the transmitter i wanted to use a raised cosine filter when interpolating
from symbol to N samples before sending it to the USRP. I am not sure if
this is the preferred method but I haven't found any documentation  related
to DSSS that mentions pulse-shaping.

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


[Discuss-gnuradio] SWIG related problem with new filter function

2011-07-01 Thread John Andrews
Hi,
Based on gr_firdes.cc/gr_firdes.h/gfr_firdes.i I developed a similar class
to generate filter taps for a Raised Cosine filter. The following is the
SWIG interface file and the C++ header with .cc file containing the
algorithm for the static function declared in the header. The compilation
goes without errors but when I import in Python environment I do not see
this function being imported. It seems like SWIG doesn't see the definition
of the member functin 'raised_cosine'.

SWIG INTERFACE

%{
#include "dsss_firdes.h"
%}

GR_SWIG_BLOCK_MAGIC(dsss,firdes);
class dsss_firdes
{
public:
static std::vector raised_cosine(double gain, double sampling_freq,
double symbol_rate, double alpha, int ntaps);
};

C++ HEADER
class dsss_firdes {
public:
static std::vector raised_cosine (double gain, double
sampling_freq, double symbol_rate,  double alpha,  int ntaps);
};


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


Re: [Discuss-gnuradio] Raised Cosine Filter design

2011-06-29 Thread John Andrews
Yep! Done. fred harris' book helped the most.

Thanks

On Tue, Jun 28, 2011 at 12:25 PM, Colby Boyer  wrote:

> Look at the source code used to generate the raised cosine, gr_firdes.h
> should point to it. Making your own should follow directly from that; also
> the wikipedia page on the raised cosine is also nice.
>
> Its not black magic, so do not fear the source. :P
>
> --Colby
>
> On Tue, Jun 28, 2011 at 9:12 AM, John Andrews  wrote:
>
>> Hi,
>> I want a raised cosine filter for the transmitter and can someone lead me
>> to a place where I can develop one similar to what we have in gr_firdes.h
>>
>> Thanks
>>
>> ___
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Raised Cosine Filter design

2011-06-28 Thread John Andrews
Hi,
I want a raised cosine filter for the transmitter and can someone lead me to
a place where I can develop one similar to what we have in gr_firdes.h

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


Re: [Discuss-gnuradio] Missing gr_plot_ofdm.py

2011-06-20 Thread John Andrews
http://vps.gnuradio.org/redmine/repositories/entry/gnuradio/gnuradio-examples/python/ofdm/gr_plot_ofdm.py?rev=ab6cf111c1d00b22d9016524b31cfcc6b09ffdc7

On Mon, Jun 20, 2011 at 1:21 PM, smith mark wrote:

> Hi all
> I want to plot the .dat files that are created by the benchmark_ofdm code.
> But I didn't find the "gr_plot_ofdm.py"
> file anywhere in the my gnuradio directory. I am using gnuradio 3.3.0. I
> did find the "plot_ofdm.m" file but I want to
> use python only. I downloaded gnuradio3.2.2 but didn't find the file there
> too.
>
> Please tell me from where I can download this file..
>
> Regards
> Usman Haider
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Information

2011-06-20 Thread John Andrews
http://gnuradio.org/redmine/wiki/gnuradio

On Mon, Jun 20, 2011 at 12:24 PM, bilel mnassri wrote:

> HI to all of you,
>
>
> I am a new user of GNUradio companion and i am seraching for
> examples using USRP blocks and employing some advances signal processing
> techniques such as MIMO.
> please help me. i am in a big problem !!!
>
> have a nice day.
> Bilel
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Receive GPS L1 Signal

2011-06-20 Thread John Andrews
On Sat, Jun 11, 2011 at 11:12 AM, Eddie Sun wrote:

> Hi all,
>
> I have a USRP N210 and DBSRX2 daughter board, running on Ubuntu 10.04, and
> I would like to get the L1 signal by
>
> using Gnuradio Companion to draw a GPS receiver flow graph (I have a GPS
> Antenna), and I just need to get the IF signal into File
>
> Sink to get the .dat so I can use MATLAB to deal with the data, I have a
> book "A Software-Defined GPS and Galileo Receiver: A
>
> Signal-Frequency Approach",


This is the best book for software GPS.


> there is a GNSS L1 front-end digram at p.55 (that is my only reference),
> but I have no idea how to
>
> translate it into GNUradio Blocks.There is a ADC on that diagram, should I
> just ignore it, or I need some blocks to complete that ADC?
>

ADC. Do you know what ADC means? If you do then you already have an ADC,
which is the USRP. ;-)


>
> (There is no blocks called ADC)And there is several Band-Pass Filter in the
> diagram with center frequency and 3dB Bandwidth, but I
>
> don't know how to translate it to the information that blocks needed.(Like
> Low or High cutoff frequency, transition width ...etc)
>

A USRP is a baseband IF receiver. Tune it to the GPS L1 frequency with the
right decimation rate so that you have your band of interest selected. This
should give you the IF signal.


>
> Can anyone help me? Or has an example .grc or some website for related
> information?
>
>
>
> Thanks,
>
> Eddie
>
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] sample wise execution of blocks in grc flow graph?

2011-06-15 Thread John Andrews
On Wed, Jun 15, 2011 at 1:31 AM, Henry Matt  wrote:

> Hi Colby,
>
> So it means that it if one input comes at 20 samples/sec then it limits the
> output rate of my custom block to exactly 20 samples/sec? That is, the other
> input, gr_noise_source can provide samples at a rate faster than 20
> samples/sec to the custom block input but the custom block produces output
> only when both inputs are available. Am I right?
>

Yes, the custom block will execute its general_work() function only when the
right number of input items are available on all the input streams.


> I am sorry for not being clear about the other part of question. The
> question is that if I further multiply the output of the custom block (which
> has a sample rate of 20 samples/sec) with another signal of sampling rate 2M
> samples/sec then what will be the sampling rate of the product signal?
>

Look at the general_work() function for the simplest of blocks such as
gr_add_cc etc to understand the behaviour. Look at the following example. In
this I am producing 1/4th the number of input items I am using. I am sending
out every 4th input sample to the output, and effectively reducing the
sampling rate by 4. So as long as the input is available I keep sending
every 4th item to the output. If the input doesn't arrive then the executing
thread waits until it has something to work with.

int
custom_block_b::general_work(int noutput_items,gr_vector_int
&ninput_items,gr_vector_const_void_star &input_items,gr_vector_void_star
&output_items)
{
  const unsigned char *in = (const unsigned char *)input_items[0];
 unsigned char *out = (unsigned char *)output_items[0];
 int j=0;
  for(int i=0;i If it will be 2M samples/sec then will the  custom block output sampled at
> 2M samples/sec have 1 non-zero sample followed by 100,000-1 zeros or will
> the custom block hold its output value to repeat it 100,000 times until the
> next sample arrives after 50mS?
>
> Thanks a lot,
> H.
>
>
> Hi Henry,
>
> GNU Radio, as far as I understand, does not have a concept of time. It will
> try to process samples as quickly as they are available. If your input
> sample is arriving every 50mS then a sample should be produced by your block
> shortly after the 50mS arrival mark.
>
> What do you mean, the output value should stay there? The output value is
> shipped off to some other block that connects to yours.
>
> --Colby
>
> On Tue, Jun 14, 2011 at 10:35 PM, Henry Matt wrote:
>
> Hi,
>
> I have made a custom block derived from gr_block which has two inputs.
> First input comes at a sampling rate of 20 samples/sec while the other input
> comes from the gr_noise_source block. Now, my question is: what will be the
> sampling rate at my custom block output? Is it also 20 samples/sec? If not
> then how can I make it 20 samples/sec. Also,  my custom block needs to
> operate on sample by sample basis not on chunks of noutput_items. In other
> words, the custom block should produce an output sample after every 50mS
> (and not before) when both inputs arrive and that output value then should
> stay there for another 50mS until next input samples for two inputs arrive
> and new output is computed.
>
> Thanks in anticipation,
> H.
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
>
>
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Packet Decoder block malfunction after demodulation!

2011-06-15 Thread John Andrews
On Wed, Jun 15, 2011 at 9:53 AM, Vlad Stoianovici <
stoianovici_v...@yahoo.com> wrote:

>
> Dear list,
> I'm using a typical UHD USRP source (USRP2) --> Low-Pass filter --> GMSK
> Demod --> Packet Decoder --> File Sink receiver flow-graph in GnuRadio to
> receive the signal I'm transmitting with a mirrored transmitting flow.
> The problem is that the Packet Decoder (Output type - "byte"; Access Code -
> field left blank; Threshold -" -1") doesn't really do anything, the signal
> streams blocks there, and the file that the File Sink should create with
> the
> data from Packet Decoder is always empty.
> The rest of the flow-graph seems to be working properly, I can visualize
> the
> received signal, that seems to be the same as the transmitted one.
>

Are you sure its not doing what its supposed to do? Look at the work()
function
in your packet decoder. If the input doesn't fit the requirement of the
algorithm to
produce the output then it won't produce anything at its output. Think of it
this way.
Suppose the packet decoder block produces output items only when the input
is greater
than the threshold = T. If the input is constantly under T then there is
nothing produced.


If I take out the Packet Decoder, the file that results form the File Sink
> has a size larger than 0 bytes, which leads me to believe that the problem
> is with this block.
> Any ideas or similar problems?
> Thanks,
>
> Vlad.
>
> --
> View this message in context:
> http://old.nabble.com/Packet-Decoder-block-malfunction-after-demodulation%21-tp31852171p31852171.html
> Sent from the GnuRadio mailing list archive at Nabble.com.
>
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] What happens to incoming data if a block is too slow?

2011-06-13 Thread John Andrews
Is the data coming in the buffer FIFO? Is there a way to keep track of how
much data is lost?

On Mon, Jun 13, 2011 at 6:35 PM, Marcus D. Leech  wrote:

> Hi,
>> What happens to the incoming data from USRP, over the USB bus, when a
>> gnuradio block takes a lot of time to process its output? Is the data
>> buffered indefinitely or is it dropped as new samples come in case the
>> consumption rate is slow.
>>
>> Thanks
>>
> That's what's called an "overrun".  Data gets dropped.  The buffers are
> large, but not infinite.
>
> --
> Marcus Leech
> Principal Investigator
> Shirleys Bay Radio Astronomy Consortium
> http://www.sbrac.org
>
>
>
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] What happens to incoming data if a block is too slow?

2011-06-13 Thread John Andrews
Hi,
What happens to the incoming data from USRP, over the USB bus, when a
gnuradio block takes a lot of time to process its output? Is the data
buffered indefinitely or is it dropped as new samples come in case the
consumption rate is slow.

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


[Discuss-gnuradio] Direct conversion receiver

2011-06-12 Thread John Andrews
Hi,
If the signal transmitted at the transmitter is represented as,
x(t) = X_i(t)cos(2*pi*fc*t) - X_q(t)sin(2*pi*fc*t), where X_i(t) and X_q(t)
are inphase and quadrature components of the message signal.

then, at the receiver does the following equation correctly represent the
signal after downcoversion to baseband like in a "RFX2400 + USRP' set up.

inphase component of received signal = X_i(t)cos(2*pi*f_offset*t + phi )  +
noise_component
quadrature component of received signal = X_q(t)sin(2*pi*f_offset*t + phi) +
noise_component

where, 'f_offset' is the frequency offset present and 'phi' is the received
signal phase.

Can someone suggest a good reference to direct conversion receivers?

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


Re: [Discuss-gnuradio] Signal coming from the USRP to the computer

2011-05-31 Thread John Andrews
Yes Patrick, I agree with your explanation. That was succinct and easy to
understand. Thanks.

On Tue, May 31, 2011 at 4:55 PM, Patrick Sisterhen  wrote:

> John,
>
> Typo in my equations, should have been:
>
> y_q = (x_i * sin(phi)) - (x_q * cos(phi))
>
> Patrick Sisterhen
> National Instruments
>
>
>
> From:John Andrews 
> To:Patrick Sisterhen 
> Cc:discuss-gnuradio@gnu.org
> Date:05/31/2011 02:08 PM
> Subject:Re: [Discuss-gnuradio] Signal coming from the USRP to the
> computer
> --
>
>
>
> Thanks Patrick. I was concerned with the received signal path. Suppose, I
> have the receiver tuned to, let's say, GPS signal. What will the received
> signal look like. Considering the GPS message signal is m(t), then what
> would equation would best describe the received signal.
>
> If 'f_c' is the carrier frequency then the signal coming over the USB bus
> on to the computer for baseband processing will be,
> inphase(t) = m(t) cos(phi)
> quadrature(t) = m(t)sin(phi)
>
> where, 'phi' is the instantaneous offset. Remember, phi here is a broad
> term which includes all kinds of offsets(frequency, phase etc).
>
> On Tue, May 31, 2011 at 11:47 AM, Patrick Sisterhen <*
> patrick.sister...@ni.com* > wrote:
> I think a little more detailed precise answer to John's question might
> help:
>
> John Andrews wrote:
>
> > each complex sample that enters the
> > USB bus is the following,
> >
> > x[i] = (inphase_component) + j (quadrature_component), and
> > x[i] = m(t)cos( 2*pi*FREQ_OFFSET*t + PHI ) + jm(t)sin( 2*pi*FREQ_OFFSET*t
> +
> > PHI ), where m(t), is the actual message signal, FREQ_OFFSET is the
> > frequency offset, and PHI is the phase.
> >
> > Is that correct?
>
> I think you're confusing the baseband and passband signals a little, and
> the equations aren't quite right.
>
> The complex-baseband signal (your message) is the data that is transferred
> across the USB channel.
> x[i] = (in-phase) + j*(quadrature)
>= (x_i) + j*(x_q)
>
> These are samples of your message signal, after modulation (mapping to a
> complex QAM-constellation, for example), coding, pulse-shaping, etc.
>
> The signal is up/down converted on the USRP device such that the
> transmitted RF signal is
>
> r(t) = x_i*cos(2*pi*f_c) - (x_q)*sin(2*pi*f_c)
>
> (where f_c is your RF carrier frequency, and I'm ignoring phase offsets and
> noise)
>
> Notice the subtraction there (which comes from the trig identities) and
> that all the terms are real (it's a real passband signal).
>
> Hope that helps a little.
>
> Patrick Sisterhen
> National Instruments
> ___
> Discuss-gnuradio mailing list*
> **Discuss-gnuradio@gnu.org* *
> **https://lists.gnu.org/mailman/listinfo/discuss-gnuradio*<https://lists.gnu.org/mailman/listinfo/discuss-gnuradio>
>
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Signal coming from the USRP to the computer

2011-05-31 Thread John Andrews
Thanks Patrick. I was concerned with the received signal path. Suppose, I
have the receiver tuned to, let's say, GPS signal. What will the received
signal look like. Considering the GPS message signal is m(t), then what
would equation would best describe the received signal.

If 'f_c' is the carrier frequency then the signal coming over the USB bus on
to the computer for baseband processing will be,
inphase(t) = m(t) cos(phi)
quadrature(t) = m(t)sin(phi)

where, 'phi' is the instantaneous offset. Remember, phi here is a broad term
which includes all kinds of offsets(frequency, phase etc).

On Tue, May 31, 2011 at 11:47 AM, Patrick Sisterhen <
patrick.sister...@ni.com> wrote:

> I think a little more detailed precise answer to John's question might
> help:
>
> John Andrews wrote:
>
> > each complex sample that enters the
> > USB bus is the following,
> >
> > x[i] = (inphase_component) + j (quadrature_component), and
> > x[i] = m(t)cos( 2*pi*FREQ_OFFSET*t + PHI ) + jm(t)sin( 2*pi*FREQ_OFFSET*t
> +
> > PHI ), where m(t), is the actual message signal, FREQ_OFFSET is the
> > frequency offset, and PHI is the phase.
> >
> > Is that correct?
>
> I think you're confusing the baseband and passband signals a little, and
> the equations aren't quite right.
>
> The complex-baseband signal (your message) is the data that is transferred
> across the USB channel.
> x[i] = (in-phase) + j*(quadrature)
>= (x_i) + j*(x_q)
>
> These are samples of your message signal, after modulation (mapping to a
> complex QAM-constellation, for example), coding, pulse-shaping, etc.
>
> The signal is up/down converted on the USRP device such that the
> transmitted RF signal is
>
> r(t) = x_i*cos(2*pi*f_c) - (x_q)*sin(2*pi*f_c)
>
> (where f_c is your RF carrier frequency, and I'm ignoring phase offsets and
> noise)
>
> Notice the subtraction there (which comes from the trig identities) and
> that all the terms are real (it's a real passband signal).
>
> Hope that helps a little.
>
> Patrick Sisterhen
> National Instruments
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Signal coming from the USRP to the computer

2011-05-29 Thread John Andrews
Of course that is true. I just wanted to make sure my understanding of the
whole signal flow in GNU Radio/USRP system was right. The IF, down coversion
etc stages confused me a bit. I was only interested in what I am getting on
the USB bus to work with so, I wanted to make sure my understanding of this
system was right.

Thanks for the reply.

On Sun, May 29, 2011 at 4:11 PM, Marcus D. Leech  wrote:

> On 05/29/2011 04:50 PM, John Andrews wrote:
>
>> Hi All,
>> I want to know what is the signal coming from the USRP onto the USB bus. I
>> know that the received signal is a baseband signal and assuming complex
>> sampling (I have RFX2400 daughterboards) each complex sample that enters the
>> USB bus is the following,
>>
>> x[i] = (inphase_component) + j (quadrature_component), and
>> x[i] = m(t)cos( 2*pi*FREQ_OFFSET*t + PHI ) + jm(t)sin( 2*pi*FREQ_OFFSET*t
>> + PHI ), where m(t), is the actual message signal, FREQ_OFFSET is the
>> frequency offset, and PHI is the phase.
>>
>> Is that correct?
>>
>> Thanks
>>
>>
>>  More or less, yes.
>
> There will be random noise components as well, since this is "real world",
> rather than purely a Matlab simulation :-)
>
>
>
> --
> Marcus Leech
> Principal Investigator
> Shirleys Bay Radio Astronomy Consortium
> http://www.sbrac.org
>
>
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Signal coming from the USRP to the computer

2011-05-29 Thread John Andrews
Hi All,
I want to know what is the signal coming from the USRP onto the USB bus. I
know that the received signal is a baseband signal and assuming complex
sampling (I have RFX2400 daughterboards) each complex sample that enters the
USB bus is the following,

x[i] = (inphase_component) + j (quadrature_component), and
x[i] = m(t)cos( 2*pi*FREQ_OFFSET*t + PHI ) + jm(t)sin( 2*pi*FREQ_OFFSET*t +
PHI ), where m(t), is the actual message signal, FREQ_OFFSET is the
frequency offset, and PHI is the phase.

Is that correct?

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


[Discuss-gnuradio] USRP complex multiplication question

2011-05-25 Thread John Andrews
Dear All,
I have a question regarding the first complex multiplication process with
the IF sinusoid in the USRP. Which of the scheme mentioned below is actually
happening in the USRP?

Let's say that two ADCs provide the sampled received signal to the next
stage of processing. Let's call the sampled stream of ADC_0 as A and sampled
stream of ADC_1 as B.


SCHEME-1

The NCO produces two sinusoids that are in quadrature phase with each other.
These are sin(2*pi*f*t) and cos(2*pi*f*t). Let's call the
sin(2*pi*f*t)stream as C and
cos(2*pi*f*t) stream as D. The multiplier after the ADC stage does the
following.

1. Multiplies the cos(2*pi*fc*t) stream, C,  with the sampled data stream of
ADC_0, which is the stream named A and the product is AC.
2. Multiplies the sin(2*pi*fc*t) stream with the sampled data stream of
ADC_1, which is the stream named B and the product is BD.

Then sends the resultant product  from these two steps as a complex sample,
( AC + jBD )

SCHEME-2

The NCO produces two sinusoids that are in quadrature phase with each other.
These are sin(2*pi*f*t) and cos(2*pi*f*t). The multiplier after the ADC
stage does the following.

The multiplier after ADC stage then multiplies the ADC outputs with the NCO
outputs as
( A + jB ) * ( C + jD) = (AC - BD) + j(AD + BC)
and sends the above output as a complex sample.

Which one is true?

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


Re: [Discuss-gnuradio] How can we measure the frequency offsets between two USRPs?

2011-05-16 Thread John Andrews
I figured it out. The USRP input must have an input amplitude between 0 and
32767. When the amplitude was low the signal power was below noise so I
couldn't see anything in the FFT. When I raised it to 2 I was able to
see the peak around ( signal frequency +/-  offset ).

Marcus about your statements about the SAW filter; I will know a little more
about it first from the mail archive and then ask more about it. I don't
know anything about it yet so before I ask you something more about it I
want to do a little homework myself.

Thanks

On Mon, May 16, 2011 at 5:31 PM, Marcus D. Leech  wrote:

>  Let me give you the details this time. sorry for the confusion.
>
>  USRP - The first version
> Daughterboard - RFX2400
>
>  The signal source has the following settings.
> 1. Sample Rate - 1Msps
> 2. Waveform - Sine & Complex
> 3. Frequency - 100kHz
>  4. Amplitude - 10
> 5. Offset - 0
>
>  This source is connected to the USRP Sink directly. There is no other
> block in between and not even a throttle.
>
>  USRP sink settings:
> 1. Interpolation - 128
> 2. Frequency - 2.5GHz
> 3. Gain (dB) - 30
> 4. Side - A (Tx/Rx) The USRP is connected fine and works well with
> benchmark_tx/rx tests.
>
>  On the receiver side I use a GRC flowgraph with USRP sink and FFT block
> only.
>
>  USRP Sink:
> 1. Decimation - 64
> 2. Frequency - 2.5GHz
> 3. Gain (dB) - 10
>
>  FFT sink has proper settings too.
>
>  I am not using any filters as I hope the SNR is high enough.
>
>  Thanks
>
>  On Mon, May 16, 2011 at 3:47 PM, Marcus D. Leech wrote:
>
>>  On Mon, 2011-05-16 at 15:34 -0500, John Andrews wrote:
>>>
>>>> I am running it at 2.5GHz.
>>>>
>>> What magnitude are the samples you're feeding into the USRP sink?
>>>
>>> --n
>>>
>>>  Also, by default the RFX2400 has a TX filter that's centered at
>> 2.441GHz and about 85Mhz wide at the 3dB points.  So, there'll be some
>> attenuation
>>  at 2.5GHz, roughly 6-8dB or so.
>>
>>
>>
>  It would be useful to see your .grc flow-graph files.  Are you using UHD,
> or "classic" (sorry if this has already been asked).
>
> I'll reiterate my earlier comments.  The RFX2400, by default, has a
> *hardware* SAW filter with a center frequency of 2.414GHz, and a nominal
>   bandwidth of 85MHz or so in the TX/RX path, so if you're running it at
> 2.5GHz, you're somewhere on the skirts of the filter, which would lead
>   to attenuated output.  This filter can be bypassed easily by carefully
> cutting the traces going to FIL1, and populating C204 with a 30-100pF
>   SMD capacitor.
>
>
>
>
>
> --
> Marcus Leech
> Principal Investigator
> Shirleys Bay Radio Astronomy Consortiumhttp://www.sbrac.org
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] How can we measure the frequency offsets between two USRPs?

2011-05-16 Thread John Andrews
Let me give you the details this time. sorry for the confusion.

USRP - The first version
Daughterboard - RFX2400

The signal source has the following settings.
1. Sample Rate - 1Msps
2. Waveform - Sine & Complex
3. Frequency - 100kHz
4. Amplitude - 10
5. Offset - 0

This source is connected to the USRP Sink directly. There is no other block
in between and not even a throttle.

USRP sink settings:
1. Interpolation - 128
2. Frequency - 2.5GHz
3. Gain (dB) - 30
4. Side - A (Tx/Rx) The USRP is connected fine and works well with
benchmark_tx/rx tests.

On the receiver side I use a GRC flowgraph with USRP sink and FFT block
only.

USRP Sink:
1. Decimation - 64
2. Frequency - 2.5GHz
3. Gain (dB) - 10

FFT sink has proper settings too.

I am not using any filters as I hope the SNR is high enough.

Thanks

On Mon, May 16, 2011 at 3:47 PM, Marcus D. Leech  wrote:

> On Mon, 2011-05-16 at 15:34 -0500, John Andrews wrote:
>>
>>> I am running it at 2.5GHz.
>>>
>> What magnitude are the samples you're feeding into the USRP sink?
>>
>> --n
>>
>>  Also, by default the RFX2400 has a TX filter that's centered at 2.441GHz
> and about 85Mhz wide at the 3dB points.  So, there'll be some attenuation
>  at 2.5GHz, roughly 6-8dB or so.
>
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] How can we measure the frequency offsets between two USRPs?

2011-05-16 Thread John Andrews
I am running it at 2.5GHz.

On Mon, May 16, 2011 at 12:39 PM, Nick Foster  wrote:

> On Mon, 2011-05-16 at 12:32 -0500, John Andrews wrote:
> > I am using the 1st generation USRP with RFX2400 daughterboards each
> > connected to the TX/RX interface.
> >
> > In the sine source block I am using a frequency of 100kHz. As the
> > interpolation of USRP sink is 128 I am using a sampling frequency of
> > 1Msps.
>
> And what center frequency are you running at?
>
> --n
>
> >
> > On Mon, May 16, 2011 at 12:27 PM, Nick Foster  wrote:
> > On Mon, 2011-05-16 at 12:23 -0500, John Andrews wrote:
> > > I am using GRC. I used a signal source block generating a
> > complex sine
> > > at 100kHz. The USRP interpolation is 128 and the sampling
> > rate of the
> > > sine generator is 1MHz. The USRP connected to another
> > computer has
> > > USRP source configured at 64 decimation and is connected to
> > an FFT
> > > block. I don't see any peak at the expected frequency or
> > anywhere in
> > > the plot. Its just a flat plot. I checked the USRP settings
> > on both
> > > and they are configured right. I even have transmit gain and
> > receive
> > > gain as 10dB on both sides.
> > >
> > > What can be wrong here?
> >
> >
> > What daughterboards are you using? What frequency are you
> > using on the
> > source/sink blocks? The BasicRX/TX should be used with >1MHz
> > signals
> > (configure the USRP source/sink center freq to 1MHz or above),
> > since the
> > transformers won't pass lower frequencies than this.
> >
> > --n
> >
> >
> > >
> > > Thanks
> > >
> > > On Mon, May 16, 2011 at 12:09 PM, Marcus D. Leech
> > 
> > > wrote:
> > > On 16/05/2011 1:03 PM, John Andrews wrote:
> > > > Shouldn't I use some kind of modulation scheme to
> > do this,
> > > > like FM or AM, to transmit a tone?
> > > No, you can just transmit a narrow, single-frequency
> > tone, and
> > > use the receivers FFT to determine how far off it is
> > from
> > >   where you expect it.
> > >
> > > use a signal-source producing a SIN wave at, let's
> > say, 1KHz,
> > > feed that into a UHD/USRPx sink tuned to whatever
> > your
> > > frequency is.
> > >   The tone will appear at TUNED-FREQUENCY+1KHz.
> > >
> > >
> > >
> > >
> > > >
> > > > On Mon, May 16, 2011 at 10:02 AM, Marcus D. Leech
> > > >  wrote:
> > > > On 16/05/2011 10:26 AM, Alexander Chemeris
> > wrote:
> > > > You may also look into this code:
> > > > http://thre.at/kalibrate/
> > > > It estimates offset of an USRP
> > with regards
> > > > to a GSM base station, but
> > > > it can be easily modified to
> > measure offset
> > > > from any clean tone, e.g.
> > > > transmitted by a second USRP.
> > > >
> > > > Keep in mind that the offset measured must
> > > > necessarily be the total offset--that is,
> > both Rx
> > > > and Tx can be "off" in frequency.
> > > >
> > > > The practical consequence should be NIL,
> > because
> > > > frequency correction should normally only
> > be done on
> > > > the Rx-side, and it should
> > > >  simply adapt to whatever it sees,
> > regardless of the
> > > > Tx and Rx components of the offset.
> > > >
> > > >
> > > >
> > ___
> > > > Discuss-gnuradio mailing list
> > > > Discuss-gnuradio@gnu.org
> > > >
> > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> > > >
> > >
> > >
> > >
> > > ___
> > > Discuss-gnuradio mailing list
> > > Discuss-gnuradio@gnu.org
> > > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> >
> >
> >
> >
>
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] How can we measure the frequency offsets between two USRPs?

2011-05-16 Thread John Andrews
I am using the 1st generation USRP with RFX2400 daughterboards each
connected to the TX/RX interface.

In the sine source block I am using a frequency of 100kHz. As the
interpolation of USRP sink is 128 I am using a sampling frequency of 1Msps.

On Mon, May 16, 2011 at 12:27 PM, Nick Foster  wrote:

> On Mon, 2011-05-16 at 12:23 -0500, John Andrews wrote:
> > I am using GRC. I used a signal source block generating a complex sine
> > at 100kHz. The USRP interpolation is 128 and the sampling rate of the
> > sine generator is 1MHz. The USRP connected to another computer has
> > USRP source configured at 64 decimation and is connected to an FFT
> > block. I don't see any peak at the expected frequency or anywhere in
> > the plot. Its just a flat plot. I checked the USRP settings on both
> > and they are configured right. I even have transmit gain and receive
> > gain as 10dB on both sides.
> >
> > What can be wrong here?
>
> What daughterboards are you using? What frequency are you using on the
> source/sink blocks? The BasicRX/TX should be used with >1MHz signals
> (configure the USRP source/sink center freq to 1MHz or above), since the
> transformers won't pass lower frequencies than this.
>
> --n
>
> >
> > Thanks
> >
> > On Mon, May 16, 2011 at 12:09 PM, Marcus D. Leech 
> > wrote:
> > On 16/05/2011 1:03 PM, John Andrews wrote:
> > > Shouldn't I use some kind of modulation scheme to do this,
> > > like FM or AM, to transmit a tone?
> > No, you can just transmit a narrow, single-frequency tone, and
> > use the receivers FFT to determine how far off it is from
> >   where you expect it.
> >
> > use a signal-source producing a SIN wave at, let's say, 1KHz,
> > feed that into a UHD/USRPx sink tuned to whatever your
> > frequency is.
> >   The tone will appear at TUNED-FREQUENCY+1KHz.
> >
> >
> >
> >
> > >
> > > On Mon, May 16, 2011 at 10:02 AM, Marcus D. Leech
> > >  wrote:
> > > On 16/05/2011 10:26 AM, Alexander Chemeris wrote:
> > > You may also look into this code:
> > > http://thre.at/kalibrate/
> > > It estimates offset of an USRP with regards
> > > to a GSM base station, but
> > > it can be easily modified to measure offset
> > > from any clean tone, e.g.
> > > transmitted by a second USRP.
> > >
> > > Keep in mind that the offset measured must
> > > necessarily be the total offset--that is, both Rx
> > > and Tx can be "off" in frequency.
> > >
> > > The practical consequence should be NIL, because
> > > frequency correction should normally only be done on
> > > the Rx-side, and it should
> > >  simply adapt to whatever it sees, regardless of the
> > > Tx and Rx components of the offset.
> > >
> > >
> > > ___
> > > Discuss-gnuradio mailing list
> > > Discuss-gnuradio@gnu.org
> > >
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> > >
> >
> >
> >
> > ___
> > Discuss-gnuradio mailing list
> > Discuss-gnuradio@gnu.org
> > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] How can we measure the frequency offsets between two USRPs?

2011-05-16 Thread John Andrews
I am using GRC. I used a signal source block generating a complex sine at
100kHz. The USRP interpolation is 128 and the sampling rate of the sine
generator is 1MHz. The USRP connected to another computer has USRP source
configured at 64 decimation and is connected to an FFT block. I don't see
any peak at the expected frequency or anywhere in the plot. Its just a flat
plot. I checked the USRP settings on both and they are configured right. I
even have transmit gain and receive gain as 10dB on both sides.

What can be wrong here?

Thanks

On Mon, May 16, 2011 at 12:09 PM, Marcus D. Leech  wrote:

>  On 16/05/2011 1:03 PM, John Andrews wrote:
>
> Shouldn't I use some kind of modulation scheme to do this, like FM or AM,
> to transmit a tone?
>
> No, you can just transmit a narrow, single-frequency tone, and use the
> receivers FFT to determine how far off it is from
>   where you expect it.
>
> use a signal-source producing a SIN wave at, let's say, 1KHz, feed that
> into a UHD/USRPx sink tuned to whatever your frequency is.
>   The tone will appear at TUNED-FREQUENCY+1KHz.
>
>
>
>
> On Mon, May 16, 2011 at 10:02 AM, Marcus D. Leech wrote:
>
>> On 16/05/2011 10:26 AM, Alexander Chemeris wrote:
>>
>>> You may also look into this code:
>>> http://thre.at/kalibrate/
>>> It estimates offset of an USRP with regards to a GSM base station, but
>>> it can be easily modified to measure offset from any clean tone, e.g.
>>> transmitted by a second USRP.
>>>
>>>  Keep in mind that the offset measured must necessarily be the total
>> offset--that is, both Rx and Tx can be "off" in frequency.
>>
>> The practical consequence should be NIL, because frequency correction
>> should normally only be done on the Rx-side, and it should
>>  simply adapt to whatever it sees, regardless of the Tx and Rx components
>> of the offset.
>>
>>
>> ___
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] How can we measure the frequency offsets between two USRPs?

2011-05-16 Thread John Andrews
Shouldn't I use some kind of modulation scheme to do this, like FM or AM, to
transmit a tone?

On Mon, May 16, 2011 at 10:02 AM, Marcus D. Leech  wrote:

> On 16/05/2011 10:26 AM, Alexander Chemeris wrote:
>
>> You may also look into this code:
>> http://thre.at/kalibrate/
>> It estimates offset of an USRP with regards to a GSM base station, but
>> it can be easily modified to measure offset from any clean tone, e.g.
>> transmitted by a second USRP.
>>
>>  Keep in mind that the offset measured must necessarily be the total
> offset--that is, both Rx and Tx can be "off" in frequency.
>
> The practical consequence should be NIL, because frequency correction
> should normally only be done on the Rx-side, and it should
>  simply adapt to whatever it sees, regardless of the Tx and Rx components
> of the offset.
>
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] How can we measure the frequency offsets between two USRPs?

2011-05-15 Thread John Andrews
How can we correctly measure what is the frequency offset between the two
USRPs?

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


[Discuss-gnuradio] Baseband GPS OTA USRP capture that anyone can share?

2011-05-09 Thread John Andrews
Hi,
Is there is anyone here who has GPS OTA capture using USRP that they are
willing to share? I don't have a USRP and I am interested in demodulating
the GPS signal.

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


Re: [Discuss-gnuradio] Help: Tracing modulation & demodulation

2011-03-27 Thread John Andrews
On Sat, Mar 26, 2011 at 12:31 AM,  wrote:

> Hello every one...
>
> i am a newbabie in gnuradio...
>
> i am trying to trace demodulation...
> currently i am reading gmsk.py...
>
> how can i go further...
>

Keep reading


>
>
> Thanks for all you in advance...
>
>
> ___
> 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] Generating complex exponential stream

2011-03-22 Thread John Andrews
On Mon, Mar 21, 2011 at 6:53 PM, Praveen Vikram wrote:

> Hi,
>
> I'am new to GNURadio. I started off writing a few signal processing blocks
> (since I'am more comfortable with C++ than Python).
>

Welcome


>
> So far, I have written a signal block for circular correlation (to get an
> idea of the entire process) and a signal source that gives off C/A Code
> samples (to be used with acquisition) and both work as expected.
>
> I'am now trying to use these block in Python and am kinda stuck.
>
> The basic signal flow I'am trying to achieve is as follows:
>
> =   =====
> | File Source   | > | Multiplier |--> | Vector Sink |
> |   |   =====
> = ^
>   |
>   |
> ==  ==
> | CA Samples |> | Multiplier | < e^{-j*2*pi*fd*t}
> ==  ==
>
>
> The CA samples block, is a source block that take the sampling frequency,
> and doppler frequency and samples the CA code, accordingly.
>
> The questions I have are,
> 1) How do i obtain the time t, to be able to generate e^{-j*2*pi*fd*t}.
>

It's a software defined radio. The notion of time is irrelevant as all you
are sending in and out of the system is samples that are produced by a
software module.

for example, if I want to generate 1000 samples of a sine wave with
frequency 1e3Hz and sampling frequency 1e6Hz, I do the following in
software.

int i;
double sine[1000];
double fc = 1000;
double fs = 100;
doubel ts = 1/fs; // <--- This is my sampling width
for(i=0;i<1000;i++) {
sine[i] = sin(2*PI*fc*ts*i);
  }

This gives me 1000 samples of 1000Hz sine wave sampled at 1MHz but what you
actually have is a bunch of numbers than represent the sine wave described
earlier. So where is the time here? The time is the product of the sample
number and the sampling width i.e.  ( i * ts ).

2) How do I make sure the multiplier is multiplying the first value from CA
> samples with the first value of e^{-j*2*pi*fd*t} and so on. Does GNURadio
> take care of this?
>

In any GNU Radio block the behaviour of the block is defined by the work
function ( see gr_block.h ). If you look a gr_multiply_cc.cc file you will
see that inside the work function the samples are multiplied synchronously.
That means that you don't have to worry about anything as GNU Radio does
what it is saying it is doing.

>
> Any help/pointers will be appreciated.
>

Whenever you have a doubt about any gnuradio block your first stop should be
the source code. It's very well written and properly documented and it saves
you time to actually do that rather than waiting for one of us on the forum
to reply to your question. Nonetheless, this forum is a great place to get
your questions answered.

>
> Thanks,
> Praveen
>
> ___
> 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] Help : i want to install gnuradio-core only and for that what are the required blocks i need to install to support the gnuradio-core.

2011-03-17 Thread John Andrews
Why don't you just install the way it is and save yourself some time? The
remaining blocks that you mentioned are not going to affect your learning at
all so instead of wasting time and having all sorts of doubts follow the
installation instructions carefully and start playing with gnuradio.

Good luck.

On Thu, Mar 17, 2011 at 2:41 AM, anil ph wrote:

> HI everyone ,
>  In my struggle towards learning the gnuradio , ii am trying to install the
> gnuradio-core only and for that i have remove some of the blocks like
> gr-noaa,gr-audio-osx etc... but i could not exactly figure out if some other
> blocks/folder like
> dtools,gcell,gr-cvsd-vocoder,gr-gcell,gr-gpio,gr-gsm-fr-vocoder and gruel
> etc to be installed ... i am in doubt that removing this  blocks/folder will
> hamper my installation.
>
> --
> Phenomenon
>  /* Life is the best phenomenon */
>
>
> ___
> 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] Passing a message from one block to other

2011-01-15 Thread John Andrews
Thanks Tom, I will definitely take a look at it and keep you informed.

Thanks,
John

On Thu, Jan 13, 2011 at 5:12 PM, Tom Rondeau  wrote:

> On Wed, Jan 12, 2011 at 2:43 PM, John Andrews  wrote:
> > Hi,
> > Suppose I have two gnuradio blocks called gr_ACQUISITION and gr_TRACKING
> > where, gr_TRACKING is dependent upon some result derived from gr_ACQ
> block.
> > Is it possible to pass certain messages to gr_TRACK in order to change
> its
> > state while the flowgraph is running? One way to do is to have an output
> > line in gr_ACQUISITION that carries this info to the block gr_TRACKING
> but
> > this doesn't seem like an attractive option to me.
> >
> > Thanks,
> > John.
>
> We have recently introduced the concept of stream tags into GNU Radio
> that might be what you want. They are not currently well-documented,
> but you can find some information in my presentations from this years
> SDR conference (specifically Tues and Weds):
> http://gnuradio.org/redmine/wiki/gnuradio/SDR2010
>
> You can also see a simple example in the code source (you'll have to
> be on the next branch in git right now):
> gnuradio-examples/python/tags
>
> I will hopefully soon find time to write more examples and document it
> better. But hopefully, the examples will be enough to show you how to
> add a tag to an output stream from one block and receive it in another
> block.
>
> If you manage to get it working, I'd be very interested to hear about
> your experiences. What you are looking to do sounds like it could be a
> perfect case study for the use of the tags that others could well
> benefit from.
>
> Tom
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Passing a message from one block to other

2011-01-12 Thread John Andrews
Hi,
Suppose I have two gnuradio blocks called gr_ACQUISITION and gr_TRACKING
where, gr_TRACKING is dependent upon some result derived from gr_ACQ block.
Is it possible to pass certain messages to gr_TRACK in order to change its
state while the flowgraph is running? One way to do is to have an output
line in gr_ACQUISITION that carries this info to the block gr_TRACKING but
this doesn't seem like an attractive option to me.

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


Re: [Discuss-gnuradio] Baseband vs. Carrier freq.

2011-01-12 Thread John Andrews
I suggest you to first look into the USRP documentation available on
gnuradio website. In it you will learn how a USRP upcoverts and downconverts
a signal. In gnuradio we always deal with baseband signals i.e. the signal
reaching your computer from the usrp or the signal entering the usrp from
the computer is always a baseband signal.

To know more about the signal that is in the air you have to find yourself a
good book on communication systems. If you are new to Signals, RF
communications etc then Communication Systems by Simon Haykin is a very good
start. To understand more about upconversion/downcoversion and other digital
signal processing then get yourself "Understanding Digital Signal
Processing" by Rick Lyons but first download the pdf of the USRP
documentation and read the first 15 pages. In that the author Firas explains
how the USRP works in a simple way.

Before, you start playing around with GRC by making your own flowgraph start
with benchmark_tx.py/benchmark_rx.py examples. These are like the "hello
world" of "digital communications using gnuradio/usrp".

There is a GRC example for bpsk in the GRC examples folder. Check that out
too.
--

John


On Wed, Jan 12, 2011 at 1:31 AM, Songsong Gee wrote:

> Thank you for your answer :)
>
> Can you tell me more detail?
>
> With my understanding, a rectangular pulse from the file source will be an
> envelope
>
> and by up-conversion, a sinusoidal signal will be in the rectangular pulse?
>
> I want to know more detail on the up-conversion,
>
> Especially, a waveform on the air.
>
>
> 2011/1/12 Nick Foster 
>
> Songsong,
>>
>> The baseband signal you are transmitting will be upconverted by the
>> center frequency you specify in the USRP sink. In this case, the
>> signal's center frequency will be 450MHz. Likewise, the USRP source
>> center frequency you specify for the receiver will convert that
>> frequency to baseband for the rest of your receive flowgraph.
>>
>> --n
>>
>> On Wed, 2011-01-12 at 15:38 +0900, Songsong Gee wrote:
>> > I'm wondering whether my flow graph is working correctly.
>> >
>> >
>> > I think that my flow graph just send a baseband signal
>> >
>> >
>> > Sender
>> > flow graph / scope plot
>> >
>> >
>> > Recevier
>> > flow graph / scope plot
>> >
>> >
>> > Yes, it receives correctly. But my question is
>> >
>> >
>> > The sender seems to send just a baseband signal, not a signal whose
>> > center freq. is not 450 MHz
>> >
>> >
>> > I think that it need to be multiplied by sinusoidal signal...
>> >
>> > --
>> > Seokseong Jeon (aka Songsong Gee)
>> >
>> >
>> > ___
>> > Discuss-gnuradio mailing list
>> > Discuss-gnuradio@gnu.org
>> > http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>>
>>
>>
>
>
> --
> Seokseong Jeon (aka Songsong Gee)
>
>
> ___
> 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] sample file

2010-12-09 Thread John Andrews
Check out this link. You will find everything you want.

http://www.ansr.org/kd7lmo/www.kd7lmo.net/ground_gnuradio_ota.html

On Wed, Dec 8, 2010 at 8:58 PM, Justin Kelly  wrote:

> Could someone be kind enough to make a DVD for me with the raw samples of
> the FM Broadcast band?
>
> The reason I'm asking for this is I currently do not have access to any of
> the USRP devices, and would like to test an idea I have.
>
> Thank you in Advance,
>
> Justin N2TOH
>
> ___
> 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] how to see the captured dat file in octave or any other software

2010-12-06 Thread John Andrews
Abhijeet,

If you just want to read the contents of the files then you can read them
using the scripts provided in */gnuradio/gnuradio-core/src/utils/.

read_char_binary, read_complex_binary etc will suffice most of your needs. I
normally addpath('/opt/gnuradio/gnuradio-core/src/utils') in MATLAB and play
around with the collected raw data.

Hope this helps.

On Mon, Dec 6, 2010 at 6:11 PM, Thomas Hobiger  wrote:

>  Hi,
>
> Getting the data into Octave is quite easy
>
> fid=fopen('file.dat');
> readsize=1000; % e.g. if you want to read 1000 samples
> ir=1:2:2*readsize-1;
> ii=2:2:2*readsize;
> [val, count] = fread (fid, readsize*2, 'float'); % times 2 for reading I/Q
> data
> s=complex(val(ir),-val(ii));  % put the data into a complex vector
> %
> % ... some processing here
> %
> fclose(fid);
>
>
> Regards,
>   Thomas
>
>
> On 12/07/2010 01:17 AM, abhijeet mate wrote:
>
>   Hi,
>
>  I am new to gnu radio and I have a dat file (complex or float) captured
> from file sink which was directly connected USRP.
> Can anyone help me with how to see the dat file in octave or any other
> similar software. Is there any other method to see the content of dat file
> as i need that data for processing.
>
>  Thanks and Regards,
> Abhijeet.
>
>
>
>
> ___
> Discuss-gnuradio mailing list
> discuss-gnura...@gnu.orghttp://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
>
> --
> **
> Dr. Thomas Hobiger
> Space-Time Measurement Project
> Space-Time Standards Group
> New Generation Network Research Center
> National Institute of Information and Communications Technology
> --
> 4-2-1 Nukui-Kitamachi, Koganei
> 184-8795 Tokyo
> Japan
> --
> email:  hobi...@nict.go.jp
> phone:  ++81-042-327-7561
> fax:++81-042-327-6664
> --
> homepage (priv.): http://www.hobiger.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


Re: [Discuss-gnuradio] Arbitrary resampler

2010-12-06 Thread John Andrews
That was a very helpful post Tom.

Thank you very much.

On Mon, Dec 6, 2010 at 2:02 PM, Tom Rondeau  wrote:

> I just made a new post about the PFB arbitrary resampler. I just
> pushed to git:master a feature where you can just specify the
> resampling rate and not worry about designing your own taps (though
> you still can if you need to and know how). Details here:
>
>
> http://gnuradio.squarespace.com/home/2010/12/6/new-interface-for-pfb_arb_resampler_ccf.html
>
> Tom
>
> ___
> 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] usrp_fft.py question and benchmark related question

2010-12-02 Thread John Andrews
Got it. Saw the earlier message too.

Thanks

On Thu, Dec 2, 2010 at 12:12 PM, John Andrews  wrote:

>
>
> On Wed, Dec 1, 2010 at 5:14 PM, Eric Blossom  wrote:
>
>> On Wed, Dec 01, 2010 at 04:57:11PM -0600, John Andrews wrote:
>> > Hi,
>> > Can we change the DDC value to 0 in usrp_fft.py? Why is this not 0 as
>> one
>> > would expect to input the center frequency same as the baseband
>> frequency;
>> > i.e. if I know that my signal is on a carrier at 2.4G then I would use
>> > usrp_fft.py to display the spectrum by having the center frequency as
>> 2.4G
>> > instead of typing in 2.404G (as DDC is -4M).
>>
>> It's non-zero to move the RF DC offset problem away from zero (and in
>> most cases out of the range that anybody cares about).  See earlier
>> message today...
>>
>
> Thanks for your reply Eric but can you please explain what it means or
> direct me to a place  where I can find out? That will be very helpful of
> you. I looked at the messages but I didn't not find which one you were
> referring to.
>
> Thanks
>
>>
>> > In benchmark_tx/rx programs do I have to account for this DDC=-4.0M? If
>> one
>> > USRP is transmitting at 2.4G ( ./benchmark_tx.py -f 2400M ) then should
>> I
>> > have the receiving USRP receiving at 2.404G ( ./benchmark_rx.py -f 2404M
>> )?
>>
>> No you don't.  If you do -f 2400M then the complex baseband signal is
>> equivalent to the RF signal that's centered at 2400M.
>>
>> Eric
>>
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] costas_loop_cc ()

2010-12-02 Thread John Andrews
Of course its the same file. If you are making any changes in the C++ file
then you must compile it before you can see those changes. Did you do "make"
and "make install" after your changes?

On Thu, Dec 2, 2010 at 10:45 PM, Guanbo Zheng  wrote:

> Hi,
>
> I found that for CFO compensation, there is the module named
> "costas_loop_cc ()"
> Use it in this way:   gr.costas_loop_cc(alpha, beta, max_freq, min_freq,
> order)
>
> where I can find this C++ file?  I search the files, only found one
> "gr_costas_loop_cc.cc" in ~/gnuradio-3.2.2/gnuradio-core/src/lib/general
> But It seems like this C++ function is not the one they use. As I tried to
> print out some variable, but no observations.
>
> Sorry to disturb you guys! :(
>
> --
> Regards,
> Guanbo
>
> ___
> 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] usrp_fft.py question and benchmark related question

2010-12-02 Thread John Andrews
On Wed, Dec 1, 2010 at 5:14 PM, Eric Blossom  wrote:

> On Wed, Dec 01, 2010 at 04:57:11PM -0600, John Andrews wrote:
> > Hi,
> > Can we change the DDC value to 0 in usrp_fft.py? Why is this not 0 as one
> > would expect to input the center frequency same as the baseband
> frequency;
> > i.e. if I know that my signal is on a carrier at 2.4G then I would use
> > usrp_fft.py to display the spectrum by having the center frequency as
> 2.4G
> > instead of typing in 2.404G (as DDC is -4M).
>
> It's non-zero to move the RF DC offset problem away from zero (and in
> most cases out of the range that anybody cares about).  See earlier
> message today...
>

Thanks for your reply Eric but can you please explain what it means or
direct me to a place  where I can find out? That will be very helpful of
you. I looked at the messages but I didn't not find which one you were
referring to.

Thanks

>
> > In benchmark_tx/rx programs do I have to account for this DDC=-4.0M? If
> one
> > USRP is transmitting at 2.4G ( ./benchmark_tx.py -f 2400M ) then should I
> > have the receiving USRP receiving at 2.404G ( ./benchmark_rx.py -f 2404M
> )?
>
> No you don't.  If you do -f 2400M then the complex baseband signal is
> equivalent to the RF signal that's centered at 2400M.
>
> Eric
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] usrp_fft.py question and benchmark related question

2010-12-01 Thread John Andrews
Hi,
Can we change the DDC value to 0 in usrp_fft.py? Why is this not 0 as one
would expect to input the center frequency same as the baseband frequency;
i.e. if I know that my signal is on a carrier at 2.4G then I would use
usrp_fft.py to display the spectrum by having the center frequency as 2.4G
instead of typing in 2.404G (as DDC is -4M).

In benchmark_tx/rx programs do I have to account for this DDC=-4.0M? If one
USRP is transmitting at 2.4G ( ./benchmark_tx.py -f 2400M ) then should I
have the receiving USRP receiving at 2.404G ( ./benchmark_rx.py -f 2404M )?

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


[Discuss-gnuradio] Re: gr_pfb_clock_sync_ccf.cc question related to work function

2010-11-25 Thread John Andrews
Thanks for replying Tom. Happy Thanksgiving to you.

Although I understand the idea behind this time sync method I still
have a question regarding your code. You increment the count variable
by samples per symbol value. The error control loop works at one
sample per symbol and updates the pointer to the correct subfilter.

By updating the count variable by d_sps aren't we losing information
as we are dropping d_sps - 1 samples on every iteration of for-loop in
work function.

Thanks

On Tuesday, November 23, 2010, Tom Rondeau  wrote:
> On Mon, Nov 22, 2010 at 6:01 AM, John Andrews  wrote:
>> I got it. The polyphase filter is implemented by having a single stage
>> filter and choosing the right taps from the set of 'nfilts' taps rather than
>> having nfilts filter stages. This of course is computationally more
>> efficient.
>
>
> Hi John,
> Thanks for the question. And the answer. You had me worried for a
> second that I had missed something in the implementation. I was pretty
> sure I had this correct when fred and I were talking about all of this
> stuff last summer.
>
> As you've surmised, the implementation pretty much follows figure
> 13.21 in fred's book. Although he was looking at it being designed in
> an FPGA where he had to load the registers with the coefficients;
> instead, I just keep the bank of filter coefficients, each with their
> own symbol phase, and select the path into the bank based on the error
> estimate. So we select the appropriate filter path to go through and
> run that one stage.
>
> It's a "neat trick" as fred likes to say.
>
> And yes, literalnet, I understand that we're still actually loading
> the coefficients into registers. I'm only talking about how the C++
> code was implemented conceptually as opposed to an FPGA design.
>
> Tom
>
>
>
>> On Sat, Nov 20, 2010 at 9:47 PM, John Andrews  wrote:
>>>
>>> Hi,
>>> I was trying to understand the code of the new clock sync block
>>> gr_pfb_clock_sync_ccf.cc and although I understand most of it there is one
>>> particular thing that confuses me. This is what I understood so far
>>>
>>> 1. There are two filter banks present. A) For RRC filtering B) the
>>> differential filter bank
>>> 2. These filters are implemented as polyphase filters thus, each of these
>>> filters has nfilts=32 sub-filters
>>> 3. The theory behind this block is found in section 13.3.2 of fred harris'
>>> book on multi-rate filters so I understand the concept behind this block
>>> pretty well.
>>>
>>> What confuses me is the coding.
>>> In line 265 of gr_pfb_clock_sync_ccf.cc
>>>
>>> out[i] = d_filters[d_filtnum]->filter(&in[count]);
>>>
>>> the input to the block is passed only to one sub-filter of each filter
>>> bank. Why? Looking at the section in harris' book i thought it was an input
>>> to all the sub-filters and we choose one of the outputs as the sync'd
>>> sample.
>>>
>>> Thanks
>>
>>
>> ___
>> 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] Re: gr_pfb_clock_sync_ccf.cc question related to work function

2010-11-22 Thread John Andrews
I got it. The polyphase filter is implemented by having a single stage
filter and choosing the right taps from the set of 'nfilts' taps rather than
having nfilts filter stages. This of course is computationally more
efficient.

On Sat, Nov 20, 2010 at 9:47 PM, John Andrews  wrote:

> Hi,
> I was trying to understand the code of the new clock sync block
> gr_pfb_clock_sync_ccf.cc and although I understand most of it there is one
> particular thing that confuses me. This is what I understood so far
>
> 1. There are two filter banks present. A) For RRC filtering B) the
> differential filter bank
> 2. These filters are implemented as polyphase filters thus, each of these
> filters has nfilts=32 sub-filters
> 3. The theory behind this block is found in section 13.3.2 of fred harris'
> book on multi-rate filters so I understand the concept behind this block
> pretty well.
>
> What confuses me is the coding.
> In line 265 of gr_pfb_clock_sync_ccf.cc
>
> out[i] = d_filters[d_filtnum]->filter(&in[count]);
>
> the input to the block is passed only to one sub-filter of each filter
> bank. Why? Looking at the section in harris' book i thought it was an input
> to all the sub-filters and we choose one of the outputs as the sync'd
> sample.
>
> Thanks
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] gr_pfb_clock_sync_ccf.cc question related to work function

2010-11-20 Thread John Andrews
Hi,
I was trying to understand the code of the new clock sync block
gr_pfb_clock_sync_ccf.cc and although I understand most of it there is one
particular thing that confuses me. This is what I understood so far

1. There are two filter banks present. A) For RRC filtering B) the
differential filter bank
2. These filters are implemented as polyphase filters thus, each of these
filters has nfilts=32 sub-filters
3. The theory behind this block is found in section 13.3.2 of fred harris'
book on multi-rate filters so I understand the concept behind this block
pretty well.

What confuses me is the coding.
In line 265 of gr_pfb_clock_sync_ccf.cc

out[i] = d_filters[d_filtnum]->filter(&in[count]);

the input to the block is passed only to one sub-filter of each filter bank.
Why? Looking at the section in harris' book i thought it was an input to all
the sub-filters and we choose one of the outputs as the sync'd sample.

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


[Discuss-gnuradio] Help - Custom block generating data @ 1:5115 input to output ratio causes flowgraph to hang -- how to prevent this

2010-11-17 Thread John Andrews
Hi,
I am posting this question again with better explanation as I got no help
yet.

I have a custom C++ block that I use in the modified dbpsk.py modulation
scheme. This block basically spreads each input data bit by 1023.

The flowgraph connect looks like this
self.connect(self,self.bytes2chunks,self.symbol_mapper,self.diffenc,self.CUSTOM_BLOCK,self.chunks2symbols,self.rrc_filter,self)

The CUSTOM_BLOCK outputs 5115 bytes for every input byte read therefore, in
the flowgraph the input rate at self.chunks2symbols is 5115 times to that of
input at self.CUSTOM_BLOCK. This causes the flowgraph to slow down
incredibly to such an extent that I have to force kill it. I am using
benchmark_tx.py to pass data to the flowgraph.

I implemented the custom block in 2 different ways once by inheriting
gr_block and the other by using gr_sync_interpolator but the result is still
the same. What should I do to make it work smoothly?

Thanks

P.S - The work function is shown below when using gr_sync_interpolator.

 dsss_sync_spread_b::work(int noutput_items,gr_vector_const_void_star
&input_items,gr_vector_void_star &output_items)
{
  const unsigned char *in = (const unsigned char *)input_items[0];
  unsigned char *out = (unsigned char *)output_items[0];
  int data_items=noutput_items/interpolation(); // interploation() returns
(d_length_PN * d_n_pn which is equal to 1023 * 5)
  int nout=0;
  for(int i=0;i___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Re: Flowgraph slows down and hangs when using benchmark_tx with a custom block

2010-11-15 Thread John Andrews
An update on this block. I am now using a gr_sync_interpolator to build the
block but the performance is still the same. The flowgraph slows down and
hangs. I have to force stop it using the 'kill' command on the linux
terminal.

What should I do so that the flowgraph works smoothly like benchmark_tx.py
normally does with the other modulation schemes?

Thanks

On Mon, Nov 15, 2010 at 12:17 PM, John Andrews  wrote:

> This is what I am doing in general_work
>
> 1. I read an item from the input stream.
> 2. Check if its 0x01 or 0x00.
> 3. If its 0x01 I output the contents of d_pn_array[0], d_n_pn times.
> (Basically I am spreading the input data by the ( pn_length * d_n_pn times
> ))
> 4. But if its 0x00 I output the contents of d_pn_array[1], d_n_pn times.
> (Basically I am spreading the input data by the ( pn_length * d_n_pn times
> ))
>
> The arrays d_pn_array[0] and d_pn_array[1] were initialised in the
> constructor.
>
> I only read the contents of the arrays and set the values to out[i]. This
> shouldn't take such a long time although I must say that the lengths of the
> arrays d_pn_array are 1023 and d_n_pn is 5 i.e. I output 1023*5 = 5115 items
> for each input item.
>
>
> int
> dsss_spreading_b::general_work(int noutput_items,gr_vector_int
> &ninput_items,gr_vector_const_void_star &input_items,gr_vector_void_star
> &output_items)
> {
>   const unsigned char *in = (const unsigned char *)input_items[0];
>   unsigned char *out = (unsigned char *)output_items[0];
>   int data_items=noutput_items/(d_length_PN*d_n_pn);
>   int nout=0;
>   for(int i=0;i   if(in[i]&0x01){
>   for(int j=0;j   out[nout]=d_pn_array1[j%d_length_PN];
>   nout++;
>   }
>   }
>   else{
>   for(int j=0;j   out[nout]=d_pn_array0[j%d_length_PN];
>   nout++;
>   }
>   }
>   }
>
>    consume(0,data_items);
>return noutput_items;
>
> }
>
> On Mon, Nov 15, 2010 at 12:00 PM, Tom Rondeau wrote:
>
>> On Mon, Nov 15, 2010 at 11:43 AM, John Andrews 
>> wrote:
>> > On another  note I use 'gr_block' to build this custom block
>> >
>> > On Mon, Nov 15, 2010 at 11:37 AM, John Andrews 
>> wrote:
>> >>
>> >> Hi,
>> >> I have a modified dbpsk.py in which I use a custom block after the
>> >> self.diffenc (differential encoder block). This custom C++ block
>> outputs
>> >> 1000 output_items of size 'gr_sizeof_char' for each input_item of size
>> >> 'gr_sizeof_char'. I then use benchmark_tx.py to test the functioning of
>> the
>> >> modified dbpsk.py and upon doing so the flowgraph slows down
>> incredibly.
>> >> What can I do to speed up the process?
>> >>
>> >> DiffEnc --> Custom Block --> Chunks2Symbols
>> >> ( n ouputs) --> (n * 1000 outputs) --> (n *1000 outputs)
>> >>
>> >> Thanks
>>
>> You're really going to have to provide a lot more information about
>> the block you've created. Posting the general_work function would be
>> useful.
>>
>> Tom
>>
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Re: Flowgraph slows down and hangs when using benchmark_tx with a custom block

2010-11-15 Thread John Andrews
This is what I am doing in general_work

1. I read an item from the input stream.
2. Check if its 0x01 or 0x00.
3. If its 0x01 I output the contents of d_pn_array[0], d_n_pn times.
(Basically I am spreading the input data by the ( pn_length * d_n_pn times
))
4. But if its 0x00 I output the contents of d_pn_array[1], d_n_pn times.
(Basically I am spreading the input data by the ( pn_length * d_n_pn times
))

The arrays d_pn_array[0] and d_pn_array[1] were initialised in the
constructor.

I only read the contents of the arrays and set the values to out[i]. This
shouldn't take such a long time although I must say that the lengths of the
arrays d_pn_array are 1023 and d_n_pn is 5 i.e. I output 1023*5 = 5115 items
for each input item.


int
dsss_spreading_b::general_work(int noutput_items,gr_vector_int
&ninput_items,gr_vector_const_void_star &input_items,gr_vector_void_star
&output_items)
{
  const unsigned char *in = (const unsigned char *)input_items[0];
  unsigned char *out = (unsigned char *)output_items[0];
  int data_items=noutput_items/(d_length_PN*d_n_pn);
  int nout=0;
  for(int i=0;iwrote:

> On Mon, Nov 15, 2010 at 11:43 AM, John Andrews  wrote:
> > On another  note I use 'gr_block' to build this custom block
> >
> > On Mon, Nov 15, 2010 at 11:37 AM, John Andrews 
> wrote:
> >>
> >> Hi,
> >> I have a modified dbpsk.py in which I use a custom block after the
> >> self.diffenc (differential encoder block). This custom C++ block outputs
> >> 1000 output_items of size 'gr_sizeof_char' for each input_item of size
> >> 'gr_sizeof_char'. I then use benchmark_tx.py to test the functioning of
> the
> >> modified dbpsk.py and upon doing so the flowgraph slows down incredibly.
> >> What can I do to speed up the process?
> >>
> >> DiffEnc --> Custom Block --> Chunks2Symbols
> >> ( n ouputs) --> (n * 1000 outputs) --> (n *1000 outputs)
> >>
> >> Thanks
>
> You're really going to have to provide a lot more information about
> the block you've created. Posting the general_work function would be
> useful.
>
> Tom
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Re: Flowgraph slows down and hangs when using benchmark_tx with a custom block

2010-11-15 Thread John Andrews
On another  note I use 'gr_block' to build this custom block

On Mon, Nov 15, 2010 at 11:37 AM, John Andrews  wrote:

> Hi,
> I have a modified dbpsk.py in which I use a custom block after the
> self.diffenc (differential encoder block). This custom C++ block outputs
> 1000 output_items of size 'gr_sizeof_char' for each input_item of size
> 'gr_sizeof_char'. I then use benchmark_tx.py to test the functioning of the
> modified dbpsk.py and upon doing so the flowgraph slows down incredibly.
> What can I do to speed up the process?
>
> DiffEnc --> Custom Block --> Chunks2Symbols
> ( n ouputs) --> (n * 1000 outputs) --> (n *1000 outputs)
>
> Thanks
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Flowgraph slows down and hangs when using benchmark_tx with a custom block

2010-11-15 Thread John Andrews
Hi,
I have a modified dbpsk.py in which I use a custom block after the
self.diffenc (differential encoder block). This custom C++ block outputs
1000 output_items of size 'gr_sizeof_char' for each input_item of size
'gr_sizeof_char'. I then use benchmark_tx.py to test the functioning of the
modified dbpsk.py and upon doing so the flowgraph slows down incredibly.
What can I do to speed up the process?

DiffEnc --> Custom Block --> Chunks2Symbols
( n ouputs) --> (n * 1000 outputs) --> (n *1000 outputs)

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


[Discuss-gnuradio] new modulation schemes do not work on my usrps while the old ones work

2010-11-14 Thread John Andrews
hi,
I have the latest gnuradio installed on my Ubuntu 10.04 computers and two
USRPs with RFX-2400 cards. I tested the benchmark_tx.py/benchmark_rx.py and
benchmark_tx2.py/benchmark_rx2.py with dbpsk and dbpsk2 modulation schemes
but only the old schemes work.

1. With old schemes both usrps transmit and receive when tested in both
tx/rx modes.
2. With the new scheme one of the receive computer displays 'false ' for
almost all the packets received. I didn't see any successfully received
packets.
3. One of the USRPs in the receive mode doesn't even acknowledge a
transmission and hence the benchmark_rx2.py script doesn't print any thing
on stdout.

What changes in parameters should I try in order for them to work?

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


[Discuss-gnuradio] Question about new modulation schemes dbpsk2

2010-11-11 Thread John Andrews
Hi,
The rrc filter parameters in the new modulation scheme in dbpsk2 confuses
me. Why is the symbol rate in dbpsk2 equal to "
1.0/float(self._samples_per_symbol) " whereas, in dbpsk it was 1.0?

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


[Discuss-gnuradio] Weird error in gnuradio block related to gr.file_source

2010-11-03 Thread John Andrews
Hi,
I am confused with the error that I am having in my block.

I have two files that I use for testing the gnuradio block that I am
developing. The input (type gr_complex) to the block is a gr.file_source and
I use 4092 input_items that I store in a buffer to work in the general_work
function. In order to make sure that I was reading the files correctly and
storing the input items in the buffer properly I did a file write operation
using (fopen, fwrite) and write the input read in the block into a binary
file. Later I compare the input file and the newly written file expecting
them to be the same. Strangely, when I use the first test file I have no
problem but when using the second test file the later half of the data is
not the same. Half of the data in the newly written file doesn't match the
data in the input file used.

I am utterly confused. Can someone help me out here?

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


[Discuss-gnuradio] Re: Lots of mallocs in my gnuradio block ... is it safe?

2010-10-17 Thread John Andrews
haha! I just realized that this is a great deal of memory used. 250*2046*4.

I am so dumb. :)

I guess I will have to calculate this on each iteration i use that data.



On Sun, Oct 17, 2010 at 9:08 PM, John Andrews  wrote:

> Hi,
> I am writing the code for a gnuradio block and I use a lot of dynamic
> memory allocation. The code isn't finished yet but I thought I would ask
> this question anyways. For an idea this is how the mallocs look like.
>
> 1. (204 + 5 + 204) gr_complex arrays of size 2046 each
> 2. 1 double array of size 2046
>
> The reason why I have this is most of the data allocated in these arrays is
> reused and I don't have to calculate it again and again. i thought having
> this data ready when the block is initialized will speed up the processing.
>
> Being pessimistic programmer I am circumspect about my method. What are
> your thoughts?
>
> Thanks,
> John
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Lots of mallocs in my gnuradio block ... is it safe?

2010-10-17 Thread John Andrews
Hi,
I am writing the code for a gnuradio block and I use a lot of dynamic memory
allocation. The code isn't finished yet but I thought I would ask this
question anyways. For an idea this is how the mallocs look like.

1. (204 + 5 + 204) gr_complex arrays of size 2046 each
2. 1 double array of size 2046

The reason why I have this is most of the data allocated in these arrays is
reused and I don't have to calculate it again and again. i thought having
this data ready when the block is initialized will speed up the processing.

Being pessimistic programmer I am circumspect about my method. What are your
thoughts?

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


[Discuss-gnuradio] Mux setting question - 0xF0F0F0F0

2010-10-11 Thread John Andrews
Hi,
What does a mux setting of 0xf0f0f0f0 do? Does it convert the data coming
from ADC0 to a complex downcoverted signal which can be obtained at DDC0. I
want to know if the I and Q channel both have the inphase and quadrature
part or is it just that the I is the digitized data from ADC0 and the Q is
just zeros.

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


Re: [Discuss-gnuradio] Optimal way of performing multiple FFTs on a stream of data

2010-09-30 Thread John Andrews
Thanks Eric. My FFTs are not that big so I guess I will be fine.

On Wed, Sep 29, 2010 at 4:59 PM, Eric Blossom  wrote:

> On Wed, Sep 29, 2010 at 01:47:22PM -0700, John Andrews wrote:
> > Hi,
> > This is more of a programming question than a gnuradio question.
> >
> > I am writing a C++ block that takes in a stream of complex data, an N
> > element block {B} is chosen from the stream, this block is multiplied
> with a
> > set {M1, M2, M3...Mn} where size of each set element is N (same as data
> > block) too. I want to find FFT using FFTW library on each of the products
> > {B.M1, B.M2,  B.Mn} in the general_work() function. As this can be an
> > intensive task can someone suggest me what could be the optimal strategy
> to
> > do without compromising efficiency and risk losing samples that is
> entering
> > the machine from the USRP. I was thinking about multithreading. Do you
> think
> > this is the way to go?
> >
> > Thanks,
> > John
>
> I'd measure first, and see if you've really got a problem.
> (Premature optimization is the root of all evil.)
>
> Note also that GNU Radio itself is multithreaded, and if you're doing
> substantial work in other blocks, your cores may already being put to
> productive work.
>
> Make sure that the version of FFTW you're using was built with SSE
> support enabled.
>
>  http://fftw.org/fftw3_doc/Installation-on-Unix.html
>
>  ./configure --enable-sse --enable-float
>
> Measure again :-)
>
>
> If you do have a problem, and your cores are not already 100%
> utilized, then you may want to look at using the FFTW's suport for
> multithreading (inside of the package).  Note that it will only make
> sense if you use one of the advanced interfaces that allows you to ask
> it to compute multiple FFT's in one call to the API.  The standard
> interface won't help, unless your FFTs are seriously big -- say, > 1M
> points.
>
> http://fftw.org/fftw3_doc/Multi_002dthreaded-FFTW.html
> http://fftw.org/fftw3_doc/Advanced-Complex-DFTs.html
>
> Eric
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Same File Size

2010-09-29 Thread John Andrews
If throttle is removed then how can we prevent the cpu being used up if
there is not rate limiting block in the flowgraph ?

On Wed, Sep 29, 2010 at 1:46 PM, Justin Bracken  wrote:

> -- Forwarded message --
> From: Justin Bracken 
> Date: Wednesday, September 29, 2010
> Subject: Same File Size
> To: Eric Blossom 
>
>
> Are the samples in the files synced? I.e. The sample at index 1 in
> file1 is recorded at the same time as the sample at index 1 in file2?
>
> In which case file length is irrelevant.
>
> On Sep 29, 2010, at 4:20 PM, Eric Blossom  wrote:
>
> > On Wed, Sep 29, 2010 at 04:14:18PM -0400, Justin Bracken wrote:
> >> Hello All,
> >>
> >> I am expecting to see a similiar file size in a simple test file that im
> >> running and I don't get that. Is there something Im missing?
> >>
> >> USRP2->FileSink
> >> SignalSource->Throttle->FileSink
> >>
> >> I have checked obvious things. The USRP2 block is set to a decimation of
> >> 400. Given the 100MS/s rate of the USRP2 I expect the stream to be 250e3
> >> MS/s. So I set the overall sample rate to 250e3. I have also set the
> >> datatypes of all the blocks to floats. The Throttle is set to 250e3.
> >>
> >> If it matters the  signal source is set to a saw tooth,1Hz.
> >>
> >> Im more interested in knowing that samples read back out of the files
> are
> >> synchronized. So I guess it doesn't matter if they are the same length
> if
> >> all this mean is that I need to trim the files to the same length.
> >>
> >> Thanks,
> >> Justin
> >
> > If you want a particular number of samples in a file, etc.,
> > use gr.head.
> >
> > Generally you SHOULD NOT be using throttle.
> >
> > throttle causes so much confusion, I'm of the opinion that we should
> > remove it from the code base.
> >
> > Eric
>
> ___
> 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] Optimal way of performing multiple FFTs on a stream of data

2010-09-29 Thread John Andrews
Hi,
This is more of a programming question than a gnuradio question.

I am writing a C++ block that takes in a stream of complex data, an N
element block {B} is chosen from the stream, this block is multiplied with a
set {M1, M2, M3...Mn} where size of each set element is N (same as data
block) too. I want to find FFT using FFTW library on each of the products
{B.M1, B.M2,  B.Mn} in the general_work() function. As this can be an
intensive task can someone suggest me what could be the optimal strategy to
do without compromising efficiency and risk losing samples that is entering
the machine from the USRP. I was thinking about multithreading. Do you think
this is the way to go?

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


[Discuss-gnuradio] please help - i am stuck - spreading data and bpsk

2010-09-11 Thread John Andrews
hi,
Can someone please tell me how to do this?

I want to generate DSSS with BPSK modulation in gnuradio but I have a few
doubts that couldn't be cleared even after a lot of looking for an answer.

The DSSS transmitter block diagram from various books shows that i have to
XOR the input data with the PN sequence to spread and then BPSK modulate. My
doubt is

1. I did the same and then BPSK modulated using the gnuradio DBPSK
modulation without the diff encoder block but I am having trouble in
acquisition at the receiver. I am using the method described in the book
"Fundamentals of Global Positioning System Receivers" by Tsui. Maybe I am
doing something fundamentally wrong at the transmitter.

2. Someone on this list suggested BPSKmod-> RRCFilter ->SPREADING. If
samples per symbol were 1 then I can just multiply the symbol with the PN
sequence but as it is always greater than 1 I cannot figure out how I can
spread. Can someone please help me here?

3. Is it possible to remove the RRC filter completely and instead use (1+0j)
and (-1+0j) symbols to modulate the carrier and still get good results at
the receiver? If it is possible then life would be easier as I don't have to
worry about the problem mentioned above in 2.

3. If anyone can share the transmitter block diagram of a GPS transmitter
then I think it can be of great help as it has a DSSS modulation scheme. All
i found on the internet was block diagrams but my concern is about pulse
shaping and none of these diagrams show nothing about that.

I did put in an effort to find answers by myself for a long time but as I
couldn't find an answer I am writing for a little guidance.

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


[Discuss-gnuradio] Cross correlation of complex signals in gnuradio

2010-09-06 Thread John Andrews
hi,
I want to cross-correlate two complex signals in gnuradio. is there a block
to do that?

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


Re: [Discuss-gnuradio] complex multiplication question

2010-08-05 Thread John Andrews
Hi Bob,
Thanks for your reply. I am trying to lock the system show in the figure
found on this link.
http://img19.imageshack.us/img19/826/dsssrxr.jpg

If S(n) = RxD signal which is modulated by a PN Sequence
1st step --> The input to Carrier Loop = S(n)*P(n), which the product of the
RxD signal and the PN Sequence assuming P(n) matches in phase.
2nd step --> The carrier tracked poptr(n) is the multiplied with RxD signal
S(n) to remove the carrier from it.
i.e. Input to Code Loop = S(n) * complex_conjugate(poptr(n))

Is this how you see the system?

Thanks
John

On Wed, Aug 4, 2010 at 3:07 AM, Bob McGwier  wrote:

> The SECOND ORDER Costas loop produces foptr(n) and poptr(n) which is the
> frequency and phase estimate for the carrier.
>
> sin(poptr(n)) is the estimated carrier.
>
> If S(n)*sin(poptr(n) is the spreading code modulating the estimated
> carrier,  then
>
> S(n)*P(n) * complex_conjugate(S(n)*sin(poptr(n)) should be approximately
> P(n) up to error in
>
>
> a) your estimate of the carrier
>
> BUT ALSO
>
> b) the clock of the transmit system and its initial phase offset for the
> complex spreading code MUST ALSO be estimated to close this system and
> track.  My little equation above ASSUMES perfect knowledge of S(n) which is
> NEVER the case in a real system.
>
> Bob
>
>
>
>
>
>
> On 8/3/2010 9:45 PM, John Andrews wrote:
>
>> Hi,
>> can someone guide me a little here please. I have a complex signal S(n)
>> that I multiply with a sequence P(n) of length N (the sequence consists
>> of {-1,1} ). I pass the product into a Costas Loop to track the carrier.
>> Btw, the complex_input signal a spread signal spread using the sequence
>> P(n) and BPSK modulated.
>>
>> S(n)*P(n) ---> Costas Loop
>>
>> Then I want to remove the carrier from the original signal which can be
>> done by multiplying the frequency output of the costas loop which is
>> foptr[i] with S(n). Is that right? I want to do this in GRC. Can someone
>> guide me a little here and tell me if I am understanding it right.
>>
>> Will be eagerly waiting for a reply. I am not good at Communications
>> stuff as this is not my major but I am trying hard. :) A little help
>> will greatly appreciated.
>>
>> Thanks
>> John
>>
>>
>>
>> ___
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>
>
> --
> (Co)Author: DttSP, Quiktrak, PowerSDR, GnuRadio
> Member: ARRL, AMSAT, AMSAT-DL, TAPR, Packrats,
> NJQRP, QRP ARCI, QCWA, FRC.
> “Be yourself, because the people who mind don't
>  matter. And the people that matter don't mind."
> -Dr. Seuss
> Active: Facebook,Twitter,LinkedIn
>
>
> ___
> 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] complex multiplication question

2010-08-03 Thread John Andrews
Hi,
can someone guide me a little here please. I have a complex signal S(n) that
I multiply with a sequence P(n) of length N (the sequence consists of {-1,1}
). I pass the product into a Costas Loop to track the carrier. Btw, the
complex_input signal a spread signal spread using the sequence P(n) and BPSK
modulated.

S(n)*P(n) ---> Costas Loop

Then I want to remove the carrier from the original signal which can be done
by multiplying the frequency output of the costas loop which is foptr[i]
with S(n). Is that right? I want to do this in GRC. Can someone guide me a
little here and tell me if I am understanding it right.

Will be eagerly waiting for a reply. I am not good at Communications stuff
as this is not my major but I am trying hard. :) A little help will greatly
appreciated.

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


Re: [Discuss-gnuradio] How do the Scheduler and the flowgraph work?

2010-07-15 Thread John Andrews
This loop does all your work. Without it your block is useless. :)

To know how the scheduler chooses the value of items that are passed into
the work() function I suggest you look into scheduler's code. It's a fairly
easy to understand C++ code and most of your answers will be answered.

According to my knowledge the work() function always returns the number of
items consumed by your block each time the work() function is called. When
you return from work() you are basically informing the scheduler how many
items were consumed so that the scheduler doesn't discard the unused input
data. Believe me I once did the same mistake of not returning and had a
troubling time knowing why my block wasn't working as it was supposed to be.

On Thu, Jul 15, 2010 at 3:02 AM, Sammour  wrote:

>
> I have a basic question regarding GNURadio scheduler and how the flowgraph
> works. I am using gr_sync_block but my question are valid for gr_block
>
> From the online tutorial about how to write a block I read:
>
>  87for (int i = 0; i < noutput_items; i++){
>  88  out[i] = in[i] * in[i];
>  89}
>
> I could print noutput_items and it is a huge number in order of thousands.
> So my question is why should I create this loop? and how does it work? I
> have read somewhere in this discution board that not using this loop will
> increase the calclation overhead but no clue why. Does my block outputs the
> items "bunch by bunch" or item by item.
>
> Another question here: I saw few programs which dont return noutput_items
> from work or general_work so it seems that I dont have to always return it.
> How can I determine the value I shoud return.
>
> Cheers,
>
> Sam
> --
> View this message in context:
> http://old.nabble.com/How-do-the-Scheduler-and-the-flowgraph-work--tp29171158p29171158.html
> Sent from the GnuRadio mailing list archive at Nabble.com.
>
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Transmit signal power - How to find from the amplitude set in transmit_path?

2010-07-15 Thread John Andrews
you are right but I don't neither do i have an scope nor a power meter. Any
other suggestion?

On Sat, Jul 10, 2010 at 6:01 PM, Brian Padalino  wrote:

> On Sat, Jul 10, 2010 at 8:32 PM, John Andrews  wrote:
> > Hi,
> > I want to calculate the power of the signal(in dBm) transmitted in
> > benchmark_tx.py. The transmit_path sets an amplitude in the range [0,1]
> but
> > how will I convert this into the actual power. I just want to know where
> > should I be looking in order to calculate it myself.
>
> If I were in your situation, I'd calibrate myself with the hardware
> under test by first sending out just a carrier and measuring the power
> of the carrier on the frequency you wish to test.  Use a meter or
> scope to do this part.
>
> Then calculate the peak-to-average power ratio of your modulation to
> know how much of your signal has to be backed off to maintain
> linearity through your RF PA.
>
> > Thanks,
> > John
>
> Good luck.
>
> Brian
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Transmit signal power - How to find from the amplitude set in transmit_path?

2010-07-10 Thread John Andrews
Hi,
I want to calculate the power of the signal(in dBm) transmitted in
benchmark_tx.py. The transmit_path sets an amplitude in the range [0,1] but
how will I convert this into the actual power. I just want to know where
should I be looking in order to calculate it myself.

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


Re: [Discuss-gnuradio] write my own module ,but get an import error

2010-07-01 Thread John Andrews
this usually happens when the SWIG interface file is incorrect. Specifically
check the interface definition of "mimo_make_ofdm_mapper" block. I am sure
the mistake lies here and correcting this will fix it. I had such errors too
and I always found the error in the SWIG interface file.

good luck
Mir

2010/7/1 weizhongshan 

> I am  trying to write my own module ,"make" ,"make check" and "make
> install" are all ok ,but when i use it in my own module ,i get the following
> error:
> ImportError: /usr/loca/lib/python2.6/dist-packages/gnuradio/_mimo.so:
> undefined symbol:
> _Z25mimo_make_ofdm_mapper_bcvRKSt6vectorISt7complexIfESaIS1_EEjjj
> i met  a helper in a forum ,he tested my module in his pc ,and it is ok, i
> am totally lost .
>really need your help
>   wei
>
>
>
>
>
> ___
> 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] channel model question

2010-06-28 Thread John Andrews
Yes, that is it. Thanks a lot for your help Josh.



On Mon, Jun 28, 2010 at 4:26 PM, Josh Blum  wrote:

> That ratio of frequency/sample_rate tells the signal source how much to
> change the output per sample such that it will take 1.0/ratio samples to
> make a complete sinusoid period or cycle.
>
> Try this out in grc. Look at the signal source in the scope sink, and then
> try it with 1.0 as the sample rate and freq/samp_rate as the frequency. It
> will look the same.
>
> -Josh
>
>
> On 06/28/2010 03:56 PM, John Andrews wrote:
>
>> But still there is a problem. 1000/100,000 = 0.01 so the channel_model
>> must
>> consume 100,000 samples coming into it to represent an offset of 1000Hz.
>> How, does it know how many samples to consume as the ratio can be the same
>> for a different combination such as 100/1.
>>
>> If x(i) = sin(2*pi*freq_offset_ratio*i) , i must vary from
>> {1,sampling_rate}.
>>
>> On Mon, Jun 28, 2010 at 3:00 PM, Josh Blum  wrote:
>>
>>  For some reason, the channel model's frequency_offset is not in Hz.
>>> Rather
>>> its a fraction of the sample rate. You should pass in
>>> my_offset_in_hz/my_sample_rate to this parameter.
>>>
>>> The signal source works like that. I suppose that means that the sample
>>> rate and frequency are redundant because you really only care about the
>>> ratio between them.
>>>
>>> _josh
>>>
>>> oh consistency...
>>>
>>>
>>> On 06/28/2010 02:12 PM, John Andrews wrote:
>>>
>>>  Hi,
>>>> I have a nagging doubt about how the channel model is implemented in
>>>> gnuradio. Suppose I have an input signal entering the channel model at
>>>> 100,000 samples/sec. Let's say the channel model has to add an offset of
>>>> 1000Hz to the input signal. Then I must have 100,000 samples of a 1000Hz
>>>> SINE_WAVE signal and multiply each input sample with a corresponding
>>>> input
>>>> sample. Am I right? If I am right then i don't see this happening here
>>>> with
>>>> the sampling rate given as 1 in the line below
>>>>
>>>> d_freq_offset = gr_make_sig_source_c(1, GR_SIN_WAVE, frequency_offset,
>>>> 1.0,
>>>> 0.0);
>>>>
>>>> If I am wrong then will someone please correct me here.
>>>>
>>>> thank you very much
>>>> John
>>>>
>>>>
>>>>
>>>>
>>>> ___
>>>> 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 mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] channel model question

2010-06-28 Thread John Andrews
But still there is a problem. 1000/100,000 = 0.01 so the channel_model must
consume 100,000 samples coming into it to represent an offset of 1000Hz.
How, does it know how many samples to consume as the ratio can be the same
for a different combination such as 100/1.

If x(i) = sin(2*pi*freq_offset_ratio*i) , i must vary from
{1,sampling_rate}.

On Mon, Jun 28, 2010 at 3:00 PM, Josh Blum  wrote:

> For some reason, the channel model's frequency_offset is not in Hz. Rather
> its a fraction of the sample rate. You should pass in
> my_offset_in_hz/my_sample_rate to this parameter.
>
> The signal source works like that. I suppose that means that the sample
> rate and frequency are redundant because you really only care about the
> ratio between them.
>
> _josh
>
> oh consistency...
>
>
> On 06/28/2010 02:12 PM, John Andrews wrote:
>
>> Hi,
>> I have a nagging doubt about how the channel model is implemented in
>> gnuradio. Suppose I have an input signal entering the channel model at
>> 100,000 samples/sec. Let's say the channel model has to add an offset of
>> 1000Hz to the input signal. Then I must have 100,000 samples of a 1000Hz
>> SINE_WAVE signal and multiply each input sample with a corresponding input
>> sample. Am I right? If I am right then i don't see this happening here
>> with
>> the sampling rate given as 1 in the line below
>>
>> d_freq_offset = gr_make_sig_source_c(1, GR_SIN_WAVE, frequency_offset,
>> 1.0,
>> 0.0);
>>
>> If I am wrong then will someone please correct me here.
>>
>> thank you very much
>> John
>>
>>
>>
>>
>> ___
>> 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 mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Re: channel model question

2010-06-28 Thread John Andrews
sorry guys my bad. The frequency_offset here is a ratio of the input
sampling frequency. I should be RTFMing more carefully. :)

Thanks
John

On Mon, Jun 28, 2010 at 2:12 PM, John Andrews  wrote:

> Hi,
> I have a nagging doubt about how the channel model is implemented in
> gnuradio. Suppose I have an input signal entering the channel model at
> 100,000 samples/sec. Let's say the channel model has to add an offset of
> 1000Hz to the input signal. Then I must have 100,000 samples of a 1000Hz
> SINE_WAVE signal and multiply each input sample with a corresponding input
> sample. Am I right? If I am right then i don't see this happening here with
> the sampling rate given as 1 in the line below
>
> d_freq_offset = gr_make_sig_source_c(1, GR_SIN_WAVE, frequency_offset, 1.0,
> 0.0);
>
> If I am wrong then will someone please correct me here.
>
> thank you very much
> John
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] channel model question

2010-06-28 Thread John Andrews
Hi,
I have a nagging doubt about how the channel model is implemented in
gnuradio. Suppose I have an input signal entering the channel model at
100,000 samples/sec. Let's say the channel model has to add an offset of
1000Hz to the input signal. Then I must have 100,000 samples of a 1000Hz
SINE_WAVE signal and multiply each input sample with a corresponding input
sample. Am I right? If I am right then i don't see this happening here with
the sampling rate given as 1 in the line below

d_freq_offset = gr_make_sig_source_c(1, GR_SIN_WAVE, frequency_offset, 1.0,
0.0);

If I am wrong then will someone please correct me here.

thank you very much
John
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Can we loopback data from computer to USRP's DAC to ADC and back to the computer?

2010-05-14 Thread John Andrews
Just curious to know. It doesn't serve any purpose but would like to try.
Maybe it does.

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


Re: [Discuss-gnuradio] Spread Spectrum question in gnuradio

2010-05-05 Thread John Andrews
Ok.

The block diagram in most of the textbook says the modulated signal is
multiplied with the PN sequence.

1. If I decide to do the same then my setup will look like this
 byte -> bytes_to_chunks -> chunks_to_symbols(BPSK) -> rrc_filter(X
samples per bit)  -> DSSS

I am confused about the DSSS part. I am using a 63-bit PN sequence and
spreading the BPSK symbols with this sequence means I have to pass each of
the BPSK symbol through an interpolation filter with PN sequence as the
taps(like in the barker example). Am I right? If this is not how it is done
then can someone please suggest me a way.

Thanks,
John


On Thu, Apr 29, 2010 at 8:11 AM, Martin DvH wrote:

> On Wed, 2010-04-28 at 11:23 -0700, Johnathan Corgan wrote:
> > On Tue, Apr 27, 2010 at 21:19, John Andrews  wrote:
> >
> > > If I want to transmit a signal which is DSSS spread using BPSK. Is it
> > > correct for me to first digitally spread the incoming data bits and
> then
> > > apply BPSK before sending it to the USRP or should I first convert the
> > > signal to BPSK and then multiply the output of the BPSK modulator with
> the
> > > PN sequence although I don't know how to do it.
> >
> > Technically, these are equivalent.  However, it is easier and uses
> > less CPU to XOR your data sequence with your PN code, then send it to
> > the modulator.
> I think there is a difference, if you use a root raised cosine filter,
> set for your datarate and roll-off factor.
>
> I think the correct version should then be:
> BPSKmod -> RRCfilter -> DSSS
>
> Martin
> >
> > Johnathan
> >
> >
> > ___
> > 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] Spread Spectrum question in gnuradio

2010-04-27 Thread John Andrews
Hi,
If I want to transmit a signal which is DSSS spread using BPSK. Is it
correct for me to first digitally spread the incoming data bits and then
apply BPSK before sending it to the USRP or should I first convert the
signal to BPSK and then multiply the output of the BPSK modulator with the
PN sequence although I don't know how to do it.

1. If '1' is the data bit then convert it to '1010100111' (lets say this is
the PN sequence) and then input it into a BPSK modulator.
2. If '1' is the data bit first input it into a BPSK modulator and then
mutiply the interpolated output with the PN sequence.

Theoretically, these two methods will lead to the same result but I am not
sure how to do this in gnuradio.

Any ideas?

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