commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r9998 - gnuradio/trunk/usrp2/firmware/lib


From: matt
Subject: [Commit-gnuradio] r9998 - gnuradio/trunk/usrp2/firmware/lib
Date: Sun, 16 Nov 2008 13:55:07 -0700 (MST)

Author: matt
Date: 2008-11-16 13:55:07 -0700 (Sun, 16 Nov 2008)
New Revision: 9998

Modified:
   gnuradio/trunk/usrp2/firmware/lib/db_rfx.c
Log:
fixed gain calculations rfx900-2400


Modified: gnuradio/trunk/usrp2/firmware/lib/db_rfx.c
===================================================================
--- gnuradio/trunk/usrp2/firmware/lib/db_rfx.c  2008-11-16 20:43:57 UTC (rev 
9997)
+++ gnuradio/trunk/usrp2/firmware/lib/db_rfx.c  2008-11-16 20:55:07 UTC (rev 
9998)
@@ -517,10 +517,10 @@
 {
   struct db_rfx_dummy *db = (struct db_rfx_dummy *) dbb;
 
-  u2_fxpt_gain_t MAXGAIN = U2_DOUBLE_TO_FXPT_GAIN(70.0);
+  int offset_q8 = (int)(1.2/3.3*4096*(1<<15));  
+  int range_q15 = (int)(-1.0*4096/3.3*256*128);
+  int slope_q8 = range_q15/db->base.gain_max;
 
-  int offset_q8 = (int)(1.2/3.3*4096*(1<<15));  
-  int slope_q8 = (int)(-1.0/45.0*4096/3.3*256); 
   int dacword = ((slope_q8 * gain) + offset_q8)>>15;
   //printf("DACWORD %d\n",dacword);
   lsdac_write_rx(1,dacword);





reply via email to

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