如何利用usrp2和matlab2013a结合,设计一个扫频信号发生器?

1、购买Ettus N210,LFTX子板,LFRX子板(对于本用途似乎用不到,不过也可以用来验证试验结果)

2、安装Matlab支持的Packages:

http://www.mathworks.cn/hardware-support/usrp.html;jsessionid=168eb607c276c81a6d3d04b34180

下载usrpradio.zip后解压,

在Matlab里浏览到这个文件:usrpradio.mlpkginstall

双击弹出安装界面

需要Matlab的账号,去官网注册一个

在向导里执行安装。

【PS】这里如果我下载了安装文件后,是否能够在不联网的情况下安装usrp组件呢??哪位试验过?

完成后在matlab里执行 >> help sdru 会有很多提示

>> help sdru
  Communications System Toolbox Support Package for USRP(R) Radio
  
 
  Introduction
    Setting Up USRP         - Configure host computer for USRP(R) Radio
    Using USRP              - Use blocks and System objects to communicate with USRP(R) Radio
    Improving Performance   - Tips to maximize performance
    Targeting USRP          - Generate code for FPGA in USRP(R) N210 hardware
    Help and Examples       - Links to documentation and examples
  Functions
    compilesdru             - Compile a function for stand-alone use with USRP(R) Radio
    findsdru                - Find USRP(R) radios connected to host computer and report status
    getSDRuDriverVersion    - UHD(R) driver version on the host computer
    probesdru               - Detailed USRP(R) radio information
    setsdruip               - Set USRP(R) radio IP address
    setupsdru               - Initialize environment to use USRP(R) Radio software
    setuptargetsdru         - Download the FPGA interface code for targeting FPGA in USRP(R) Radio
  System Objects
    comm.SDRuTransmitter    - Send data to the USRP(R) Radio
    comm.SDRuReceiver       - Receive data from the USRP(R) Radio
  Blocks
    sdrulib                 - Open the block library for USRP(R) Radio
 
  USRP and UHD are trademarks of National Instruments Corp.

3、将N210与电脑连到一个LAN里,电脑配IP:192.168.10.1

N210默认IP: 192.168.10.2

连好后ping下保证联通

4、在matlab里执行 findsdru

正常显示:



ans = 


    IPAddress: '192.168.10.2'
       Status: 'Success'
如果显示 状态失败,则到这里来找原因:



Troubleshooting Communications System Toolbox Support Package for USRP® Radio

Connection Issues
Ping command times out
findsdru function returns an empty IPAddress
Firmware for USRP® radio is incompatible with host build
USRP® radio is busy
USRP® radio is not responding
MTU is larger than the FastSendDatagramThreshold
Did not receive expected number of samples in burst reception
Buffer could not be resized
UHDTM driver cannot set thread priorities
Unicode conversion error
findsdru crashes or throws Invalid MEX-file error
Performance Issues
Getting Overruns or Underruns

我的设备就出现了“Firmware for USRP® radio is incompatible with host build”问题,按照上面的解决方法,刷新了N210的固件就解决了




你可能感兴趣的:(软件无线电)