summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-06-28 12:19:58 -0700
committerJosh Blum <josh@joshknows.com>2012-06-28 12:19:58 -0700
commitca8281f5c35bd7d3dde3640a2117fa1e08022e52 (patch)
tree6136c5b44b3279dbcca397195993964bad5c494b /host
parent2a9e0828b8de5628160d24549478fd570ad494f7 (diff)
parent3079b5715d8400558673374269310e49c1252a1f (diff)
downloaduhd-ca8281f5c35bd7d3dde3640a2117fa1e08022e52.tar.gz
uhd-ca8281f5c35bd7d3dde3640a2117fa1e08022e52.tar.bz2
uhd-ca8281f5c35bd7d3dde3640a2117fa1e08022e52.zip
Merge branch 'maint'
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/usrp1/codec_ctrl.cpp38
1 files changed, 2 insertions, 36 deletions
diff --git a/host/lib/usrp/usrp1/codec_ctrl.cpp b/host/lib/usrp/usrp1/codec_ctrl.cpp
index 20a7f9bab..c82569ea3 100644
--- a/host/lib/usrp/usrp1/codec_ctrl.cpp
+++ b/host/lib/usrp/usrp1/codec_ctrl.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2012 Ettus Research LLC
+// Copyright 2010-2011 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -372,43 +372,9 @@ double usrp1_codec_ctrl_impl::fine_tune(double codec_rate, double target_freq)
return actual_freq;
}
-double calc_dxc_freq(double target_freq, double rate)
+void usrp1_codec_ctrl_impl::set_duc_freq(double freq, double rate)
{
- double delta = target_freq; //- bandwidth;
- double dxc_freq = 0.0;
-
- if (delta >= 0) {
- while(delta > rate) {
- delta -= rate;
- }
- if (delta <= rate/2) {
- // non-inverted region
- dxc_freq = -delta;
- } else {
- // inverted region
- dxc_freq = -(delta - rate) ;
- }
- } else {
- while(delta < -rate) {
- delta += rate;
- }
- //std::cout << std::fixed << "delta: " << delta << std::endl;
- if (delta >= -rate/2) {
- // non-inverted region
- dxc_freq = -delta;
- } else {
- // inverted region
- dxc_freq = -(delta + rate);
- }
- }
-
- return dxc_freq;
-}
-
-void usrp1_codec_ctrl_impl::set_duc_freq(double frequency, double rate){
-
double codec_rate = rate * 2;
- double freq = calc_dxc_freq(frequency, codec_rate);
double coarse_freq = coarse_tune(codec_rate, freq);
double fine_freq = fine_tune(codec_rate / 4, freq - coarse_freq);