[Top][All Lists]

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

Re: [Discuss-gnuradio] gri_control_loop::set_frequency() Possible Error?

From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] gri_control_loop::set_frequency() Possible Error?
Date: Tue, 21 Aug 2012 17:52:02 -0400

On Thu, Aug 16, 2012 at 7:11 PM, Frederick Lee <address@hidden> wrote:
> Hi,
> I was looking at the gri_control_loop.cc file and notices the
> set_frequency() function seemed a little odd. Here's what it looked like.
> void
> gri_control_loop::set_frequency(float freq)
> {
>   if(freq > d_max_freq)
>     d_freq = d_min_freq;
>   else if(freq < d_min_freq)
>     d_freq = d_max_freq;
>   else
>     d_freq = freq;
> }
> This doesn't seem logical to me. Shouldn't the it be "d_freq = d_max_freq"
> in the if statement and "d_freq = d_min_freq" in the else if statement?
> The frequency_limit() function has it the way I stated
> void
> gri_control_loop::frequency_limit()
> {
>   if (d_freq > d_max_freq)
>     d_freq = d_max_freq;
>   else if (d_freq < d_min_freq)
>     d_freq = d_min_freq;
> }
> Regards,
> Frederick


Yes, that it s a bit odd. It's due to the historical nature of that
loop. We wanted the frequency to wrap around in some of the early
loops as opposed to just railing against the edges. I think the idea
is to let it keep searching in the bandwidth for a lock.

Now, that might not be the right answer. I'm not entirely sure what
is, though. If you just rail it against the max or min frequency,
you're just sitting there doing nothing. Is that better or worse than
forcing it around to the other side? Frankly, if the frequency of the
signal that you are trying to track is outside of the loop, you're
kind of hosed anyways. Would holding it stable at the max/min be more


reply via email to

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