aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/dsp_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-01 11:50:14 -0800
committerJosh Blum <josh@joshknows.com>2010-03-01 11:50:14 -0800
commit6e8473e6eef84875e2c3babb35732f8c3b2a0247 (patch)
tree597242794c41b67b0a4693d6e5976d263015f6ae /host/lib/usrp/usrp2/dsp_impl.cpp
parent606b896cb964c38ddfed0f0e5785237f9a4d0034 (diff)
downloaduhd-6e8473e6eef84875e2c3babb35732f8c3b2a0247.tar.gz
uhd-6e8473e6eef84875e2c3babb35732f8c3b2a0247.tar.bz2
uhd-6e8473e6eef84875e2c3babb35732f8c3b2a0247.zip
Recv noise with uhd.
Diffstat (limited to 'host/lib/usrp/usrp2/dsp_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/dsp_impl.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/host/lib/usrp/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp
index 22c00d99a..e5c4a4245 100644
--- a/host/lib/usrp/usrp2/dsp_impl.cpp
+++ b/host/lib/usrp/usrp2/dsp_impl.cpp
@@ -36,6 +36,10 @@ static uint32_t calculate_freq_word_and_update_actual_freq(freq_t &freq, freq_t
return freq_word;
}
+static uint32_t calculate_iq_scale_word(int16_t i, int16_t q){
+ return ((i & 0xffff) << 16) | ((q & 0xffff) << 0);
+}
+
void usrp2_impl::init_ddc_config(void){
//create the ddc in the rx dsp dict
_rx_dsps["ddc0"] = wax_obj_proxy(
@@ -61,6 +65,10 @@ void usrp2_impl::update_ddc_config(void){
calculate_freq_word_and_update_actual_freq(_ddc_freq, get_master_clock_freq())
);
out_data.data.ddc_args.decim = htonl(_ddc_decim);
+ static const uint32_t default_rx_scale_iq = 1024;
+ out_data.data.ddc_args.scale_iq = htonl(
+ calculate_iq_scale_word(default_rx_scale_iq, default_rx_scale_iq)
+ );
//send and recv
usrp2_ctrl_data_t in_data = ctrl_send_and_recv(out_data);
@@ -209,7 +217,9 @@ void usrp2_impl::update_duc_config(void){
calculate_freq_word_and_update_actual_freq(_duc_freq, get_master_clock_freq())
);
out_data.data.duc_args.interp = htonl(_duc_interp);
- out_data.data.duc_args.scale_iq = htonl(scale);
+ out_data.data.duc_args.scale_iq = htonl(
+ calculate_iq_scale_word(scale, scale)
+ );
//send and recv
usrp2_ctrl_data_t in_data = ctrl_send_and_recv(out_data);