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: Matt Ettus
Subject: Re: [Discuss-gnuradio] pll refout vs carriertracking
Date: Wed, 12 Jul 2006 18:25:15 -0700
User-agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501)


Bob --

I think we have a problem with carriertracking -- it was supposed to mix the input signal down, and output that, but it looks like it just outputs the reference, like refout.

Charles --
To detect AM, you can:

1 - take output of pll_refout_cc, take its complex conjugate and complex multiply that by the input signal. The audio you want is in the real output. The imaginary output should only have noise. If the RMS value of both is about the same you don't have lock, or the signal is very noisy.

-OR-

2 - Fix pll_carriertracking_cc to do what I said in 1, above, since that is what it was supposed to do.

Matt

Robert McGwier wrote:

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









reply via email to

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