[Top][All Lists]

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

Re: [Discuss-gnuradio] am reception examples

From: Matteo Campanella
Subject: Re: [Discuss-gnuradio] am reception examples
Date: Sun, 5 Mar 2006 08:12:37 +0100

I digged into the usrp c code, and I have found the following code, that basically says we could use 32 bits for tuning on the fpga, but we truncate it to 14 - unless there's a good reason for that, we could be much more precise in tuning the NCO... again, unless Matt has a good reason for that.


// The FPGA NCOs use a signed 32-bit frequency tuning word,
// but we keep only the most significant 14 bits.

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

 int   v = (int) rint (target_freq / master_freq * pow (2.0, 32.0));
 // v += 1 << (32 - NBITS - 1);                // add 1/2
 v = (v >> (32 - NBITS)) << (32 - NBITS);      // keep only top NBITS

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

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

 return (unsigned int) v;
----- Original Message ----- From: "Eric Blossom" <address@hidden>
To: "Matteo Campanella" <address@hidden>
Cc: <address@hidden>
Sent: Sunday, March 05, 2006 3:22 AM
Subject: Re: [Discuss-gnuradio] am reception examples

On Fri, Mar 03, 2006 at 12:06:01AM +0100, Matteo Campanella wrote:

In another script, usrp_wfm_rcv.pl, another method has been used, the
usrp.tune, that, according to the tests, does not need any successive
adjustment - is there any reason why the am receiver is not written using
this method?

usrp_wfm_rcv was written later in the game, and uses the prefered
method (works with all daughterboards).  Whether or not you need to
the final software DDS depends on how precisely you need to be on
frequency.  The WFM signal is > 100 kHz wide, thus an offset of a few
kHz makes no difference.  For narrow band FM, or AM, etc, you probably
want to be closer.  Take a look at usrp_nbfm_rcv.py, it uses the
preferred technique.  Note that if you really are trying to handle AM
properly you're probably better off building a synchronous receiver or
some other method that tracks the carrier.

Another doubt is about optfir.low_pass versus gr.firdes.low_pass - from the tests I have run, the first one is much faster of the second - is there any
reason to use the second instead of the faster optfir?

optfir uses the Remez / Parks-McClellan design method.
gr.firdes.low_pass designs filters using the window method.  It all
depends on what you want.  See any DSP book for details.


reply via email to

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