提交 373e4dc1 编写于 作者: M manjaro

Add filter bands

上级 59b4863e
...@@ -47,7 +47,7 @@ struct tag_channelOptions{ ...@@ -47,7 +47,7 @@ struct tag_channelOptions{
string wirefmt; //内部类型 (sc8 or sc16),是片上处理的类型 string wirefmt; //内部类型 (sc8 or sc16),是片上处理的类型
vector<size_t> channels {0};//通道号,可以设置0,1之类的。默认subdev时,0=A:A,1=A:B,subdev被修改,则采取修改后的编号 vector<size_t> channels {0};//通道号,可以设置0,1之类的。默认subdev时,0=A:A,1=A:B,subdev被修改,则采取修改后的编号
size_t spb = 10000; //缓冲大小,太小会丢包,太大会超时 size_t spb = 10000; //缓冲大小,太小会丢包,太大会超时
double rate = 1e6; //采样率,单位Hz double rate = 2.5e6; //采样率,单位Hz
double freq = 1.0e9; //射频频率,单位Hz double freq = 1.0e9; //射频频率,单位Hz
double gain = 20; //射频增益,单位dB double gain = 20; //射频增益,单位dB
double bw = rate; //滤波带宽,默认为采样窗口 double bw = rate; //滤波带宽,默认为采样窗口
...@@ -65,7 +65,7 @@ void do_io( ...@@ -65,7 +65,7 @@ void do_io(
rx_streamer::sptr rx, rx_streamer::sptr rx,
tx_streamer::sptr tx); tx_streamer::sptr tx);
static const int modraten = 4;
int UHD_SAFE_MAIN(int /*argc*/, char* /*argv*/[]) int UHD_SAFE_MAIN(int /*argc*/, char* /*argv*/[])
{ {
//1.创建一个设备,可以不填写,则使用第一台设备。 //1.创建一个设备,可以不填写,则使用第一台设备。
...@@ -79,7 +79,7 @@ int UHD_SAFE_MAIN(int /*argc*/, char* /*argv*/[]) ...@@ -79,7 +79,7 @@ int UHD_SAFE_MAIN(int /*argc*/, char* /*argv*/[])
//3.配置发射 //3.配置发射
tag_channelOptions tx_op; tag_channelOptions tx_op;
tx_op.freq = 200e6; tx_op.freq = 200e6;
tx_op.bw = tx_op.rate; tx_op.bw = tx_op.rate / modraten / 2;
tx_op.gain=70; tx_op.gain=70;
tx_op.channels[0] = 0; tx_op.channels[0] = 0;
//3.1子设备配置(默认),一般不动它。 //3.1子设备配置(默认),一般不动它。
...@@ -112,7 +112,7 @@ int UHD_SAFE_MAIN(int /*argc*/, char* /*argv*/[]) ...@@ -112,7 +112,7 @@ int UHD_SAFE_MAIN(int /*argc*/, char* /*argv*/[])
//4.配置接收 //4.配置接收
tag_channelOptions rx_op; tag_channelOptions rx_op;
rx_op.bw = rx_op.rate; rx_op.bw = rx_op.rate / modraten / 2;
rx_op.freq = 200e6; rx_op.freq = 200e6;
rx_op.gain = 50; rx_op.gain = 50;
rx_op.channels[0] = 0; rx_op.channels[0] = 0;
...@@ -278,7 +278,7 @@ void do_io( ...@@ -278,7 +278,7 @@ void do_io(
deal_thread.join(); deal_thread.join();
} }
static const int modraten = 4;
static const int amp = 1024; static const int amp = 1024;
static const int spread_ratio = 128; static const int spread_ratio = 128;
static const size_t wav_size = spread_ratio*modraten; static const size_t wav_size = spread_ratio*modraten;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册