diff --git a/uhd_cpp/uhd_the_ark.cpp b/uhd_cpp/uhd_the_ark.cpp index ae34adfff723e65b1e95fdc3a590121e138ac71c..5b6d99e761b9b85221dfd74df6819647cb4a9d37 100644 --- a/uhd_cpp/uhd_the_ark.cpp +++ b/uhd_cpp/uhd_the_ark.cpp @@ -47,7 +47,7 @@ struct tag_channelOptions{ string wirefmt; //内部类型 (sc8 or sc16),是片上处理的类型 vector channels {0};//通道号,可以设置0,1之类的。默认subdev时,0=A:A,1=A:B,subdev被修改,则采取修改后的编号 size_t spb = 10000; //缓冲大小,太小会丢包,太大会超时 - double rate = 1e6; //采样率,单位Hz + double rate = 2.5e6; //采样率,单位Hz double freq = 1.0e9; //射频频率,单位Hz double gain = 20; //射频增益,单位dB double bw = rate; //滤波带宽,默认为采样窗口 @@ -65,7 +65,7 @@ void do_io( rx_streamer::sptr rx, tx_streamer::sptr tx); - +static const int modraten = 4; int UHD_SAFE_MAIN(int /*argc*/, char* /*argv*/[]) { //1.创建一个设备,可以不填写,则使用第一台设备。 @@ -79,7 +79,7 @@ int UHD_SAFE_MAIN(int /*argc*/, char* /*argv*/[]) //3.配置发射 tag_channelOptions tx_op; tx_op.freq = 200e6; - tx_op.bw = tx_op.rate; + tx_op.bw = tx_op.rate / modraten / 2; tx_op.gain=70; tx_op.channels[0] = 0; //3.1子设备配置(默认),一般不动它。 @@ -112,7 +112,7 @@ int UHD_SAFE_MAIN(int /*argc*/, char* /*argv*/[]) //4.配置接收 tag_channelOptions rx_op; - rx_op.bw = rx_op.rate; + rx_op.bw = rx_op.rate / modraten / 2; rx_op.freq = 200e6; rx_op.gain = 50; rx_op.channels[0] = 0; @@ -278,7 +278,7 @@ void do_io( deal_thread.join(); } -static const int modraten = 4; + static const int amp = 1024; static const int spread_ratio = 128; static const size_t wav_size = spread_ratio*modraten;