Mailing List archive

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

[linux-dvb] Re: Problem: FE_GET_FRONTEND frequency in alps_bsrv2.c



Wolfgang Thiel writes:
 > On Wed, Apr 16, 2003 at 09:41:58PM +0200, Ralph Metzler wrote:
 > > Wolfgang Thiel writes:
 > >  > 27.500: 19 afc-units for 4000 kHz = 1.1875 afc-units per 250 kHz
 > >  > 22.000: 23 afc-units for 4000 kHz = 1.4375 afc-units per 250 kHz
 > >  > 12.130: 32 afc-units for 3000 kHz = 2.6667 afc-units per 250 kHz
 > >  > 11.000: 29 afc-units for 2250 kHz = 3.2222 afc-units per 250 kHz
 > >  >  5.632: 34 afc-units for 1500 kHz = 5.6667 afc-units per 250 kHz
 > >  > 
 > >  > 
 > >  > Now: can anybody think of a nice formula to get the actual lock frequency
 > >  > in FE_GET_FRONTEND?
 > > 
 > > What is wrong with the good old 
 > > 
 > >           afc = afc * p->u.qpsk.symbol_rate / 128;
 > > 
 > > here?
 > >
 > Because it is wrong?
 > 

Sorry, I don't see it.
In your example:

 > >  > 27.500: 19 afc-units for 4000 kHz = 1.1875 afc-units per 250 kHz

I get 27500 * 19 / 128 = 4082. What's wrong with that?

Can you just give one specific example of what you values you get (as
you already did above) but together with the values you would expect?


 > The lower the SR gets, the higher has to be the correction.
 > This can be done by 'divide', but not with 'multiplication'?

What do you mean with "correction"? The value of the register?
As you showed it does get higher with lower SR (because it is in units of
SR/128 according to the datasheet).
So, you have to multiply the register value with SR/128 to get the 
offset in 1 Hz units.

 
 > And don't forget my -= in the proposed formula. The code I know does +=.


The +/- depends on what you want, the currently tuned frequency
(in the units with the offset error) or the (again wrong) frequency
you have to tune to to actually get the right one.

The way I used it in the old frontend code (again, check the main CVS
branch from a year ago) the correction I used worked. It let the error 
converge to zero.


Ralph


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index