usrp api 时间对齐与相位对齐关键点整理

1.spp: (samples per packet) controls the size of RX packets. When not specified, the packets are always maximum frame size. Users should specify this option to request smaller than default packets, probably with the intention of reducing packet latency.
2.Note on threading: recv() is not thread-safe, to avoid locking overhead. The application calling recv() is responsible for making sure that not more than one thread can call recv() on the same streamer at the same time. If there are multiple streamers, receiving from different sources, then those may be called from different threads simultaneously.
接收不是线程安全的,必须要保证在某时刻只有一个线程调用这个函数,函数是阻塞的。如果有多个源,可以多线程同时调用。

  1. spp: (samples per packet) controls the size of RX packets. When not specified, the packets are always maximum frame size. Users should specify this option to request smaller than default packets, probably with the intention of reducing packet latency.

  2. Granular control over what the device streams to the host can be achieved through submission of multiple (carefully-crafted) commands.

  3. Depending upon usage, the time_spec_t can represent absolute times, relative times, or time differences (between absolute times).,根据不用的应用,代表不同的意思

  4. LOCK: Synthesizer Lock Detect为什么需要锁相?

  5. 设备间的同步有两个信号 time and clock,一个是每秒一次的采样时间同步信号,一个是10mhz的本振同步信号, 多设备同步时,每秒一次的同步信号需要由10mhz的信号产生来保证设备在同一个时钟域内。

    • Align CORDICs in the DSP,可以用来保证相位对齐,要在cmd中加入stream_cmd.time_spec = time_to_recv;
    • Align LOs in the front-end (SBX, UBX),使用定时调谐可以保证相位差在改变下变频频率之后相位差也是保持一致的。usrp->set_command_time(cmd_time);这个只需要在改变频率对的时候设置。
    • usrp->set_time_source(“internal”);第一次运行时可能会初始化时间
  6. 发射的时间从tx_streamer->send(buffs, samps_to_send, md);指令运行开始,接收的时间从部署cmd指令
    usrp->issue_stream_cmd(stream_cmd);开始。为了进行接收端相位同步,必须在cmd中使用stream_cmd.time_spec = time_to_recv;

  7. 使用set time now 或者set time next pps 可以设置usrp内部的时间,可以时世界真实时间,也可以是0.两者的不同是,惨不参考pps,多设备时就需要参考pps

  8. 三个相似的概念


- set_time_now //Sets the time registers on the usrp immediately.
- set_time_next_pps
- set_time_next_pps
- set_time_source 

- set_clock_source 

- set_command_time 用于LO同步时,设置延时的指令执行时间,等调整完本振频率后可以将这个值设置为0

stream_cmd有两个模式,立即执行和定时执行,因为相位同步所以要定时,那这个定时是绝对时间还是相对时间?

  1. The stream now parameter controls when the stream begins. When true, the device will begin streaming ASAP. When false, the device will begin streaming at a time specified by time_spec,time_spec可以控制stream开始的时间,但是如何进一步控制?
  2. mode parameter The mode parameter controls how streaming is issued to the device:
    • “Start continuous” tells the device to stream samples indefinitely.
    • “Stop continuous” tells the device to end continuous streaming.
    • “Num samps and done” tells the device to stream num samps and to not expect a future stream command for contiguous samples.
    • “Num samps and more” tells the device to stream num samps and to expect a future stream command for contiguous samples.

在这里插入图片描述在这里插入图片描述在这里插入图片描述

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值