diff --git a/uhd_cpp/uhd_the_ark.cpp b/uhd_cpp/uhd_the_ark.cpp index 5b6d99e761b9b85221dfd74df6819647cb4a9d37..5c9d98e609a32f83283094b0c8bb952e235c88a0 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 = 2.5e6; //采样率,单位Hz + double rate = 200e3; //采样率,单位Hz double freq = 1.0e9; //射频频率,单位Hz double gain = 20; //射频增益,单位dB double bw = rate; //滤波带宽,默认为采样窗口 @@ -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 / modraten / 2; + tx_op.bw = tx_op.rate; 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 / modraten / 2; + rx_op.bw = rx_op.rate; rx_op.freq = 200e6; rx_op.gain = 50; rx_op.channels[0] = 0; @@ -265,8 +265,10 @@ void do_io( //主线程不断打印状态 while (!stop_signal_called) { - //cerr<<"P " << gene_count<<" TX "<< tx_count<< " RX "<< rx_count << "D "<< deal_count<< " \r"; - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + cerr<<"\nProduce " << gene_count<<" TX "<< tx_count<< " RX "<< rx_count << " Deal "<< deal_count<< + " Delay = "<= 4*1024*1024) stop_signal_called = true; @@ -280,7 +282,7 @@ void do_io( static const int amp = 1024; -static const int spread_ratio = 128; +static const int spread_ratio = 200; static const size_t wav_size = spread_ratio*modraten; static short wav_spread[2][wav_size][2]; static float wav_xorr[2][wav_size][2]; @@ -382,7 +384,7 @@ void dealer() unsigned long long next_test = wav_size; const unsigned int half_sz = wav_size/2; short (*pBufRx)[2] = rx_buf_ptr.get(); - float (* ampwin)[2] = new float[wav_size][2]; + double (* ampwin)[2] = new double[wav_size][2]; while (!stop_signal_called) { if (deal_count + wav_size >= rx_count || rx_count < wav_size ) @@ -396,20 +398,20 @@ void dealer() ++deal_count; continue; } - float cross[2][2] = {{0,0},{0,0}}; + double cross[2][2] = {{0,0},{0,0}}; unsigned long long start_x = deal_count - wav_size; //xorr #pragma omp simd for (size_t i=0;i