discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] pll refout vs carriertracking


From: Robert McGwier
Subject: Re: [Discuss-gnuradio] pll refout vs carriertracking
Date: Mon, 10 Jul 2006 15:54:50 -0400
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

You are correct. pll_carriertracking_cc returns the recovered carrier. Sending to baseband is then done by a complex multiply block, don't forget the conjugation.


Bob


Charles Swiger wrote:
All - Do I understand correctly that gr.pll_carriertracking_cc() is
supposed to downconvert to DC?  I don't see it doing that, and can't
see in the work functions where that magic would be accomplished.

Just want to make sure I'm building the most efficient graph possible.
I tried both in an existing AM detector with a 7.5KHz IF and both work
just the same with an external mixer.

----------------------------------------------------------------
refout:

int
gr_pll_refout_cc::work (int noutput_items,
                   gr_vector_const_void_star &input_items,
                   gr_vector_void_star &output_items)
{
  const gr_complex *iptr = (gr_complex *) input_items[0];
  gr_complex *optr = (gr_complex *) output_items[0];

  float error;
  float t_imag, t_real;
  int   size = noutput_items;

  while (size-- > 0) {
    error = phase_detector(*iptr++,d_phase);

    d_freq = d_freq + d_beta * error;
    d_phase = mod_2pi(d_phase + d_freq + d_alpha * error);

    if (d_freq > d_max_freq)
      d_freq = d_max_freq;
    else if (d_freq < d_min_freq)
      d_freq = d_min_freq;
    gr_sincosf(d_phase,&t_imag,&t_real);
    *optr++ = gr_complex(t_real,t_imag);
  }
  return noutput_items;
}


-----------------------------------------------------------------
carriertracking:

int
gr_pll_carriertracking_cc::work (int noutput_items,
                                 gr_vector_const_void_star &input_items,
                                 gr_vector_void_star &output_items)
{
  const gr_complex *iptr = (gr_complex *) input_items[0];
  gr_complex *optr = (gr_complex *) output_items[0];

  float error;
  float t_imag, t_real;

  for (int i = 0; i < noutput_items; i++){
    error = phase_detector(iptr[i],d_phase);

    d_freq = d_freq + d_beta * error;
    d_phase = mod_2pi(d_phase + d_freq + d_alpha * error);

    if (d_freq > d_max_freq)
      d_freq = d_max_freq;
    else if (d_freq < d_min_freq)
      d_freq = d_min_freq;
    gr_sincosf(d_phase,&t_imag,&t_real);
    optr[i] = gr_complex(t_real,t_imag);
    d_locksig = d_locksig * (1.0 - d_alpha) + d_alpha*(iptr[i].real() *
t_real + iptr[i].imag() * t_imag);

    if ((d_squelch_enable) && !lock_detector())
      optr[i] = 0;
  }
  return noutput_items;
}




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



--
AMSAT VP Engineering. Member: ARRL, AMSAT-DL, TAPR, Packrats,
NJQRP/AMQRP, QRP ARCI, QCWA, FRC. ARRL SDR Wrk Grp Chairman
"An expert is a man who has made all the mistakes which can be
made in a very narrow field."  Niels Bohr





reply via email to

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