[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r9670 - gnuradio/branches/features/cppdb/usrp/host/lib
From: |
trondeau |
Subject: |
[Commit-gnuradio] r9670 - gnuradio/branches/features/cppdb/usrp/host/lib/legacy |
Date: |
Sun, 28 Sep 2008 14:27:32 -0600 (MDT) |
Author: trondeau
Date: 2008-09-28 14:27:31 -0600 (Sun, 28 Sep 2008)
New Revision: 9670
Modified:
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.cc
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.h
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.i
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_basic.cc
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_basic.h
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dbs_rx.cc
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dbs_rx.h
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt754.cc
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt754.h
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt768.cc
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt768.h
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_flexrf.cc
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_flexrf.h
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_tv_rx.cc
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_tv_rx.h
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_wbx.cc
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_wbx.h
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.cc
gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.h
Log:
Converting all frequency values from float to double for high-frequency
precision.
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.cc
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.cc
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.cc
2008-09-28 20:27:31 UTC (rev 9670)
@@ -22,7 +22,7 @@
#include <db_base.h>
#include <stdexcept>
-tune_result::tune_result(float baseband, float dxc, float residual, bool inv)
+tune_result::tune_result(double baseband, double dxc, double residual, bool
inv)
: ok(false), baseband_freq(baseband), dxc_freq(dxc),
residual_freq(residual), inverted(inv)
{
@@ -125,25 +125,25 @@
return d_usrp->_write_fpga_reg(FR_ATR_RX_DELAY, v);
}
-float
+double
db_base::freq_min()
{
throw std::runtime_error("freq_min() called from base class\n");
}
-float
+double
db_base::freq_max()
{
throw std::runtime_error("freq_max() called from base class\n");
}
struct freq_result_t
-db_base::set_freq(float target_freq)
+db_base::set_freq(double target_freq)
{
// Set the frequency.
//
// @param freq: target RF frequency in Hz
- // @type freq: float
+ // @type freq: double
//
// @returns (ok, actual_baseband_freq) where:
// ok is True or False and indicates success or failure,
@@ -222,14 +222,14 @@
}
void
-db_base::set_lo_offset(float offset)
+db_base::set_lo_offset(double offset)
{
// Set how much LO is offset from requested frequency
//
// Should be overriden by daughterboards that care.
}
-float
+double
db_base::lo_offset()
{
// Get how much LO is offset from requested frequency
@@ -255,7 +255,7 @@
// Bits 6:0 Divider value
//
-float
+double
db_base::_refclk_freq()
{
return d_usrp->fpga_master_clock_freq() / _refclk_divisor();
@@ -286,7 +286,7 @@
}
tune_result
-db_base::tune(int chan, float target_freq)
+db_base::tune(int chan, double target_freq)
{
/*
Set the center frequency we're interested in.
@@ -306,7 +306,7 @@
// Set the daughterboard frequency
bool ok=true;
- float baseband_freq;
+ double baseband_freq;
struct freq_result_t freq = set_freq(target_freq);
ok = freq.ok;
baseband_freq = freq.baseband_freq;
@@ -342,7 +342,7 @@
}
// residual_freq is the offset left over because of dxc tuning step size
- float residual_freq;
+ double residual_freq;
if(!d_tx) {
residual_freq = dxc_freq.ddc_freq -
((usrp_standard_rx*)d_usrp)->rx_freq(chan);
}
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.h
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.h
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.h
2008-09-28 20:27:31 UTC (rev 9670)
@@ -35,21 +35,21 @@
class tune_result
{
public:
- tune_result(float baseband=0, float dxc=0,
- float residual=0, bool inv=0);
+ tune_result(double baseband=0, double dxc=0,
+ double residual=0, bool inv=0);
~tune_result();
bool ok;
- float baseband_freq;
- float dxc_freq;
- float residual_freq;
+ double baseband_freq;
+ double dxc_freq;
+ double residual_freq;
bool inverted;
};
struct freq_result_t
{
bool ok;
- float baseband_freq;
+ double baseband_freq;
};
/******************************************************************************/
@@ -77,24 +77,24 @@
virtual float gain_min();
virtual float gain_max();
virtual float gain_db_per_step();
- virtual float freq_min();
- virtual float freq_max();
- virtual struct freq_result_t set_freq(float target_freq);
+ virtual double freq_min();
+ virtual double freq_max();
+ virtual struct freq_result_t set_freq(double target_freq);
virtual bool set_gain(float gain);
virtual bool is_quadrature();
virtual bool i_and_q_swapped();
virtual bool spectrum_inverted();
virtual void set_enable(bool on);
virtual void set_auto_tr(bool on);
- virtual void set_lo_offset(float offset);
- virtual float lo_offset();
+ virtual void set_lo_offset(double offset);
+ virtual double lo_offset();
virtual void select_rx_antenna(int which_antenna);
- tune_result tune(int chan, float target_freq);
+ tune_result tune(int chan, double target_freq);
protected:
void _enable_refclk(bool enable);
- virtual float _refclk_freq();
+ virtual double _refclk_freq();
virtual int _refclk_divisor();
int d_which;
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.i
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.i
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_base.i
2008-09-28 20:27:31 UTC (rev 9670)
@@ -30,21 +30,21 @@
class tune_result
{
public:
- tune_result(float baseband=0, float dxc=0,
- float residual=0, bool inv=0);
+ tune_result(double baseband=0, double dxc=0,
+ double residual=0, bool inv=0);
~tune_result();
bool ok;
- float baseband_freq;
- float dxc_freq;
- float residual_freq;
+ double baseband_freq;
+ double dxc_freq;
+ double residual_freq;
bool inverted;
};
struct freq_result_t
{
bool ok;
- float baseband_freq;
+ double baseband_freq;
};
class db_base
@@ -60,20 +60,20 @@
float gain_min();
float gain_max();
float gain_db_per_step();
- float freq_min();
- float freq_max();
- struct freq_result_t set_freq(float target_freq);
+ double freq_min();
+ double freq_max();
+ struct freq_result_t set_freq(double target_freq);
bool set_gain(float gain);
bool is_quadrature();
bool i_and_q_swapped();
bool spectrum_inverted();
void set_enable(bool on);
void set_auto_tr(bool on);
- void set_lo_offset(float offset);
- float lo_offset();
+ void set_lo_offset(double offset);
+ double lo_offset();
void select_rx_antenna(int which_antenna);
- tune_result tune(int chan, float target_freq);
+ tune_result tune(int chan, double target_freq);
};
typedef boost::shared_ptr<db_base> db_base_sptr;
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_basic.cc
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_basic.cc
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_basic.cc
2008-09-28 20:27:31 UTC (rev 9670)
@@ -43,25 +43,25 @@
{
}
-float
+double
db_basic_tx::freq_min()
{
return -90e9;
}
-float
+double
db_basic_tx::freq_max()
{
return 90e9;
}
struct freq_result_t
-db_basic_tx::set_freq(float target_freq)
+db_basic_tx::set_freq(double target_freq)
{
// Set the frequency.
//
// @param freq: target RF frequency in Hz
- // @type freq: float
+ // @type freq: double
//
// @returns (ok, actual_baseband_freq) where:
// ok is True or False and indicates success or failure,
@@ -139,25 +139,25 @@
{
}
-float
+double
db_basic_rx::freq_min()
{
return -90e9;
}
-float
+double
db_basic_rx::freq_max()
{
return 90e9;
}
struct freq_result_t
-db_basic_rx::set_freq(float target_freq)
+db_basic_rx::set_freq(double target_freq)
{
// Set the frequency.
//
// @param freq: target RF frequency in Hz
- // @type freq: float
+ // @type freq: double
//
// @returns (ok, actual_baseband_freq) where:
// ok is True or False and indicates success or failure,
@@ -224,13 +224,13 @@
{
}
-float
+double
db_lf_tx::freq_min()
{
return -32e6;
}
-float
+double
db_lf_tx::freq_max()
{
return 32e6;
@@ -254,13 +254,13 @@
{
}
-float
+double
db_lf_rx::freq_min()
{
return 0.0;
}
-float
+double
db_lf_rx::freq_max()
{
return 32e6;
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_basic.h
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_basic.h
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_basic.h
2008-09-28 20:27:31 UTC (rev 9670)
@@ -37,9 +37,9 @@
float gain_min();
float gain_max();
float gain_db_per_step();
- float freq_min();
- float freq_max();
- struct freq_result_t set_freq(float target_freq);
+ double freq_min();
+ double freq_max();
+ struct freq_result_t set_freq(double target_freq);
bool set_gain(float gain);
bool is_quadrature();
};
@@ -57,9 +57,9 @@
float gain_min();
float gain_max();
float gain_db_per_step();
- float freq_min();
- float freq_max();
- struct freq_result_t set_freq(float target_freq);
+ double freq_min();
+ double freq_max();
+ struct freq_result_t set_freq(double target_freq);
bool set_gain(float gain);
bool is_quadrature();
@@ -77,8 +77,8 @@
db_lf_rx(usrp_basic *usrp, int which, int subdev);
~db_lf_rx();
- float freq_min();
- float freq_max();
+ double freq_min();
+ double freq_max();
};
@@ -91,8 +91,8 @@
db_lf_tx(usrp_basic *usrp, int which);
~db_lf_tx();
- float freq_min();
- float freq_max();
+ double freq_min();
+ double freq_max();
};
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dbs_rx.cc
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dbs_rx.cc
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dbs_rx.cc
2008-09-28 20:27:31 UTC (rev 9670)
@@ -341,25 +341,25 @@
_send_reg(4);
}
-float
+double
db_dbs_rx::freq_min()
{
return 500e6;
}
-float
+double
db_dbs_rx::freq_max()
{
return 2.6e9;
}
struct freq_result_t
-db_dbs_rx::set_freq(float freq)
+db_dbs_rx::set_freq(double freq)
{
// Set the frequency.
//
// @param freq: target RF frequency in Hz
- // @type freq: float
+ // @type freq: double
//
// @returns (ok, actual_baseband_freq) where:
// ok is True or False and indicates success or failure,
@@ -370,8 +370,8 @@
if(!(freq>=500e6 && freq<=2.6e9)) {
return args;
}
-
- float vcofreq;
+
+ double vcofreq;
if(freq<1150e6) {
_set_div2(0);
vcofreq = 4 * freq;
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dbs_rx.h
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dbs_rx.h
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dbs_rx.h
2008-09-28 20:27:31 UTC (rev 9670)
@@ -70,9 +70,9 @@
float gain_min();
float gain_max();
float gain_db_per_step();
- float freq_min();
- float freq_max();
- struct freq_result_t set_freq(float freq);
+ double freq_min();
+ double freq_max();
+ struct freq_result_t set_freq(double freq);
bool set_gain(float gain);
bool is_quadrature();
};
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt754.cc
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt754.cc
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt754.cc
2008-09-28 20:27:31 UTC (rev 9670)
@@ -189,20 +189,20 @@
return true; // can't fail with the assert in place
}
-float
+double
db_dtt754::freq_min()
{
return 44e6;
}
-float
+double
db_dtt754::freq_max()
{
return 900e6;
}
struct freq_result_t
-db_dtt754::set_freq(float target_freq)
+db_dtt754::set_freq(double target_freq)
{
/*
* @returns (ok, actual_baseband_freq) where:
@@ -216,10 +216,10 @@
return ret;
}
- float target_lo_freq = target_freq + d_IF; // High side mixing
+ double target_lo_freq = target_freq + d_IF; // High side mixing
int divisor = (int)(0.5+(target_lo_freq / d_f_ref));
- float actual_lo_freq = d_f_ref*divisor;
+ double actual_lo_freq = d_f_ref*divisor;
if((divisor & ~0x7fff) != 0) { // must be 15-bits or less
return ret;
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt754.h
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt754.h
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt754.h
2008-09-28 20:27:31 UTC (rev 9670)
@@ -36,9 +36,9 @@
float gain_db_per_step();
bool set_gain(float gain);
- float freq_min();
- float freq_max();
- struct freq_result_t set_freq(float target_freq);
+ double freq_min();
+ double freq_max();
+ struct freq_result_t set_freq(double target_freq);
bool is_quadrature();
bool spectrum_inverted();
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt768.cc
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt768.cc
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt768.cc
2008-09-28 20:27:31 UTC (rev 9670)
@@ -161,20 +161,20 @@
return true;
}
-float
+double
db_dtt768::freq_min()
{
return 44e6;
}
-float
+double
db_dtt768::freq_max()
{
return 900e6;
}
struct freq_result_t
-db_dtt768::set_freq(float target_freq)
+db_dtt768::set_freq(double target_freq)
{
/*
* @returns (ok, actual_baseband_freq) where:
@@ -188,10 +188,10 @@
return ret;
}
- float target_lo_freq = target_freq + d_IF; // High side mixing
+ double target_lo_freq = target_freq + d_IF; // High side mixing
int divisor = (int)(0.5+(target_lo_freq / d_f_ref));
- float actual_lo_freq = d_f_ref*divisor;
+ double actual_lo_freq = d_f_ref*divisor;
if((divisor & ~0x7fff) != 0) { // must be 15-bits or less
return ret;
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt768.h
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt768.h
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_dtt768.h
2008-09-28 20:27:31 UTC (rev 9670)
@@ -36,9 +36,9 @@
float gain_db_per_step();
bool set_gain(float gain);
- float freq_min();
- float freq_max();
- struct freq_result_t set_freq(float target_freq);
+ double freq_min();
+ double freq_max();
+ struct freq_result_t set_freq(double target_freq);
bool is_quadrature();
bool spectrum_inverted();
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_flexrf.cc
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_flexrf.cc
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_flexrf.cc
2008-09-28 20:27:31 UTC (rev 9670)
@@ -163,8 +163,8 @@
}
bool
-flexrf_base::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+flexrf_base::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
/*
Determine values of R, control, and N registers, along with actual freq.
@@ -193,14 +193,14 @@
return d_common->_refclk_divisor();
}
-float
+double
flexrf_base::_refclk_freq()
{
return 64e6/_refclk_divisor();
}
struct freq_result_t
-flexrf_base::set_freq(float freq)
+flexrf_base::set_freq(double freq)
{
/*
@returns (ok, actual_baseband_freq) where:
@@ -218,7 +218,7 @@
freq += d_lo_offset;
int R, control, N;
- float actual_freq;
+ double actual_freq;
_compute_regs(freq, R, control, N, actual_freq);
if(R==0) {
@@ -287,7 +287,7 @@
}
void
-flexrf_base::set_lo_offset(float offset)
+flexrf_base::set_lo_offset(double offset)
{
/*
Set amount by which LO is offset from requested tuning frequency.
@@ -297,7 +297,7 @@
d_lo_offset = offset;
}
-float
+double
flexrf_base::lo_offset()
{
/*
@@ -581,8 +581,8 @@
}
bool
-_AD4360_common::_compute_regs(float refclk_freq, float freq, int &retR,
- int &retcontrol, int &retN, float &retfreq)
+_AD4360_common::_compute_regs(double refclk_freq, double freq, int &retR,
+ int &retcontrol, int &retN, double &retfreq)
{
/*
Determine values of R, control, and N registers, along with actual freq.
@@ -595,9 +595,9 @@
// Band-specific N-Register Values
//float phdet_freq = _refclk_freq()/d_R_DIV;
- float phdet_freq = refclk_freq/d_R_DIV;
- float desired_n = round(freq*d_freq_mult/phdet_freq);
- float actual_freq = desired_n * phdet_freq;
+ double phdet_freq = refclk_freq/d_R_DIV;
+ double desired_n = round(freq*d_freq_mult/phdet_freq);
+ double actual_freq = desired_n * phdet_freq;
int B = floor(desired_n/_prescaler());
int A = desired_n - _prescaler()*B;
d_B_DIV = int(B); // bits 20:8
@@ -660,13 +660,13 @@
}
}
-float
+double
_AD4360_common::freq_min()
{
throw 0;
}
-float
+double
_AD4360_common::freq_max()
{
throw 0;
@@ -692,13 +692,13 @@
d_freq_mult = 1;
}
-float
+double
_2400_common::freq_min()
{
return 2300e6;
}
-float
+double
_2400_common::freq_max()
{
return 2700e6;
@@ -724,13 +724,13 @@
d_freq_mult = 2;
}
-float
+double
_1200_common::freq_min()
{
return 1150e6;
}
-float
+double
_1200_common::freq_max()
{
return 1350e6;
@@ -756,13 +756,13 @@
d_CPGAIN = 0; // bit 21
}
-float
+double
_1800_common::freq_min()
{
return 1600e6;
}
-float
+double
_1800_common::freq_max()
{
return 2000e6;
@@ -788,13 +788,13 @@
d_CPGAIN = 0; // bit 21
}
-float
+double
_900_common::freq_min()
{
return 800e6;
}
-float
+double
_900_common::freq_max()
{
return 1000e6;
@@ -826,13 +826,13 @@
d_CPGAIN = 0; // bit 21
}
-float
+double
_400_common::freq_min()
{
return 400e6;
}
-float
+double
_400_common::freq_max()
{
return 500e6;
@@ -850,21 +850,21 @@
{
}
-float
+double
db_flexrf_2400_tx::freq_min()
{
return d_common->freq_min();
}
-float
+double
db_flexrf_2400_tx::freq_max()
{
return d_common->freq_max();
}
bool
-db_flexrf_2400_tx::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+db_flexrf_2400_tx::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
return d_common->_compute_regs(_refclk_freq(), freq, retR,
retcontrol, retN, retfreq);
@@ -907,21 +907,21 @@
return true;
}
-float
+double
db_flexrf_2400_rx::freq_min()
{
return d_common->freq_min();
}
-float
+double
db_flexrf_2400_rx::freq_max()
{
return d_common->freq_max();
}
bool
-db_flexrf_2400_rx::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+db_flexrf_2400_rx::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
return d_common->_compute_regs(_refclk_freq(), freq, retR,
retcontrol, retN, retfreq);
@@ -940,21 +940,21 @@
{
}
-float
+double
db_flexrf_1200_tx::freq_min()
{
return d_common->freq_min();
}
-float
+double
db_flexrf_1200_tx::freq_max()
{
return d_common->freq_max();
}
bool
-db_flexrf_1200_tx::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+db_flexrf_1200_tx::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
return d_common->_compute_regs(_refclk_freq(), freq, retR,
retcontrol, retN, retfreq);
@@ -997,21 +997,21 @@
return true;
}
-float
+double
db_flexrf_1200_rx::freq_min()
{
return d_common->freq_min();
}
-float
+double
db_flexrf_1200_rx::freq_max()
{
return d_common->freq_max();
}
bool
-db_flexrf_1200_rx::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+db_flexrf_1200_rx::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
return d_common->_compute_regs(_refclk_freq(), freq, retR,
retcontrol, retN, retfreq);
@@ -1031,21 +1031,21 @@
{
}
-float
+double
db_flexrf_1800_tx::freq_min()
{
return d_common->freq_min();
}
-float
+double
db_flexrf_1800_tx::freq_max()
{
return d_common->freq_max();
}
bool
-db_flexrf_1800_tx::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+db_flexrf_1800_tx::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
return d_common->_compute_regs(_refclk_freq(), freq, retR,
retcontrol, retN, retfreq);
@@ -1088,21 +1088,21 @@
return true;
}
-float
+double
db_flexrf_1800_rx::freq_min()
{
return d_common->freq_min();
}
-float
+double
db_flexrf_1800_rx::freq_max()
{
return d_common->freq_max();
}
bool
-db_flexrf_1800_rx::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+db_flexrf_1800_rx::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
return d_common->_compute_regs(_refclk_freq(), freq, retR,
retcontrol, retN, retfreq);
@@ -1122,21 +1122,21 @@
{
}
-float
+double
db_flexrf_900_tx::freq_min()
{
return d_common->freq_min();
}
-float
+double
db_flexrf_900_tx::freq_max()
{
return d_common->freq_max();
}
bool
-db_flexrf_900_tx::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+db_flexrf_900_tx::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
return d_common->_compute_regs(_refclk_freq(), freq, retR,
retcontrol, retN, retfreq);
@@ -1177,21 +1177,21 @@
return true;
}
-float
+double
db_flexrf_900_rx::freq_min()
{
return d_common->freq_min();
}
-float
+double
db_flexrf_900_rx::freq_max()
{
return d_common->freq_max();
}
bool
-db_flexrf_900_rx::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+db_flexrf_900_rx::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
return d_common->_compute_regs(_refclk_freq(), freq, retR,
retcontrol, retN, retfreq);
@@ -1210,21 +1210,21 @@
{
}
-float
+double
db_flexrf_400_tx::freq_min()
{
return d_common->freq_min();
}
-float
+double
db_flexrf_400_tx::freq_max()
{
return d_common->freq_max();
}
bool
-db_flexrf_400_tx::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+db_flexrf_400_tx::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
return d_common->_compute_regs(_refclk_freq(), freq, retR,
retcontrol, retN, retfreq);
@@ -1268,21 +1268,21 @@
return true;
}
-float
+double
db_flexrf_400_rx::freq_min()
{
return d_common->freq_min();
}
-float
+double
db_flexrf_400_rx::freq_max()
{
return d_common->freq_max();
}
bool
-db_flexrf_400_rx::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+db_flexrf_400_rx::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
return d_common->_compute_regs(_refclk_freq(), freq, retR,
retcontrol, retN, retfreq);
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_flexrf.h
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_flexrf.h
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_flexrf.h
2008-09-28 20:27:31 UTC (rev 9670)
@@ -36,14 +36,14 @@
flexrf_base(usrp_basic *usrp, int which, int _power_on=0);
~flexrf_base();
- struct freq_result_t set_freq(float freq);
+ struct freq_result_t set_freq(double freq);
float gain_min();
float gain_max();
float gain_db_per_step();
bool set_gain(float gain);
bool is_quadrature();
- float lo_offset();
- void set_lo_offset(float offset);
+ double lo_offset();
+ void set_lo_offset(double offset);
protected:
void _write_all(int R, int control, int N);
@@ -53,18 +53,18 @@
void _write_it(int v);
bool _lock_detect();
- virtual bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
+ virtual bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
int _compute_control_reg();
int _refclk_divisor();
- float _refclk_freq();
+ double _refclk_freq();
bool _set_pga(float pga_gain);
int power_on() { return d_power_on; }
int power_off() { return 0; }
- float d_lo_offset;
+ double d_lo_offset;
bool d_first;
int d_spi_format;
int d_spi_enable;
@@ -117,11 +117,11 @@
_AD4360_common(bool tx);
virtual ~_AD4360_common();
- virtual float freq_min();
- virtual float freq_max();
+ virtual double freq_min();
+ virtual double freq_max();
- bool _compute_regs(float refclk_freq, float freq, int &retR,
- int &retcontrol, int &retN, float &retfreq);
+ bool _compute_regs(double refclk_freq, double freq, int &retR,
+ int &retcontrol, int &retN, double &retfreq);
int _compute_control_reg();
virtual int _refclk_divisor();
int _prescaler();
@@ -148,8 +148,8 @@
_2400_common(bool tx);
~_2400_common() {}
- float freq_min();
- float freq_max();
+ double freq_min();
+ double freq_max();
};
//----------------------------------------------------------------------
@@ -160,8 +160,8 @@
_1200_common(bool tx);
~_1200_common() {}
- float freq_min();
- float freq_max();
+ double freq_min();
+ double freq_max();
};
//-------------------------------------------------------------------------
@@ -172,8 +172,8 @@
_1800_common(bool tx);
~_1800_common() {}
- float freq_min();
- float freq_max();
+ double freq_min();
+ double freq_max();
};
//-------------------------------------------------------------------------
@@ -184,8 +184,8 @@
_900_common(bool tx);
~_900_common() {}
- float freq_min();
- float freq_max();
+ double freq_min();
+ double freq_max();
};
//-------------------------------------------------------------------------
@@ -196,8 +196,8 @@
_400_common(bool tx);
~_400_common() {}
- float freq_min();
- float freq_max();
+ double freq_min();
+ double freq_max();
};
@@ -210,10 +210,10 @@
~db_flexrf_2400_tx();
// Wrapper calls to d_common functions
- bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
- float freq_min();
- float freq_max();
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
+ double freq_min();
+ double freq_max();
};
class db_flexrf_2400_rx : public flexrf_base_rx
@@ -227,10 +227,10 @@
float gain_db_per_step();
bool i_and_q_swapped();
- float freq_min();
- float freq_max();
- bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
+ double freq_min();
+ double freq_max();
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
};
//------------------------------------------------------------
@@ -242,10 +242,10 @@
~db_flexrf_1200_tx();
// Wrapper calls to d_common functions
- bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
- float freq_min();
- float freq_max();
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
+ double freq_min();
+ double freq_max();
};
class db_flexrf_1200_rx : public flexrf_base_rx
@@ -259,10 +259,10 @@
float gain_db_per_step();
bool i_and_q_swapped();
- float freq_min();
- float freq_max();
- bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
+ double freq_min();
+ double freq_max();
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
};
//------------------------------------------------------------
@@ -274,10 +274,10 @@
~db_flexrf_1800_tx();
// Wrapper calls to d_common functions
- bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
- float freq_min();
- float freq_max();
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
+ double freq_min();
+ double freq_max();
};
class db_flexrf_1800_rx : public flexrf_base_rx
@@ -291,10 +291,10 @@
float gain_db_per_step();
bool i_and_q_swapped();
- float freq_min();
- float freq_max();
- bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
+ double freq_min();
+ double freq_max();
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
};
//------------------------------------------------------------
@@ -306,10 +306,10 @@
~db_flexrf_900_tx();
// Wrapper calls to d_common functions
- bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
- float freq_min();
- float freq_max();
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
+ double freq_min();
+ double freq_max();
};
class db_flexrf_900_rx : public flexrf_base_rx
@@ -323,10 +323,10 @@
float gain_db_per_step();
bool i_and_q_swapped();
- float freq_min();
- float freq_max();
- bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
+ double freq_min();
+ double freq_max();
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
};
@@ -339,10 +339,10 @@
~db_flexrf_400_tx();
// Wrapper calls to d_common functions
- bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
- float freq_min();
- float freq_max();
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
+ double freq_min();
+ double freq_max();
};
class db_flexrf_400_rx : public flexrf_base_rx
@@ -356,10 +356,10 @@
float gain_db_per_step();
bool i_and_q_swapped();
- float freq_min();
- float freq_max();
- bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
+ double freq_min();
+ double freq_max();
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
};
#endif
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_tv_rx.cc
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_tv_rx.cc
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_tv_rx.cc
2008-09-28 20:27:31 UTC (rev 9670)
@@ -76,7 +76,7 @@
}
int
-control_byte_2(float target_freq, bool shutdown_tx_PGA)
+control_byte_2(double target_freq, bool shutdown_tx_PGA)
{
int c;
if(target_freq < 158e6) { // VHF low
@@ -101,7 +101,7 @@
db_tv_rx::db_tv_rx(usrp_basic *usrp, int which,
- float first_IF, float second_IF)
+ double first_IF, double second_IF)
: db_base(usrp, which, false)
{
// Handler for Tv Rx daughterboards.
@@ -180,25 +180,25 @@
}
}
-float
+double
db_tv_rx::freq_min()
{
return 50e6;
}
-float
+double
db_tv_rx::freq_max()
{
return 860e6;
}
struct freq_result_t
-db_tv_rx::set_freq(float target_freq)
+db_tv_rx::set_freq(double target_freq)
{
// Set the frequency.
//
// @param freq: target RF frequency in Hz
- // @type freq: float
+ // @type freq: double
//
// @returns (ok, actual_baseband_freq) where:
// ok is True or False and indicates success or failure,
@@ -206,18 +206,18 @@
freq_result_t args = {false, 0};
- float fmin = freq_min();
- float fmax = freq_max();
+ double fmin = freq_min();
+ double fmax = freq_max();
if((target_freq < fmin) || (target_freq > fmax)) {
return args;
}
- float target_lo_freq = target_freq + d_first_IF; // High side mixing
- float f_ref = 4.0e6 / (float)(d_reference_divisor); // frequency steps
+ double target_lo_freq = target_freq + d_first_IF; // High side mixing
+ double f_ref = 4.0e6 / (double)(d_reference_divisor); // frequency steps
int divisor = int((target_lo_freq + (f_ref * 4)) / (f_ref * 8));
- float actual_lo_freq = (f_ref * 8 * divisor);
- float actual_freq = actual_lo_freq - d_first_IF;
+ double actual_lo_freq = (f_ref * 8 * divisor);
+ double actual_freq = actual_lo_freq - d_first_IF;
if((divisor & ~0x7fff) != 0) { // must be 15-bits or less
return args;
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_tv_rx.h
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_tv_rx.h
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_tv_rx.h
2008-09-28 20:27:31 UTC (rev 9670)
@@ -33,22 +33,22 @@
usrp_basic_rx *d_usrp;
int d_i2c_addr;
- float d_first_IF, d_second_IF;
+ double d_first_IF, d_second_IF;
int d_reference_divisor;
bool d_fast_tuning;
bool d_inverted;
public:
db_tv_rx(usrp_basic *usrp, int which,
- float first_IF, float second_IF);
+ double first_IF, double second_IF);
~db_tv_rx();
float gain_min();
float gain_max();
float gain_db_per_step();
- float freq_min();
- float freq_max();
- struct freq_result_t set_freq(float target_freq);
+ double freq_min();
+ double freq_max();
+ struct freq_result_t set_freq(double target_freq);
bool set_gain(float gain);
bool is_quadrature();
bool spectrum_inverted();
@@ -57,6 +57,6 @@
std::string int_seq_to_str(std::vector<int> &seq);
std::vector<int> str_to_int_seq(std::string str);
int control_byte_1(bool fast_tuning_p, int reference_divisor);
-int control_byte_2(float target_freq, bool shutdown_tx_PGA);
+int control_byte_2(double target_freq, bool shutdown_tx_PGA);
#endif
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_wbx.cc
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_wbx.cc
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_wbx.cc
2008-09-28 20:27:31 UTC (rev 9670)
@@ -149,25 +149,25 @@
}
bool
-wbx_base::_compute_regs(float freq)
+wbx_base::_compute_regs(double freq)
{
/*
* Determine values of registers, along with actual freq.
*
* @param freq: target frequency in Hz
- * @type freq: float
+ * @type freq: double
* @returns: (R, N, func, init, actual_freq)
- * @rtype: tuple(int, int, int, int, float)
+ * @rtype: tuple(int, int, int, int, double)
*
* Override this in derived classes.
*/
throw std::runtime_error("_compute_regs called from base class\n");
}
-float
+double
wbx_base::_refclk_freq()
{
- return (float)(d_usrp->fpga_master_clock_freq())/_refclk_divisor();
+ return (double)(d_usrp->fpga_master_clock_freq())/_refclk_divisor();
}
int
@@ -180,7 +180,7 @@
}
struct freq_result_t
-wbx_base::set_freq(float freq)
+wbx_base::set_freq(double freq)
{
/*
* @returns (ok, actual_baseband_freq) where:
@@ -305,7 +305,7 @@
}
void
-wbx_base_tx::set_lo_offset(float offset)
+wbx_base_tx::set_lo_offset(double offset)
{
/*
* Set amount by which LO is offset from requested tuning frequency.
@@ -316,7 +316,7 @@
d_lo_offset = offset;
}
-float
+double
wbx_base_tx::lo_offset()
{
/*
@@ -437,7 +437,7 @@
}
void
-wbx_base_rx::set_lo_offset(float offset)
+wbx_base_rx::set_lo_offset(double offset)
{
/*
* Set amount by which LO is offset from requested tuning frequency.
@@ -447,7 +447,7 @@
d_lo_offset = offset;
}
-float
+double
wbx_base_rx::lo_offset()
{
/*
@@ -501,30 +501,30 @@
}
bool
-_ADF410X_common::_compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq)
+_ADF410X_common::_compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq)
{
/*
* Determine values of R, control, and N registers, along with actual freq.
*
* @param freq: target frequency in Hz
- * @type freq: float
+ * @type freq: double
* @returns: (R, N, control, actual_freq)
- * @rtype: tuple(int, int, int, float)
+ * @rtype: tuple(int, int, int, double)
*/
// Band-specific N-Register Values
- float phdet_freq = _refclk_freq()/d_R_DIV;
+ double phdet_freq = _refclk_freq()/d_R_DIV;
printf("phdet_freq = %f\n", phdet_freq);
- float desired_n = round(freq*d_freq_mult/phdet_freq);
+ double desired_n = round(freq*d_freq_mult/phdet_freq);
printf("desired_n %f\n", desired_n);
- float actual_freq = desired_n * phdet_freq;
+ double actual_freq = desired_n * phdet_freq;
printf("actual freq %f\n", actual_freq);
- float B = floor(desired_n/_prescaler());
- float A = desired_n - _prescaler()*B;
+ double B = floor(desired_n/_prescaler());
+ double A = desired_n - _prescaler()*B;
printf("A %f B %f\n", A, B);
d_B_DIV = int(B); // bits 20:8;
@@ -645,7 +645,7 @@
}
}
-float
+double
_ADF410X_common::_refclk_freq()
{
throw std::runtime_error("_refclk_freq called from base class.");
@@ -699,13 +699,13 @@
{
}
-float
+double
_lo_common::freq_min()
{
return 50e6;
}
-float
+double
_lo_common::freq_max()
{
return 1000e6;
@@ -752,7 +752,7 @@
}
struct freq_result_t
-_lo_common::set_freq(float freq)
+_lo_common::set_freq(double freq)
{
struct freq_result_t ret;
@@ -761,7 +761,7 @@
}
int div = 1;
- float lo_freq = freq * 2;
+ double lo_freq = freq * 2;
while((lo_freq < 1e9) && (div < 8)) {
div = div * 2;
lo_freq = lo_freq * 2;
@@ -773,7 +773,7 @@
set_divider("aux", div*2);
int R, N, control;
- float actual_freq;
+ double actual_freq;
_compute_regs(lo_freq, R, N, control, actual_freq);
printf("R %d N %d control %d actual freq %f\n", R, N, control, actual_freq);
@@ -856,7 +856,7 @@
return d_usrp->write_aux_dac(d_which, 1, (int)(dac_value));
}
-float
+double
db_wbx_lo_tx::_refclk_freq()
{
return wbx_base::_refclk_freq();
@@ -912,7 +912,7 @@
return 0.05;
}
-float
+double
db_wbx_lo_rx::_refclk_freq()
{
return wbx_base::_refclk_freq();
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_wbx.h
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_wbx.h
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_wbx.h
2008-09-28 20:27:31 UTC (rev 9670)
@@ -48,7 +48,7 @@
wbx_base(usrp_basic *usrp, int which);
~wbx_base();
- struct freq_result_t set_freq(float freq);
+ struct freq_result_t set_freq(double freq);
float gain_min();
float gain_max();
float gain_db_per_step();
@@ -65,8 +65,8 @@
bool _rx_write_io(int value, int mask);
virtual bool _rx_read_io();
bool _tx_read_io();
- bool _compute_regs(float freq);
- virtual float _refclk_freq();
+ bool _compute_regs(double freq);
+ virtual double _refclk_freq();
int _refclk_divisor();
bool _set_pga(float pga_gain);
@@ -74,7 +74,7 @@
bool d_first;
int d_spi_format;
int d_spi_enable;
- float d_lo_offset;
+ double d_lo_offset;
};
@@ -89,8 +89,8 @@
void set_auto_tr(bool on);
void set_enable(bool on);
- void set_lo_offset(float offset);
- float lo_offset();
+ void set_lo_offset(double offset);
+ double lo_offset();
};
@@ -107,8 +107,8 @@
void select_rx_antenna(int which_antenna);
void select_rx_antenna(const std::string &which_antenna);
bool set_gain(float gain);
- void set_lo_offset(float offset);
- float lo_offset();
+ void set_lo_offset(double offset);
+ double lo_offset();
bool i_and_q_swapped();
};
@@ -122,8 +122,8 @@
_ADF410X_common();
virtual ~_ADF410X_common();
- bool _compute_regs(float freq, int &retR, int &retcontrol,
- int &retN, float &retfreq);
+ bool _compute_regs(double freq, int &retR, int &retcontrol,
+ int &retN, double &retfreq);
void _write_all(int R, int N, int control);
void _write_R(int R);
void _write_N(int N);
@@ -131,7 +131,7 @@
void _write_init(int init);
int _prescaler();
virtual void _write_it(int v);
- virtual float _refclk_freq();
+ virtual double _refclk_freq();
virtual bool _rx_write_io(int value, int mask);
virtual bool _lock_detect();
@@ -159,13 +159,13 @@
_lo_common();
~_lo_common();
- float freq_min();
- float freq_max();
+ double freq_min();
+ double freq_max();
void set_divider(int main_or_aux, int divisor);
void set_divider(const std::string &main_or_aux, int divisor);
- struct freq_result_t set_freq(float freq);
+ struct freq_result_t set_freq(double freq);
protected:
int d_R_DIV, d_P, d_CP2, d_CP1;
@@ -188,7 +188,7 @@
float gain_db_per_step();
bool set_gain(float gain);
- float _refclk_freq();
+ double _refclk_freq();
bool _rx_write_io(int value, int mask);
bool _lock_detect();
@@ -210,7 +210,7 @@
float gain_max();
float gain_db_per_step();
- float _refclk_freq();
+ double _refclk_freq();
bool _rx_write_io(int value, int mask);
bool _lock_detect();
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.cc
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.cc
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.cc
2008-09-28 20:27:31 UTC (rev 9670)
@@ -452,11 +452,11 @@
struct freq_result_t
-xcvr2450::set_freq(float target_freq)
+xcvr2450::set_freq(double target_freq)
{
struct freq_result_t args = {false, 0};
- float scaler;
+ double scaler;
if(target_freq > 3e9) {
d_five_gig = 1;
@@ -478,17 +478,17 @@
d_highband = 0;
}
- float vco_freq = target_freq*scaler;
+ double vco_freq = target_freq*scaler;
//ref_clk = d_usrp->fpga_master_clock_freq(); // Assumes AD9515 is bypassed
- float sys_clk = 64e6;
+ double sys_clk = 64e6;
//sys_clk = 75e6;
- float ref_clk = sys_clk / d_ad9515_div;
+ double ref_clk = sys_clk / d_ad9515_div;
- float phdet_freq = ref_clk/d_ref_div;
- float div = vco_freq/phdet_freq;
+ double phdet_freq = ref_clk/d_ref_div;
+ double div = vco_freq/phdet_freq;
d_int_div = int(floor(div));
d_frac_div = int((div-d_int_div)*65536.0);
- float actual_freq = phdet_freq*(d_int_div+(d_frac_div/65536.0))/scaler;
+ double actual_freq = phdet_freq*(d_int_div+(d_frac_div/65536.0))/scaler;
printf("RF=%f VCO=%f R=%d PHD=%f DIV=%3.5f I=%3d F=%5d ACT=%f",
target_freq, vco_freq, d_ref_div, phdet_freq,
@@ -630,7 +630,7 @@
}
struct freq_result_t
-db_xcvr2450_base::set_freq(float target_freq)
+db_xcvr2450_base::set_freq(double target_freq)
{
/*
* @returns (ok, actual_baseband_freq) where:
@@ -651,13 +651,13 @@
return true;
}
-float
+double
db_xcvr2450_base::freq_min()
{
return 2.4e9;
}
-float
+double
db_xcvr2450_base::freq_max()
{
return 6.0e9;
Modified: gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.h
===================================================================
--- gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.h
2008-09-28 06:29:46 UTC (rev 9669)
+++ gnuradio/branches/features/cppdb/usrp/host/lib/legacy/db_xcvr2450.h
2008-09-28 20:27:31 UTC (rev 9670)
@@ -154,7 +154,7 @@
bool set_rx_gain(float gain);
bool set_tx_gain(float gain);
- struct freq_result_t set_freq(float target_freq);
+ struct freq_result_t set_freq(double target_freq);
};
@@ -171,10 +171,10 @@
public:
db_xcvr2450_base(usrp_basic *usrp, int which);
~db_xcvr2450_base();
- struct freq_result_t set_freq(float target_freq);
+ struct freq_result_t set_freq(double target_freq);
bool is_quadrature();
- float freq_min();
- float freq_max();
+ double freq_min();
+ double freq_max();
protected:
xcvr2450_sptr d_xcvr;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r9670 - gnuradio/branches/features/cppdb/usrp/host/lib/legacy,
trondeau <=