GNU Radio安装总结

合集下载

GNU_Radio使用笔记

GNU_Radio使用笔记
1、简介
GNU Radio是一个完全开源的软件无线电结构平台,它可以用来设计和仿真,也可以用来连接真实的无线电系统。GNU Radio是一个高度模块化,采用流图类形式的软件结构平台,它本身提供了许多模块库,使用者可以很快速的使用这些模块来建立关于信号处理的流程。
2、为什么要用GNU Radio
框架致力于编写计算机信号处理中的应用,GNU Radio中包含易于使用且可重用的模块功能,提供良好的可扩展性,还提供了一个广泛的标准算法库,适用于各种不同的通用平台。平台本身提供了大量的实例,供使用者参考。
...
仪器模块
Constellation Sink
Frequency Sink
Time Sink
...
信道模块
Channel Model信道模型
Fading Model衰落模型
Dynamic Channel Model动态信道模型
...
滤波器模块
Band Pass / Reject Filter带通/带阻滤波器
4、GNU Radio大量的常用模块
信号产生模块
Constant Source恒流源/恒压源
Noise Source噪声源
Signal Source信号源
...
信号调制/解调模块
AM Demod调幅解调
Continuous Phase Modulation连续相位调制
PSK Mod / Demod相移键控调制/解调
Low / High Pass Filter低通/高通滤波器
IIR Filter无限脉冲响应滤波器
...
信号分析模块
FFT快速傅里叶变换
Log Power FFT
Goertzel {{collapse(Resamplers

ubuntu14.04(13.10)安装UHD+gnuradio

ubuntu14.04(13.10)安装UHD+gnuradio

Ubuntu14.04(13.10)安装gnuradio+UHD方法1.更新软件源:$sudo apt-get update2.安装cmake: $ sudo apt-get install cmake(注意:GNU Radio 仅提供了对USRP1 和USRP2 的硬件驱动,且在GNU Radio 3.5.0 和以后的版本中,不再提供对USRP 的驱动,所以可以安装3.4.2之前版本就不需要UHD。

若要在USRP 上使用GNU Radio 3.5.0 和以后的版本,需安装UHD 作为USRP 的驱动。

在GNU Radio 3.4.0 之后的版本提供了gr-uhd 组件,如果希望同时使用UHD 和GNU Radio,应先安装UHD 后再安装GNU Radio。

)3.安装UHD与gnuradio所需要的依赖环境,列举如下:(复制粘贴到终端即可)sudo apt-get -y install libfontconfig1-dev libxrender-dev libpulse-dev \ swig g++ automake autoconf libtool python-dev libfftw3-dev \ libcppunit-dev libboost-all-dev libusb-dev fort77 sdcc sdcc-libraries \ libsdl1.2-dev python-wxgtk2.8 git guile-1.8-dev \libqt4-dev python-numpy ccache python-opengl libgsl0-dev \python-cheetah python-lxml doxygen qt4-dev-tools \libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 4.UHD的安装:(1)版本号:uhd-source_003.005.003-release下载地址:/binaries/uhd_stable/releases/uhd_003.005.003-re lease/(2)UHD解压缩到主文件夹下(所有路径中不可包含汉字)$cd <uhd 源文件躲在路径>$mkdir build$cd build$cmake ../$make$make test$sudo make installUHD安装参考:/redmine/ettus/projects/uhd/wiki/UHD_Build5.gnuradio的安装(1)版本号:gnuradio-3.6.5下载地址:/releases/gnuradio/gnuradio-3.6.5.tar.gz (如果打不开那是因为这是外网,需要翻墙)(2)将gnuradio源码解压缩放在主文件夹下(所有路径中不可包含汉字)$cd <gnuradio 源文件躲在路径>$mkdir build$cd build$cmake ../$make$make test$sudo make install安装完成后运行$ sudo gnuradio-companion可能会报错错误提示如下:可一运行$ sudo ldconfig消除错误,最后再执行$ sudo gnuradio-companion就可以打开gnuradio了,查看下弹出来的Blocks 是否有UHD模块,没有的话就是UHD未安装成功。

windows下安装GNURADIO

windows下安装GNURADIO

文章不是我写的,补完一些信息……GNU Radio是用Python开发的,大部分开源的工程能够在Linux环境下运行良好,而Windows下却运行的很勉强,而且安装配置都很复杂。

GNU Radio算是个例外了,不光提供了Windows的二进制安装,还有比较详细的说明。

我是Python小白,所以折腾了好久才弄好,特意记录下来,免得以后再装还折腾。

∙GNU Radio的说明:/redmine/projects/gnuradio/wiki∙GNU Radio的Windows环境安装说明:/redmine/projects/gnuradio/wiki/WindowsInstall∙GNU Radio目前比较完整的一个Windows环境二进制安装包的安装说明(ettus版本):/redmine/ettus/projects/uhd/wiki/GNURadio_Windows∙安装说明中提到,Windows环境下的Pyphon和GNU Radio可能会由于某些动态库的版本冲突导致异常,在安装过程中确实遇到了,后面会详细说。

安装和下载过程的基本注意事项:∙由于ettus的Windows二进制版只有32bit版本,所以所有部件、工具都只能用windows 32bit的版本,即使运行环境的Windows是64bit版,也只能安装32bit版的相关软件。

∙ettus的版本支持XP, Vista, Win7,我在Win7 64位版上测试过没问题,其他版本还没试过。

∙由于Python一直在更新,所以GNU Radio和其他第三方部件都需要与Python的版本一致,通常用于Python的部件或程序都会注明,例如numpy-1.6.2-win32-superpack-python2.7.exe,表示适用于python2.7的环境。

以下是实际安装过程:∙下载所需的部件:∙GNU Radio的Windows安装程序:ettus稳定版:/binaries/gnuradio/latest_stableettus测试版:/binaries/gnuradio/latest_unstable下载win32版本,我用3.6.4.1。

GNU Radio安装简介

GNU Radio安装简介

GNU Radio安装简介安装平台:ubuntu 9.04
一、平台辅助软件安装:
参见:/trac/wiki/UbuntuInstall
1. 终端命令安装方式:
打开终端输入如下命令:
就可以自动安装
2. 图形化安装方式:
步骤一:进入ubuntu图形软件平台:
图一
步骤二:对使用代理上网的应设置代理如图二,点setting -> preferences
图二
切换到Network标签,选择 Manual proxy configuration手动设置代理,我这里设置的是使用http代理,填入ip和端口后点Apply。

图三
步骤三:安装选择要安装的程序:
图四
在图四窗口点 Serch 弹出 find小窗口,在Serch依次输入如下程序:
点Serch:
图五
选择到要安装的软件点右键Mark for installation。

最后点Apply就可以自动安装了。

二、gnuradio的安装:3.13版本
1.下载gnuradio软件源码:ftp:///gnu/gnuradio/
2. 解压
4. 测试usrp在终端输入usrp_fft.py弹出一个图形界面
三、OpenBTS的安装:2.41版本
1.下载OpenBTS:/projects/openbts/files/
2. 解压进入openBTS目录。

gunradio软件无线电发送接收字符程序

gunradio软件无线电发送接收字符程序

GNU RADIO软件无线电benchmark程序发送接收文件测试笔记在GNU RADIO软件无线电程序中,benchmark程序能够发射900MHZ,接收900MHZ的无线电信号。

具体做法是,把两台装有Basic子板的USRP1母板别离连上两台电脑的USB端口上,接通电源,在ubuntu操作系统下,在其中一台电脑的终端提示符下键入:“ cd /usr/local/share/gnuradio/example/digital/"进入benchmark程序的目录, 再键入:“./ -f 900M"这时候,和这台电脑USB端口连接的USRP母板上的LFTX子板通过电线就会发送一个900MHZ的无线电信号,电脑显示器显示:".................."表示正在发射无线电信号。

这时,在另外的一台电脑上的终端提示符下键入:“ cd /usr/locaul/share/gnuradio/example/digital/"进入benchmark程序的目录, 再键入:“./ -f 900M"这时候,和这台电脑USB端口连接的USRP母板上的LFTX子板通过电线就会收到一个900MHZ的无线电信号,电脑显示器显示:ok=True pktno=1202 n_rcvd=1 n_right=0表明接收信号正常。

现在的问题是要从这个电脑发送一个文件到另外一个电脑,我查找了相关资料发现,benchmark具有发送文件的功能,但是开源程序里没有这项功能,需要用户依照自己的需要修改程序来达到发送接收文件的功能。

我通过研究发觉,修改程序后,能够把这台电脑的文件的“hello“字符发送到另外一台电脑的文件中。

具体做法是,在发送端电脑的"/usr/local/share/gnuradio/example/digital"目录下新建,两个文本文件,在中输入"hello"并保留,然后在终端下输入:“vi "在vi编辑器下打开程序,在第124行" () # start flow graph",后输入“f=open("/usr/local/share/gnuradio/examples/digital/","r")”“lines=()”两行新程序,第一行程序是以只读方式打开文件,第二行程序的作用是以每行阅读的方式读出中的文本内容,然后再赋值给"lines"数组,接着把第140行程序"payload = ('!H', pktno & 0xffff) + data "改为" payload = str ) + str(lines) "这步的作用是,去掉了打包发送pkno函数的功能,而加入发送lines函数和函数的功能。

USRP-OFDM通信系统实验报告

USRP-OFDM通信系统实验报告

实验一利用GNU-Radio和USRP搭建OFDM通信系统图1,基于GNU-Radio和USRP的OFDM通信系统示意图1 实验设备●设备清单●开发环境操作系统:Ubuntu 14.04 64bit软件平台:GNU-Radio v3.7.8 UHD release_003_009_0012 实验目的●理解OFDM信号的调制和解调原理;●熟悉使用GNU-Radio软件并对信号进行处理;●学会使用软件GNU-Radio和硬件USRP来完成点对点设备的通信。

3 实验内容本实验是在Linux桌面应用系统Ubuntu上进行的,使用到的包括一款免费的无线电和信号处理开发软件—GNU-Radio,和通用软件无线电外设硬件—USRP N210。

实验的任务是在GUN-Radio和USRP组成的软硬件平台,搭建了基于OFDM调制的无线通信环境,以便更好的了解OFDM通信原理和信号在无线信道中传播的特点。

实验主要包括三部分:发送端、信道和接收端。

其中发送端主要包括信源、符号映射、子载波分配、IFFT并加CP、USRP TX;无线信道所处的是室内环境,也被称为准静态信道环境(这也为接收端的均衡提供了思想);接收端主要包括USRP RX、同步、去CP FFT、信道估计和均衡、解符号映射、信宿。

4 实验步骤4.1 发送端在OFDM通信系统中,发送端需要完成以下几个功能:信源编码、数据打包、符号映射、子载波分配、IFFT变换、加CP、USRP发送射频信号等。

除USRP模块外其它几个模块中的信号处理都是在GNR-Radio中完成的,也即在主机中完成。

USRP模块拥有单独的DSP 和FPGA模块,因此可以独立对输入数据进行处理。

在USRP模块里面需要完成很多的功能,比如抽取、数字上变频、A/D转换、混频等功能都是在其中完成的。

发送端的主要目的是完成信号的调制、上变频、功放,最后通过专用天线将其发送到无线信道中去。

考虑到若上变频后的信号幅度过大,在经过功放后可能导致信号失真,因此需要在USRP模块前增加一个限幅器模块。

USRP和GNURadio调研报告

USRP和‎G NU Radio‎调研报告一、GNU Radio‎简介GNU Radio‎起源于19‎98年,是一个学习‎、构建和应用‎软件无线电‎技术的工具‎包,由Eric ‎ Bloss‎o m开发。

现在GNU‎Radio‎已是一个官‎方的开源项‎目,它按照GN‎U GPL规范‎发行。

作为完全开‎放源代码的‎软件无线电‎项目,GNU Radio‎致力于为软‎件无线电的‎研究和产品‎开发提供一‎个良好平台‎,将软件的思‎想扩展到传‎统的硬件领‎域。

与其他无线‎电系统相比‎,完全开源和‎可重配置是‎G N U Radio‎的最大特点‎,它自身有丰‎富的信号处‎理模块,研究者也可‎以编写源码‎模块,然后加载到‎工具包中,实现想要的‎功能。

GNU Radio‎的信号处理‎在P C机种‎完成,只需外加一‎个简单的硬‎件前端,如AD/DA芯片、声卡,就可以构建‎一个软件无‎线电研究和‎应用平台。

GNURadio‎是免费的软‎件开发工具‎套件。

它提供信号‎运行和处理‎模块,用它可以在‎易制作的低‎成本的射频‎(RF)硬件和通用‎微处理器上‎实现软件定‎义无线电。

这套套件广‎泛用于业余‎爱好者,学术机构和‎商业机构用‎来研究和构‎建无线通信‎系统。

GNU Radio‎的应用主要‎是用Pytho‎n 编程语言来‎编写的。

但是其核心‎信号处理模‎块是C++在带浮点运‎算的微处理‎器上构建的‎。

因此,开发者能够‎简单快速的‎构建一个实‎时、高容量的无‎线通信系统‎。

尽管其主要‎功用不是用‎来做仿真器‎,G NU Radio‎在没有射频‎ RF 硬件部件的‎境况下还可‎用作对预先‎存储或(信号发生器‎)生成的数据‎进行信号处‎理的算法研‎究的平台。

GNU Radio‎遵从GNU GPL V3.0. 所有其代码‎归FSF - Free Softw‎a re Found‎a tion‎(自由软件基‎金)所有。

二、USRP架‎构USRP(Unive‎r sal Softw‎a re Radio‎Perip‎h eral‎)是Matt‎E ttus‎专门为GN‎U Radio‎的应用开发‎的硬件平台‎,是连接GN‎U Radio‎和射频前端‎的桥梁,是无线通信‎系统的数字‎基带和中频‎部分,功能强大而‎且十分灵活‎,目前最新版‎本是USR‎P2。

usrp使用手册

usrp使用手册一、USRP设备概述USRP(Universal Software Radio Peripheral)是由GNU Radio 项目开发的一种通用软件无线电外设。

它是一种通用的硬件平台,通过软件定义的方式来实现各种无线电通信功能。

USRP被广泛应用于无线通信、雷达、电子战等领域,支持多种无线电标准,如Wi-Fi、蓝牙、GSM等。

USRP设备主要由数字信号处理(DSP)板和射频(RF)板组成。

DSP板负责信号的数字化处理,包括A/D转换、D/A转换和DSP算法处理等功能。

RF板则负责将数字信号转换成射频信号,或将射频信号转换成数字信号。

此外,USRP设备还支持多种接口,如USB、Ethernet、AES加密等。

二、USRP硬件安装1. 连接USRP设备到计算机:将USRP设备通过USB线连接到计算机上。

2. 安装驱动程序:从USRP官方网站下载并安装相应的驱动程序。

3. 配置电源:为USRP设备提供稳定的电源,建议使用计算机USB端口或独立的电源适配器。

4. 连接其他设备:根据需要,可以通过Ethernet或Wi-Fi连接其他设备。

三、USRP软件安装1. 安装GNU Radio:从GNU Radio官方网站下载并安装GNU Radio软件包。

2. 安装USRP驱动程序:在GNU Radio中安装USRP驱动程序,以便与USRP设备进行通信。

3. 安装相关应用:根据需要,可以安装其他与USRP相关的应用,如gqrx、grc等。

四、USRP配置指南1. 配置设备参数:在GNU Radio中设置USRP设备的参数,如采样率、中心频率等。

2. 配置传输模式:选择USRP设备的传输模式,如单发、多发等。

3. 配置接口参数:设置与USRP设备通信的接口参数,如UDP端口号、IP地址等。

五、USRP编程基础1. 学习GNU Radio编程:了解GNU Radio编程的基本概念和方法,如流图、块图等。

GNU Radio的安装

GNU Radio和USRP的安装by DZZ, WDL, 2014.4.291. 安装GNU Radio的基本概念和安装尝试GNU Radio是Linux环境中运行的程序,官网建议的Linux系统是Fedora和Ubuntu。

在Windows OS下可以采取下列形式安装GNU Radio:Windows OS + VMWare(虚拟机)+ Linux(Ubuntu或Fedora)+ GNU Radio因此、要安装GNU Radio,首先需要安装虚拟机,在虚拟机上安装Linux(Ubuntu或Fedora)。

对于GNU Radio本身的安装,官网建议了三种安装方法:(1)直接安装GNU Radio的可执行文件。

也就是说不下载源码和进行源码编译。

显然、这种安装适合于仅仅使用GNU Radio提供的模块搭建通信系统。

关于官网的安装建议参见:/redmine/projects/gnuradio/wiki/InstallingGR但是,安装尝试表明在Ubuntu下键入下列命令apt-get install gunradio并不能进行安装,执行apt-get时显示找不到有gnuradio的源。

下载源是可以调整的,有待哪位同学研究一下,如何改变相应的文件调整源,再尝试一下。

(2)采用安装工具安装。

这种情况下,源码下载和编译均由安装工具负责,最重要的是检查package和library的相互依赖关系,对于非专业开发人员和对GNU Radio了解不足的人来说,是比较困难的事,因为GNU Radio包含的文件很多。

安装工具完成了这一任务。

对于这种安装,官网(/redmine/projects/gnuradio/wiki/InstallingGRFromSource)又给出了两种方法:(a)Using PyBOMBS安装。

这是GNU Radio正在推进和开发的安装方法。

DZZ安装了两次,源码下载成功,也通过了部分编译,但进程过大半后都失败了,出错的原因相同,最后的提示信息如下:[ 22%] Generating doxygen xml for pmt_swig_doc docs/bin/sh: 1: DOXYGEN_EXECUTABLE-NOTFOUND: not foundmake[2]: *** [gnuradio-runtime/swig/pmt_swig_doc_swig_docs/xml/index.xml] Error 127make[1]: *** [gnuradio-runtime/swig/CMakeFiles/pmt_swig_swig_doc.dir/all] Error 2make[1]: *** Waiting for unfinished jobs....[ 22%] [ 22%] Building CXX objectgnuradio-runtime/lib/pmt/CMakeFiles/gnuradio-pmt.dir/pmt_.oBuilding CXX object gnuradio-runtime/lib/pmt/CMakeFiles/gnuradio-pmt.dir/.o[ 22%] Building CXX object gnuradio-runtime/lib/pmt/CMakeFiles/gnuradio-pmt.dir/pmt_.o [ 22%] Building CXX object gnuradio-runtime/lib/pmt/CMakeFiles/gnuradio-pmt.dir/pmt_.o Linking C shared library libvolk.so[ 22%] Built target volk[ 23%] Building CXX objectgnuradio-runtime/lib/pmt/CMakeFiles/gnuradio-pmt.dir/pmt_.oLinking CXX shared library libgnuradio-pmt-3.7.4git.so[ 23%] Built target gnuradio-pmtmake: *** [all] Error 2ERROR:root:PyBOMBS Make step failed for package (gnuradio) please see bash output above for a reason (hint: look for the word Error)失败的原因可能是:(1)对于PyBOMBS不熟悉(没有花时间研读官网给出的相关资料)。

Tutorials for GNU Radio

Tutorial1:GNU Radio Installation Guide-Step by StepDawei Shen∗May19,2005AbstractThe tutorials for GNU Radio start from here.The installation procedure is introduced in detail.It is shown that many packages are needed by GNU Radio,which makes the installationbothersome.To avoid trouble,Fedora and Mandrake are recommended.Forfirst time users,it’sbetter to install Linux completely and follow step1to step7strictly.The best and easiest way to get GNU Radio software is to build and install it directly from CVS, which is described in Step8.However,GNU Radio requires many other packages pre-installed in your system.Missing any one of them will lead you into trouble.So I suggest forfirst time installation, it is better to go through1until7step by ter,whenever you want to check new versions of GNU Radio appearing on CVS,you could go to step8directly.GNU Radio is designed and tested well in Linux operating system.Fedora and Mandrake seem to work best at this point.Make sure when you install Linux,the development tools and the x-window tools are included,which can make your life much plete installation of Linux is a good option for beginners.1Downloading necessary packages or tarballsFor our USRP users,we need the following modules given in Table1.∗The author is affiliated with Networking Communications and Information Processing(NCIP)Laboratory, Department of Electrical Engineering,University of Notre Dame.Welcome to send me your comments or inquiries.Email:dshen@Table1:GNU Radio Modulesgnuradio-core(*)the2.x core librarygnuradio-examples examples for the2.x treegr-audio-oss(*)soundcard support using OSSgr-audio-alsa(*)soundcard support using ALSAgr-usrp(*)glue that connects usrp into GNU Radio frameworkgr-wxgui(*)wxPython based GUI tools including FFT and o’scopegr-howto-write-a-block examples,Makefiles and article sourcegr-gsm-fr-vocoder GSM06.1013kbit/sec vocoderusrp(*)USRP board support12Tutorial1-Installation Guide The modules marked with‘*’are necessary components.These modules can be downloaded directly from the GNU Radio’s web page.However,the best way to get the newest version of these modules(except usrp)is to checkout and download them from CVS using the following commands:$export CVS_RSH="ssh"$cvs-z3-d:ext:anoncvs@:/cvsroot/gnuradio co-P<modulename>The USRP CVS tree is hosted on e these commands to check the usrp module out:$cvs-d:pserver:anonymous@:/cvsroot/opensdr login$cvs-z3-d:pserver:anonymous@:/cvsroot/opensdr co-P usrpThen a directory with the module name will appear in your current folder.Every time you should run./bootstrapfirst to generate the configuration and makefiles.2Installation of gnuradio-coreThis is the most important module in GNU Radio,which requires many packages pre-installed in your system.To make our life easier,when we install the GNU/linux in our computer(Fedora3for me),we should make sure the development tools and X-window development tools are checked,so that we can avoid a lot of trouble.It has been determined that GNU Radio exercises bugs in certain versions of g++3.3.x on the x86platform.If you are using g++3.3and make check fails,please either upgrade to3.4or downgrade to3.2.Both are known to work.Three packages are necessary and often missing:A.FFTWWebpage:http://www.ff/Download page:http://www.ff/download.htmlIMPORTANT!!!When building FFTW,you MUST use the--enable-single and--enable-shared configure options.You should also use either the--enable-3dnow or--enable-sse options if you’re on an Athlon or Pentium respectively.Note that sometimes you may meet the‘segmenta-tion fault’error when you try to run a python code.You can remove the--enable-sse option to avoid this problem.B.cppunitWebpage:Download page:https:///project/showfiles.php?group id=11795C.SWIGWebpage:Download page:/projects/swig/Two Python modules are necessary and very important in GNU Radio,Numeric and Numarray, which are used in Python for numerical computation purpose.They are available at: /projects/numpyD.Shen3Download the newest version of Numarray and Numpy.Extract the tarball then you canfind the setup.pyfie the following command to install$python setup.py installAt this point,I guess you should be able to install gnuradio-core without losing any packages.In the folder gnuradio-core downloaded from CVS,run the following commands$./bootstrap$./configure--enable-maintainer-mode$make$make check$make installNow you have already got the key component of GNU Radio.Note that you may not be able to pass the‘make check’if you didn’t install Numeric and Numarray modules.3Installation of gr-audio-oss,gr-audio-alsaNothing particular is worth mentioning here,they are two modules providing you the access to your sound card.Remember to run./bootstrapfirst to generate the configuration and makefiles.4Installation of gr-wxguigr-wxgui provides the graphical FFT and o’scope in GNU Radio and is based on wxPython.So certainly we should install wxPythonfirst.Webpage:/Download page:https:///project/showfiles.php?group id=10718There are two types of wxPython,which are ansi based and unicode based.Either one of them works.Pay attention to the suffix and choose the correct rpms for your Python(2.3or2.4).For example,in my computer,I choose the following three rpms.wxPython2.5-gtk2-unicode-2.5.4.1-fc2_py2.3.i386.rpmwxPython-common-gtk2-unicode-2.5.4.1-fc2_py2.3.i386.rpmwxPython2.5-devel-gtk2-unicode-2.5.4.1-fc2_py2.3.i386.rpmDownload them into one folder and simply run$rpm-ivh*.rpmNow wxPython has been installed and you can install gr-wxgui without any problem.5Installation of usrp and gr-usrpThe usrp module provides necessary drivers,fpga controls,firmware interfaces for GNU Radio’s use. It must be installed before gr-usrp.We’ll need the SDCC free C compiler to build thefirmware. SDCC can be found at4Tutorial1-Installation GuideWebpage:/Download page:/project/showfiles.php?group id=599The version2.4is necessary to avoid some problems.Now you can install usrp and gr-usrp in order.6Installation of gnuradio-examples,gr-howto-write-a-block and gr-gsm-fr-vocoderActually these modules are not parts of the GNU Radio software.They just provide some examples, applications or technical articles.They can be installed easily.Note that it’s not necessary to‘install’gnuradio-examples,you canfind many good examples in the/python folder.7Post-installation tasksAfter installation,all the components mentioned above are installed in/usr/local/lib/python2.3/site-packagesIf you are using python2.4,then the path should be/usr/local/lib/python2.4/site-packageswhich is not included in Python’s working path by default.To let the Pythonfind these modules and for convenience,you’ll need to set the PYTHONPATH environment variable as follows: $export PYTHONPATH=/usr/local/lib/python2.3/site-packagesYou may want to add this to your~/.bash_profile.Two important documents are located at/usr/local/share/doc/gnuradio-core-x.xcvs/html/index.html/usr/local/share/doc/usrp-x.xcvs/html/index.htmlThey are the documentations for gnuradio and usrp.You may like to bookmark them in your web browser.8How to check the updates and install the updated versions of GNU Radio software from CVS?Note that the steps mentioned above are only forfirst-time installation,because typically quite a lot of packages are missing at this point.Once you have installed GNU Radio successfully,you have a much easier way to check the updates and install the updated versions of GNU Radio from CVS. Here’s the step-by-step version.We checkout gr-build by hand,then use it to bootstrap everything else.D.Shen5$export CVS_RSH="ssh"$cvs-z3-d:ext:anoncvs@:/cvsroot/gnuradio co-P gr-buildYou now have a directory called gr-build.Change directory into it:$cd gr-buildThis checkout command will checkout everything except for that related to the Measurement Computing PCI card.$./checkout-x mc4020You’ll now have a bunch of directories...If you haven’t already,you’ll want to set up/etc/sudoers.The buildit script below does the bulk of the work running as you,then uses‘sudo make install’to install the stuffinto/usr/local/...First,add yourself to group wheel by editing/etc/group.Find the line that starts with wheel:x:...and add your log name to the end of it.Then make these changes to/etc/sudoers:#Defaults specification#Only ask for password every10minutes.Defaults timestamp_timeout=10#Uncomment to allow people in group wheel to run all commands%wheel ALL=(ALL)ALLNow,assuming you’ve got all the dependencies fulfilled,this will bootstrap,configure,make,make check,and make install everything in the proper order:$sudo-v#give sudo the password now,so you can walk away while it builds Now build everything that you checked out$./for-all-dirs../buildit2>&1|tee make.logAssuming the build completed successfully,you’re all set.Later when you want to see if there are updates to CVS head,but don’t want to apply them to your tree use this:$./for-all-dirs cvs-nqP upIf you like what you saw from the previous command,this will get the updates and merge them into your tree:$./for-all-dirs cvs-qP upThen you should rebuild everything:$./for-all-dirs../buildit6Tutorial1-Installation Guide References[1]GNU Radio on-line document:How to Build from CVS,/wiki?HowtoBuildFromCVSTutorial2:Before Diving into GNU Radio,You Should...Dawei Shen∗May21,2005AbstractGNU Radio requires both strong computer skills and extensive knowledge on communications and digital signal processing.This article lists some useful resources including textbooks,weblinks,on-line tutorials.The purpose of this sheet is to help the GNU Radio fans to get preparedfor this exciting tool.I definitely believe you have found GNU Radio interesting and are eager to play around with it. Unfortunately,it contains more challenge than fun.You need extensive knowledge on a wide range of areas,including communication(wireless)systems,digital signal processing,basic hardware and circuit design,OOP programming,etc.However,your interest and passion could make them much easier.In this page,I list some useful articles and resources,which might be important to you before you dive into the GNU Radio.1Having a clearer picture of GNU Radio...If you haven’t,please read this on-line articlefirst.Eric Blossom,”Exploring GNU Radio”.A very brief and excellent introduction to software radio.Eric is the founder of the whole GNU Radio project. Make sure you understand how ADC works and why we need an RF frontend.Recall the sampling theory learnt from your Signal and Systems class.Then take a close look at the two parts”The Universal Software Radio Peripheral”and”What Goes in the FPGA”.This article also provides two examples,a simple dial tone output and an FM receiver.At least you should understand thefirst one.Can’t understand the FM receiver?Never mind,read the second article:Eric Blossom,”Listen to FM Radio in Software,Step by Step”.You don’t need to understand the code line by line, but you should know how the signalflows from the air to the soundcard.Then it’s better for you to know more about what USRP does,the two pages”USRP wiki”and”USRP User’s Guide”would be very valuable.Assuming you have gone thourgh the articles above,you may go to the”GNU Radio wiki”pages to look for more information.2Programming on GNU Radio...To really”play”with GNU Radio,you should be able to write your own code.From the article ”Exploring GNU Radio”,you should have known that the software structure of GNU Radio contains two levels.All the signal processing blocks are written in C++and Python is used to create a network or graph and glue these blocks together.So in this particular scenario,Python is a higher level language.Many useful and frequenctly used blocks have been provided by the GNU Radio project, so in many cases you don’t need to touch C++,just using Python tofinish your task.However,to do more sophisticated work,you have to use C++to create your own block.In such cases,an on-line ∗The author is affiliated with Networking Communications and Information Processing(NCIP)Laboratory, Department of Electrical Engineering,University of Notre Dame.Welcome to send me your comments or inquiries.Email:dshen@12Tutorial2-Start with GNU Radio article Eric Blossom,”how to write a block”is what you need.You may want to know,what blocks have been provided to us?Unfortunately,unlike some other developing tools,such as TinyOS,GNU Radio is badly documented at this point.But you still have two very useful documents generated using Doxygen.After installing the”gnuradio-core”and”usrp”modules,you canfind two html packages located at•/usr/local/share/doc/gnuradio-core-x.xcvs/html/index.html•/usr/local/share/doc/usrp-x.xcvs/html/index.htmlI bookmark them in my brower.Although they are not clear enough,they can tell you quite much information.Thefirst one is also available on-line here.If you haven’t had a chance to use Python,please go though the Python on-line tutorials.The most important sections are:•Section2:Using the Python Interpreter•Section3An Informal Introduction to Python•Section6:Modules•Section7:Input and Output•Section9:ClassesThey will be frequently used in GNU Radio programming.If Object-Oriented Programming(OOP) sounds unfamiliar to you,you should read section9more carefully.The following links also may help you to grasp the essence of OOP.•Lesson:Object-Oriented Programming Concepts•Introduction to Object-Oriented Programming Using C++•The Object Oriented Programming WebAnyway,Python seems to be crucial at this stage,so make sure you master it well.3Digital Signal Processing(DSP)Most of us have taken the”Signals and Systems”class,I guess.What we learnt in this course is extremely important here.However,that’s not enough.Make sure you won’t get lost if I change the signal to analog or to digital world;to the time domain or to the frequency domain.The bottom line is,you need to know what is sampling theorem,what is z-transform,how to get the spectrum of a signal,and the concepts of FIR and IIRfilters.I recommend several books here,which are famous and classical.•”Signals and Systems(2nd edition)”-Alan V.Oppenheim,Alan S.Willsky•”Discrete-Time Singal Processing(2nd edition)”-Alan V.Oppenheim,Ronald W.Schafer,John R.Buck•”Digital Signal Processing:Principles,Algorithms and Applications(3rd edition)”-John G.Proakis,Dimitris ManolakisRead the chapters about discrete-time Fourier tranform and FIR,IIRfilters.I know the books are expensive and tedious,there are some other useful on-line resources:•Digital Signal Processing Tutorial•The Scientist and Engineer’s Guide to Digital Signal ProcessingD.Shen34CommunicationsWe know the real signals we send and receive can’t be in base band.They need to modulatedand demodulated.I believe you have studied the concepts of AM and FM radios in some courses.Both of them belong to analog world.To develop more useful and interesting schemes,we needdigital communications.Of particular importance and interest at this point,is digital modulationand demodulation,synchronization.The course in your senior year,”Communication Systems”maybe of interest to you.Further more,I recommend you read:•Chapters4and5,”Digital Communications(4th edition)”-John G.ProakisThe knowledge introduced in these two chapters is exactly what we are going to try out recently.5Ready to start?I list four topics above.It doesn’t mean you should complete them one by one before you can do something with GNU Radio.You certainly can learn them through this study process.But at leastyou should read the articles I mentioned above in section1and section2.Then you can try this”homework”:In the module”gnuradio-examples”,you canfind many sample codes in the folder gnuradio-example/python/usrp/. Can you read the following two programs and understand the code line by line?•gnuradio-examples/python/usrp/am rcv.py•gnuradio-examples/python/usrp/wfm rcv gui.pyIf so,I would say you have moved a huge step.ReferencesAll the book chapters,on-line resources mentioned in this article.Tutorial3:Entering the World of GNU Software RadioDawei Shen∗August3,2005AbstractThis article provides an overview of the GNU Radio toolkit for building software radios.This tutorial is a modified version of Eric’s article‘Exploring GNU Radio’.The concepts of softwaredefined radio and the basics of signal processing will be introduced.We are going to enter theexciting world of GNU Software Radio!1Introduction to GNU Software RadioSoftware radio is the technique of getting the code as close to the antenna as possible.It turns radio hardware problems into software problems.The fundamental characteristic of software radio is that software defines the transmitted waveforms,and software demodulates the received waveforms.This is in contrast to most radios in which the processing is done with either analog circuitry or analog circuitry combined with digital chips.Software radio is a revolution in radio design due to its ability to create radios that change on thefly,creating new choices for users.At the baseline,software radios can do pretty much anything a traditional radio can do.The exciting part is theflexibility that software provides us.Controlling a computer,with necessary hardware supports,to play with radios should be easier,interesting and attractive.GNU Radio is a free software toolkit for learning about,building and deploying software radios. GNU Radio provides a library of signal processing blocks and the glue to tie it all together.It is free and open source,it comes with complete source code so anyone can look and see how the system is built.2The structure of a software radio system2.1Block diagramThis is a typical RX path for a software radio:Antenna->Receive RF Front End->ADC->Software Code∗The author is affiliated with Networking Communications and Information Processing(NCIP)Laboratory, Department of Electrical Engineering,University of Notre Dame.Welcome to send me your comments or inquiries.Email:dshen@12Tutorial3-Entering the World of GNU Radio This is a typical TX path for a software radio:Software Code->DAC->Transmit RF Front End->AntennaTo understand the software part of the radio,wefirst need to understand a bit about the associated hardware.Examining the receive path in thefigure,we see an antenna,a mysterious RF front end, an analog-to-digital converter(ADC)and a bunch of code.2.2Analog to Digital Converter(ADC)The analog-to-digital converter is the bridge between the physical world of continuous analog signals and the world of discrete digital samples manipulated by software.ADCs have two primary characteristics,sampling rate and dynamic range.Sampling rate is the number of times per second that the ADC measures the analog signal.Dynamic range refers to the difference between the smallest and largest signal that can be distinguished;it’s a function of the number of bits in the ADC’s digital output and the design of the converter.For example,an8-bit converter at most can represent256(28)signal levels,while a16-bit converter represents up to65,536 levels.Generally speaking,device physics and cost impose trade-offs between the sample rate and dynamic range.After getting through the ADC,the continuous signal becomes a sequence of numbers entering the computer,which can be processed digitally as an array in the software.So what kind of ADC could be a good choice if we want to play with GNU Radio?The best answer should be the USRP board, which is developed by Matt and Eric.We will talk about the USRP board later.2.3The RF Front EndTo understand the role of the RF front end,we need to talk about a bit of theory.Nyquist theorem tells us that,to avoid aliasing when converting from analog to digital,the ADC sampling frequency must be at least twice the maximum frequency of the signal of interest,in order to sustain all the spectrum information accurately.Aliasing is what makes the wagon wheels look like they’re going backward in the old westerns:the sampling rate of the movie camera is not fast enough to represent the position of the spokes unambiguously.Assuming we’re dealing with low pass signals-signals where the bandwidth of interest goes from 0to f MAX,the Nyquist criterion states that our sampling frequency needs to be at least2*f MAX. But if our ADC runs at20MHz,how can we listen to broadcast FM radio at92.1MHz?The answer is the RF front end.The receive RF front end translates a range of frequencies appearing at its input (RF band)to a lower range at its output(IF band).For example,we could imagine an RF front end that translated the signals occurring in the90-100MHz range(RF)down to the0-10MHz range (IF).Mostly,we can treat the RF front end as a black box with a single control,the center of the input range that’s to be translated.As a concrete example,a cable modem tuner module translates a6 MHz chunk of the spectrum centered between about50MHz and800MHz down to an output range centered at5.75MHz.The center frequency of the output range is called the intermediate frequency, or IF.What can be used as the RF front end?If you like to build everything from scratch,you could purchase the Minicircuits parts for prototype.A typical structure is shown below:Antenna->Low Noise Amplifer(LNA)->Low Pass Filter(LPF)->Mixer->LPF->ADCLocal Oscillator->-^D.Shen3The low noise amplifier(LNA)and the low passfilter(LPF)are used to select the bandwidth of interest and amplify the signal.For example,in order to receive the FM stations,you may like to use an LNA and an LPF with a cutofffrequency of120MHz.A mixer can be treated as a multiplier, with two inputs(the RF signal and the local sinusoidal wave)and one output(the IF signal).A local oscillator is used to generate a sinusoidal wave with a constant frequency(RF-IF).You may use a voltage controlled oscillator(VCO)for this purpose.At the output of the mixer,we get two chunks of spectrum centered at IF and2*RF-IF respectively.Therefore,the mixer should be followed by an LPF to remove the2*RF-IF part and leave the IF part.Finally,the IF signal could get into the ADC while obeying the Nyquist criteria.If you think these Minicircuits parts will make your experiment table messy,you could also purchase some fancy integrated modules such as the mc4020 cable modem tuner module.You are a USRP user,as we recommended,some new receiving daughter boards will bring us great convenience.3The SoftwareThe digital signalsfinally get into the computer.What waits for them is our code-the so called software.GNU Radio provides a library of signal processing blocks and the glue to tie it all together. We will talk about the GNU Radio programming in detail in later chapters.It’s worth to give it a shot now.In GNU Radio,the programmer builds a radio by creating a graph(as in graph theory)where the vertices are signal processing blocks and the edges represent the dataflow between them.The signal processing blocks are implemented in C++.Conceptually,blocks process infinite streams of data flowing from their input ports to their output ports.Blocks’attributes include the number of input and output ports they have as well as the type of data thatflows through each.The most frequently used types are short,float and complex.Some blocks have only output ports or input ports.These serve as data sources and sinks in the graph.There are sources that read from afile or ADC,and sinks that write to afile,digital-to-analog converter(DAC)or graphical display.About100blocks come with GNU Radio.Writing new blocks is not difficult.Graphs are constructed and run in Python.Here is the‘Hello World’of GNU Radio.It generates two sine waves and outputs them to the sound card,one on the left channel,one on the right.Hello World Example:Dial Tone Output#!/usr/bin/env pythonfrom gnuradio import grfrom gnuradio import audiodef build_graph():sampling_freq=48000ampl=0.1fg=gr.flow_graph()src0=gr.sig_source_f(sampling_freq,gr.GR_SIN_WAVE,350,ampl)src1=gr.sig_source_f(sampling_freq,gr.GR_SIN_WAVE,440,ampl)dst=audio.sink(sampling_freq)fg.connect((src0,0),(dst,0))fg.connect((src1,0),(dst,1))return fg4Tutorial3-Entering the World of GNU Radio if__name__==’__main__’:fg=build_graph()fg.start()raw_input(’Press Enter to quit:’)fg.stop()We start by creating aflow graph to hold the blocks and connections between them.The two sine waves are generated by the gr.sig_source_f calls.The f suffix indicates that the source produces floats.One sine wave is at350Hz,and the other is at440Hz.Together,they sound like the US dial tone.audio.sink is a sink that writes its input to the sound card.It takes one or more streams offloats in the range-1to+1as its input.We connect the three blocks together using the connect()method of theflow graph.connect()takes two parameters,the source endpoint and the destination endpoint,and creates a connection from the source to the destination.An endpoint has two components:a signal processing block and a port number.The port number specifies which input or output port of the specified block is to be connected.In the most general form,an endpoint is represented as a python tuple like this: (block,port_number).When port_number is zero,the block may be used alone.These two expressions are equivalent:fg.connect((src1,0),(dst,1))fg.connect(src1,(dst,1))Once the graph is built,we start it.Calling start()forks one or more threads to run the computation described by the graph and returns control immediately to the caller.In this case,we simply wait for any keystroke.Don’t worry if you still feel confused about some parts of the code.We will talk about them in depth later.At this stage,it’s enough to understand the framework of a typical GNU Radio program.Note that graphical user interfaces(GUI)for GNU Radio applications are also available,such as the soft oscillograph and the soft spectrum analyzer.They are built using wxPython.These nice GUI tools add lustre to the GNU Radio system,which also bring us great convenience andflexibility.4The HardwareGNU Radio is reasonably hardware-independent.Today’s commodity multi-gigahertz,super-scalar CPUs with single-cyclefloating-point units mean that serious digital signal processing is possible on the desktop.A3GHz Pentium or Athlon can evaluate3billionfloating-point FIR taps/s.We now can build,virtually all in software,communication systems unthinkable only a few years ago.Your computational requirements depend on what you’re trying to do,but generally speaking,a 1or2GHz machine with at least256MB of RAM should suffice.You also need some way to connect the analog world to your computer.Low-cost options include built-in sound cards and audiophile quality96kHz,24-bit,add-in cards.Regarding the RF front end and AD/DA converters,there are certainly many choices.However, the Universal Software Radio Peripheral(USRP)board,which is designed wholly for GNU Radio,is strongly recommended.In fact,most GNU Radio players are using USRP boards.Not only because they are nice and convenient to use,but also because you can get the most technical supports from the GNU Radio community.So,to make your life simpler,just choose the USRP.In next tutorial,we will investigate what happens on the USRP board.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

安装GNU Radio安装GNU Radio的典型方法有两种:(1)通过build-gnuradio脚本安装最新版;(2)自己下载相应版本的.tar.bz2文件,自行编译安装。

上述的方法均来源于:/redmine/projects/gnuradio/wiki/InstallingGR可按其提示的步骤执行。

下面分别予以介绍。

(1)通过build-gnuradio脚本安装最新版该脚本适用于Ubuntu和Fedora系统,一般情况下可一次性地完成GNU Radio和UHD的安装,并顺利通过测试。

该方法适于基础较少的用户,安装过程简单方便,但是不利于我们深入地了解安装过程,因而即便安装成功,在今后如果出现程序运行上问题和错误,也同样需要很长的时间去寻找解决办法。

下面将以Ubuntu10.10系统为例,介绍GNU Radio的安装过程。

a.下载build-gnuradio安装脚本。

从/files/build-gnuradio处下载脚本文件。

(直接链接另存为即可)b.将脚本文件拷贝到主文件夹目录下,按照下面的命令依次操作即可。

wwfzs1990@wwfzs1990-laptop:~$ ./build-gnuradioThis script will install Gnu Radio from current GIT sourcesYou will require Internet access from the computer on which thisscript runs. You will also require SUDO access. You will requireapproximately 500MB of free disk space to perform the build.This script will, as a side-effect, remove any existing Gnu Radioinstallation that was installed from your Linux distribution packages.It must do this to prevent problems due to interference betweena linux-distribution-installed Gnu Radio/UHD and one installed from GIT source.The whole process may take up to two hours to complete, depending on thecapabilities of your system.Proceed?y (需要输入y后,按回车)Starting all functions at: 2012年 03月 08日星期四 07:45:31 CSTSUDO privileges are requiredDo you have SUDO privileges?y (需要输入y后,按回车)Continuing with script[sudo] password for wwfzs1990:Installing pre-prequisites...Checking for package libfontconfig1-devChecking for package libxrender-devChecking for package libpulse-devChecking for package swigChecking for package g++Checking for package automakeChecking for package autoconfChecking for package libtoolChecking for package python-devChecking for package libfftw3-devChecking for package libcppunit-devChecking for package libboost-all-devChecking for package libusb-devChecking for package libusb-1.0-0-devChecking for package fort77Checking for package sdccChecking for package sdcc-librariesChecking for package libsdl1.2-devChecking for package python-wxgtk2.8Checking for package git-coreChecking for package guile-1.8-devChecking for package libqt4-devChecking for package python-numpyChecking for package ccacheChecking for package python-openglChecking for package libgsl0-devChecking for package python-cheetahChecking for package python-lxmlChecking for package doxygenChecking for package qt4-dev-toolsChecking for package libusb-1.0-0-devChecking for package libqwt5-qt4-devChecking for package libqwtplot3d-qt4-dev Checking for package pyqt4-dev-toolsChecking for package python-qwt5-qt4Checking for package cmakeChecking for package git-coreChecking for package wgetChecking for package sdccChecking for package python-docutilsChecking for package gtk2-engines-pixbufChecking for package python-tkChecking for library libusb ...Found library libusb Checking for library libboost_ ...Found library libboost_ Checking for library libcppunit ...Found library libcppunitChecking for library libguile ...Found library libguileChecking for library libfftw ...Found library libfftwChecking for library libgsl ...Found library libgslDoneFetching Gnu Radio via GIT...Done (根据网速的差异,此处可能要等很久)Fetching UHD via GIT...Done (同上)Starting function uhd_build at: 2012年 03月 08日星期四 07:50:35 CSTBuilding UHD...Done building/installing UHDDone function uhd_build at: 2012年 03月 08日星期四 08:03:53 CSTStarting function firmware at: 2012年 03月 08日星期四 08:03:53 CSTFetching and installing FPGA/Firmware images via wget......Installing from: current.tar.gz...Copying into /usr/local/share/uhdDoneDone function firmware at: 2012年 03月 08日星期四 08:04:04 CSTStarting function gnuradio_build at: 2012年 03月 08日星期四 08:04:04 CST/usr/local/lib already in ld.so.conf.dDoing ldconfig...Building Gnu Radio......Doing cmake...Cmaking (此处make需要很久)...Building...InstallingDone building and installing Gnu RadioGRC freedesktop icons install ...DoneDone function gnuradio_build at: 2012年 03月 08日星期四 08:28:19 CSTStarting function mod_groups at: 2012年 03月 08日星期四 08:28:19 CSTGroup 'usrp' already in /etc/group********************************************************************************This script has just modified /etc/group to place your userid '('$USER')' into group 'usrp' In order for this change to take effect, you will need to log-out and log backin again. You will not be able to access your USRP1 device until you do this.If you wish to allow others on your system to use the USRP1 device, you will need to use: sudo usermod -a -G usrp useridFor each userid you wish to allow access to the usrp********************************************************************************FurtherDone function mod_groups at: 2012年 03月 08日星期四 08:28:19 CSTStarting function mod_udev at: 2012年 03月 08日星期四 08:28:19 CSTDone function mod_udev at: 2012年 03月 08日星期四 08:28:19 CSTStarting function mod_sysctl at: 2012年 03月 08日星期四 08:28:19 CSTApplying updates to /etc/sysctl.confGroup 'usrp' now has real-time scheduling privilegesYou will need to log-out and back in again for this totake effectDone function mod_sysctl at: 2012年 03月 08日星期四 08:28:19 CSTStarting function pythonpath at: 2012年 03月 08日星期四 08:28:19 CST************************************************************You should probably set your PYTHONPATH to:/usr/local/lib/python2.6/dist-packagesin your .bashrc or equivalent file prior to attempting to runany Gnu Radio applications or Gnu Radio Companion.*************************************************************Done function pythonpath at: 2012年 03月 08日星期四 08:28:19 CSTDone all functions at: 2012年 03月 08日星期四 08:28:19 CSTAll Donewwfzs1990@wwfzs1990-laptop:~$ sudo gedit .bashrc将下面两行内容添加到.bashrc文件的最后:PYTHONPATH=/usr/local/lib/python2.6/dist-packagesexport PYTHONPATH然后保存退出wwfzs1990@wwfzs1990-laptop:~$ source .bashrc(2)自己下载相应版本的.tar.gz文件,自行编译安装。

相关文档
最新文档