Mailing List archive

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

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



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?

For the values in your table above the result is as good as it can get
with the resolution the AFC register has.

The current 

          afc = (afc * (int)(p->u.qpsk.symbol_rate/8))/16;

just tries to keep the numbers inside integer boundaries a little better.
You also have to substract the value you get instead of adding it.

This was already done correctly in the original frontend code of the 
old main CVS branch (about a year ago or so). I only commented it out
because performing the correction automatically was visible as
artifacts when done after a picture was already there. 


Ralph


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



Home | Main Index | Thread Index