discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Generating complex exponential stream


From: John Andrews
Subject: Re: [Discuss-gnuradio] Generating complex exponential stream
Date: Tue, 22 Mar 2011 03:09:14 -0500



On Mon, Mar 21, 2011 at 6:53 PM, Praveen Vikram <address@hidden> 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 = 1000000;
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
address@hidden
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]