GNU Radio Internals

2y ago
70 Views
4 Downloads
1.10 MB
60 Pages
Last View : 6d ago
Last Download : 23d ago
Upload by : Helen France
Transcription

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceGNU Radio InternalsTanguy RissetCiti Laboratory, INSA de LyonApril 3, 2019Tanguy RissetGNU Radio Internals1

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceTable of contents1Introduction to GNU RadioWhat is GNU RadioGNU radio with gnuradio-companion2Creating Gnu radio blocksNaming conventionBoost, Volk ad SwigCreating a simple GNU radio module: gr-arith module3Block behavior and Schedulergeneral worksync blocks4Message passing interfacePMTMetadataTags & MessagesTanguy RissetGNU Radio Internals2

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceSource material and Warning These slides were built from many sources among which: Gnuradio wiki ials) Gnuradio API doc (https://gnuradio.org/doc/doxygen/), variousGNU Radio version available Tom Rondeau slides (http://www.trondeau.com/) “Developing Signal Processing Blocks for Software Defined Radio”,Gunjan Verma and Paul Yu, Army Research Laboratory,ARL-TR-5897, 2012. Gnuradio is evolving quickly, some of the details mentioned herecan become optional or are not yet deployed if you use olderversionTanguy RissetGNU Radio Internals3

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceTable of Contents1Introduction to GNU RadioWhat is GNU RadioGNU radio with gnuradio-companion2Creating Gnu radio blocksNaming conventionBoost, Volk ad SwigCreating a simple GNU radio module: gr-arith module3Block behavior and Schedulergeneral worksync blocks4Message passing interfacePMTMetadataTags & MessagesTanguy RissetGNU Radio Internals4

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceWhat is GNU Radio?An open source framework for building softwareradio transceivers An open source software toolkit Creating signal processing applications Defining waveforms in software Processing waveforms in software An important development community Active developer community producing examples GNU radio conference (2011-2014) A set of hardware platforms USRP1 & USRP2, Universal Software Radio Peripheral, RTL2832 TV tuners an easy-to-use approach (Simulink-like)Tanguy RissetGNU Radio Internals5

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceThe big pictureSamplingBaseband taEncrypt/DecryptVoiceVideoFront EndMediaAccessDigitalDSP/FPGATanguy RissetIFIFAmp FilterRFRFAmp FilterAntennaAntennaSystemsAnalogASICDedicated HardwareGNU Radio Internals6

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceA 3 tier architecture Python scripting language usedfor creating "‘signal flow graphs"’ C used for creating signalprocessing blocks An already existing library ofsignalling blocks Tools for enabling the addition ofnew blocks The scheduler is using Python’sbuilt-in module threading, tocontrol the ‘starting’, ‘stopping’or ‘waiting’ operations of thesignal flow graph.Tanguy RissetGNU Radio InternalsPythonApplication developmentcreating flow graphsC Signal processingmodulesSchedulercontrolingflow graphs7

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceGNU Radio ‘Hello World’ application#!/usr/bin/env ss top block(gr.top block):def init (self):gr.top block. init (self, "Hello Word")samp rate 32000freq1 440ampl 0.4self.audio sink audio.sink(32000, "", True)self.analog sig source 1 analog.sig source f(samp rate,analog.GR COS WAVE, 350, ampl, 0)self.analog sig source 0 analog.sig source f(samp rate,analog.GR COS WAVE, 440, ampl, 0)self.connect((self.analog sig source 0, 0), (self.audio sink, 1))self.connect((self.analog sig source 1, 0), (self.audio sink, 0))if name ' main ':tb top block()tb.start()raw input ('Press Enter to quit: ')tb.stop ()Tanguy RissetGNU Radio Internals8

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceData-flow programming Sources, Sinks, Computational Blocks and Data FlowsBlock 1Source 1Block 2Sink 1Block 4Block 3Source 2Tanguy RissetGNU Radio Internals9

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceGNU Radio LibraryFundamentals gr-analogGraphical Interfaces gr-audio gr-wxgui gr-qtgui gr-blocks gr-channels gr-digital gr-fecHardware Interfaces gr-audio gr-fft gr-comedi gr-filter gr-shd gr-trellis gr-uhd gr-vocoder gr-waveletTanguy RissetGNU Radio Internals10

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceA simple example with GNU Radio companion (GRC) Dial tone GNURADIO/gr-audio/example/grc/dial-tone.grcTanguy RissetGNU Radio Internals11

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceRun-Time Execution The dial-tone.grc in an XMLinterface instantiating python and C code. It can be: Compiled (it generates a python file:dial-tone.py) Executed (i.e. executes the generatedpython file) Debugged (with spectrum analyzer forinstance)Tanguy RissetGNU Radio Internals12

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceDebugging dial toneTanguy RissetGNU Radio Internals13

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceDial Tone: GRC XML code block key analog sig source x /key param key id /key value analog sig source x 0 /value /param param ?xml version '1.0' encoding 'ASCII'? key enabled /key flow graph value True /value timestamp Tue May 6 17:48:23 2014 /timestamp /param block param key options /key key type /key param value float /value key id /key /param value dial tone /value param /param key samp rate /key param value samp rate /value key enabled /key /param value True /value [.] /param /block param [.] key title /key connection value Dial Tone /value source block id blocks add xx /source block i /param sink block id audio sink /sink block id param source key 0 /source key key author /key sink key 0 /sink key value Example /value /connection [.] connection source block id analog sig source x 0 /source sink block id blocks add xx /sink block id source key 0 /source key sink key 0 /sink key Tanguy RissetGNU Radio Internals14

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceDial Tone: Python code (manual)fromfromfromfromfromgnuradio import grgnuradio import audiognuradio.eng option import eng optionoptparse import OptionParsergnuradio import analogclass my top block(gr.top block):def init (self):gr.top block. init (self)[.]sample rate int(options.sample rate)ampl 0.1src0 analog.sig source f(sample rate, analog.GR SIN WAVE, 350, ampl)src1 analog.sig source f(sample rate, analog.GR SIN WAVE, 440, ampl)dst audio.sink(sample rate, options.audio output)self.connect(src0, (dst, 0))self.connect(src1, (dst, 1))if name ' main ':try:my top block().run()except KeyboardInterrupt:passTanguy RissetGNU Radio Internals15

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceDial Tone: Python code (generated from .grc)#!/usr/bin/env ####### Gnuradio Python Flow Graph# Title: Dial Tone# Author: Example# Description: example flow graph# Generated: Tue May 6 17:48:25 ####from gnuradio import analogfrom gnuradio import audiofrom gnuradio import blocks[.]class dial tone(grc wxgui.top block gui):def init (self):grc wxgui.top block gui. init (self, title "Dial Tone")icon path png"self.SetIcon(wx.Icon( icon path, wx.BITMAP TYPE ANY))self.samp rate samp rate 32000self.noise noise .005self.ampl ampl .4noise sizer wx.BoxSizer(wx.VERTICAL)self. noise text box forms.text box(parent self.GetWin(),sizer noise sizer,value self.noise,callback self.set noise,label "Noise",Tanguy RissetGNU Radio Internals16

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceDial Tone: C code (manual)/** GNU Radio C example creating dial tone* ("the simplest thing that could possibly work")** Send a tone each to the left and right channels of stereo audio* output and let the user's brain sum them.*/#include gnuradio/top block.h #include gnuradio/analog/sig source f.h #include gnuradio/audio/sink.h using namespace gr;int main(int argc, char **argv){int rate 48000; // Audio card sample ratefloat ampl 0.1; // Don't exceed 0.5 or clipping will occur// Construct a top block that will contain flowgraph blocks. Alternatively,// one may create a derived class from top block and hold instantiated blocks// as member data for later manipulation.top block sptr tb make top block("dial tone");// Construct a real-valued signal source for each tone, at given sample rateanalog::sig source f::sptr src0 analog::sig source f::make(rate, analog::GR SIN WAVE, 350, ampl);analog::sig source f::sptr src1 analog::sig source f::make(rate, analog::GR SIN WAVE, 440, ampl);// Construct an audio sink to accept audio tonesaudio::sink::sptr sink audio::sink::make(rate);Tanguy RissetGNU Radio Internals17

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceGNU Radio software layers GRC: Graphical design tool GNURADIO/gr-audio/example/grc/dial-tone.grc . python : Mostly Composite Block application GNURADIO/gr-audio/examples/python/dial tone.py GNURADIO/gr-digital/python/digital/ofdm.py . C : Mostly Low level functions GNURADIO/gr-audio/examples/c /dial tone.cc GNURADIO/gr-digital/lib/ofdm cyclic prefixer impl.c .Tanguy RissetGNU Radio Internals18

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceTable of Contents1Introduction to GNU RadioWhat is GNU RadioGNU radio with gnuradio-companion2Creating Gnu radio blocksNaming conventionBoost, Volk ad SwigCreating a simple GNU radio module: gr-arith module3Block behavior and Schedulergeneral worksync blocks4Message passing interfacePMTMetadataTags & MessagesTanguy RissetGNU Radio Internals19

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceGNU radio C naming convention Words in identifiers are separated by underscores (e.g.gr vector int) All types begin by gr (e.g. gr float) All class variable begin by d (e.g. d min stream) Each C class is implemented in a separated file (e.g. classgr magic implemented in file gr magic.cc with header filegr magic.h) All signal processing blocs contain their input and output types intheir suffixes. e.g.:dc blocker ff impl.ccdc blocker cc impl.cc[.][.]dc blocker ff impl::dc blocker cc impl::dc blocker cc impl(int D, bool longdc blocker ff impl(int D, bool long form): sync block("dc blocker cc",: sync block("dc blocker ff",io signature::make (1, 1, sizeof(gr complex)),io signature::make (1, 1, sizeof(float)),io signature::make (1, 1, sizeof(gr complex))),io signature::make (1, 1, sizeof(float))),d length(D), d long form(long form)d length(D), d long form(long form)Tanguy RissetGNU Radio Internals20

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceBlock signature A bloc signature is a specification of the data types that enter orexit the bloc. There are always two bloc signatures, one for inputs, the otherfor outputs. Each bloc signature specifies the number and types of ports. excerpt from gr io signature.h:class GR RUNTIME API io signature{intd min streams;intd max streams;std::vector int d sizeof stream item;io signature(int min streams, int max streams,const std::vector int &sizeof stream items);public:typedef boost::shared ptr io signature sptr; io signature();static sptr make(int min streams, int max streams,int sizeof stream item);/*!* \brief Create an i/o signature*Tanguy RissetGNU Radio Internals* \ingroup internal21

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceBoost Pointer Gnu radio uses Boost smart pointers. Boost is a software library that provides a smart implementationof C pointers that offers garbage collection (i.e. delete objectnot used anymore). Gnu radio uses only the shared ptr type of Boost Instead of declaring a pointer to a type X:X* myPointer;you can declare:boost::shared ptr X myBoostPointer example in gr io signaturetypedef boost::shared ptr io signature sptr;static sptr make(int min streams, int max streams,int sizeof stream item);Tanguy RissetGNU Radio Internals22

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceVolk library Gnu radio uses VOLK (which stands for Vector-Optimized Libraryof Kernels) volk provides a number of optimized function for vectorprocessing using SIMD instructions. Developing with volk might be tricky because it is sensible toalignment of vector in memory. Understanding code using volk simply requires to understandvolk naming convention: The basic naming scheme will look something like this:volk (inputs params) [name] (output params) [alignment] example:volk 32f invsqrt 32fTanguy RissetGNU Radio Internals23

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceOther Volk example General naming convention when there are several inputs oroutputs:volk (input type 0) x(input num 0) (input type 1) x(input num 1) .[name] (output type 0) x(output num 0) (output type 1) x(output num 1) . [alignment] Examples: Multiply two complex float vectors together (aligned and unalignedversions) and the dispatcher:volk 32fc x2 multiply 32fc avolk 32fc x2 multiply 32fc uvolk 32fc x2 multiply 32fc Add four unsigned short vectors together:volk 16u x4 add 16u Multiply a complex float vector by a short integer:volk 32fc s16i multiply 32fcTanguy RissetGNU Radio Internals24

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceSWIG SWIG is a software development tool that connects programswritten in C and C with a variety of high-level programminglanguages. SWIG is used in GNU Radio to link Python and C codeTanguy RissetGNU Radio Internals25

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceSWIG example (1) write a C file example.c code that defines the int fact(int n)function. write an interface file for SWIG:%module example%{int fact(int n);%}int fact(int n); execute the swig command:swig -python example.i it generates a file example wrap.c Compile the .c files with -fPIC option (and path to Python.h):gcc -fPIC -I/usr/include/python2.7 -c example.c example wrap.cTanguy RissetGNU Radio Internals26

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceSWIG example (1) link it to example.so:ld -shared example.o example wrap.o -o example.so import example in python and use the func function:python [.] import example example.fact(5)120Tanguy RissetGNU Radio Internals27

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceCreating GNU radio modules A gnu radio module newModule corresponds to a directorynewModule should contain the following directories:CMakeLists.txt docs grc include lib python swig the gr modtool tool helps you create the various directory Hence the flow for creating a block in a module Create the module file hierarchy with gr modtool Create a block in the module with gr modtool Edit the C file to code the module functionalities Test, debug and validate the functionalitiesTanguy RissetGNU Radio Internals28

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceCreating a trivial module: module creation creating the module directory structure:gr modtool newmod arith Go into the new directory: cd gr-arith/ lsapps CMakeLists.txt examples includecmake docsgrclibTanguy RissetGNU Radio InternalsMANIFEST.mdpythonswig29

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceCreating a trivial module: adding a bloc times2 We will create a bloc of type general block without parameter. Go into the module directory ( cd gr-arith/) and type thefollowing command:gr modtool add -t general times2Answer cpp to the first question and nothing to the otherquestions. create a python test method: edit python/qa times2.py update python/CMakeLists.txt (nothing to do here) create the build directory cd .;mkdir build; build the project: cd build; cmake ./Tanguy RissetGNU Radio Internals30

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceCreating a trivial module: directory hierarchygr-arith[.] -- CMakeLists.txt -- docs -- CMakeLists.txt -- doxygen -- CMakeLists.txt[.] -- grc -- arith times2.xml -- CMakeLists.txt -- include -- arith -- api.h -- CMakeLists.txt -- times2.h -- lib -- CMakeLists.txt -- qa arith.cc -- qa arith.h -- qa times2.cc -- qa times2.h -- test arith.cc -- times2 impl.cc -- times2 impl.cc -- times2 impl.h -- python -- CMakeLists.txt -- init .py -- qa times2.py -- qa times2.py Tanguy RissetGNU Radio Internals31

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceCreating a trivial module: The C part Header files are in include/arith directory Code is in lib/times2 impl.cc, edit it and replace the by values. in times2 impl() (constructor in forecast (indicate scheduler how many input are requires forhow many output items) in general work core of the treatment. make it (in the build directory), and make testTanguy RissetGNU Radio Internals32

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceCreating a trivial module: initial debugging use printf (#include sdtio.h ) use make; make test (from python testbench) log output in Testing/Temporary/LastTest.log Or equivalently: ctest -VTanguy RissetGNU Radio Internals33

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceCreating a trivial module: gnuradio-companion block Now that you have written a valid block, you can create a validgrc block go up to gr-arith directory:gr modtool makexml times2 install it:cd build; sudo make install You can also install the new blocks in a local directory and setenvironnement variables to indicate where gnuradio-companionshould find them (see labs) create a simple grc application (use throttle, remove printf) run it (warning: no print!)Tanguy RissetGNU Radio Internals34

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceTable of Contents1Introduction to GNU RadioWhat is GNU RadioGNU radio with gnuradio-companion2Creating Gnu radio blocksNaming conventionBoost, Volk ad SwigCreating a simple GNU radio module: gr-arith module3Block behavior and Schedulergeneral worksync blocks4Message passing interfacePMTMetadataTags & MessagesTanguy RissetGNU Radio Internals35

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceBlock important function Each Gnu radio bloc inherits from the gr block class. The gr block class contains the following important function (file GNURADIO/include/gnuradio:void set history(unsigned history);virtual void forecast(int noutput tems,gr vector int &ninput items required);virtual int general work(int noutput items,gr vector int &ninput items,gr vector const void star &input items,gr vector void star &output items);void consume(int which input, int how many items);Tanguy RissetGNU Radio Internals36

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfacefunction general work The general work() function computes output streams frominput streams It has 4 arguments int noutput items Number of output items to write on each outputstream (all output streams must produce the same number ofoutput). int ninput items[] Number of input items to read in each inputstream void* intput items[] Vectors of pointers to elements of the inputstream(s), i.e., element i of this vector points to the i th input stream. void* output items[] Vectors of pointers to elements of the outputstream(s), i.e., element i of this vector points to the i th output stream.Tanguy RissetGNU Radio Internals37

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfacefunction general work The general work function implement the signal processingalgorithm. It is called by the scheduler (implicitly, i.e. you do not have toinvoke this function explicitly) The consume function indicates to the scheduler how many datahave been consumed once the general work has been executed Use of input items and output items vectors:input items[0][0]input items[0][1]General Blockoutput items[0][0]output items[0][1]data.data.data.input items[1][0]Tanguy RissetGNU Radio Internals38

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceOne execution of the block Before executioninput items[0][0]input items[0][1]General Blockdata.A6 A5 A4 A3 A2 A1noutput items 1data.output items[0][0]ninput items[0] 4ninput items[1] 2B3 B2 B1data.C1consume(0,4)consume(0,2)input items[1][0] after executioninput items[0][0]input items[0][1]General Blockdata.A6 A5noutput items 1data.output items[0][0]ninput items[0] 4ninput items[1] 2data.C1B3input items[1][0]Tanguy RissetGNU Radio Internals39

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceWhat the code of work function could be Example: sum the 6 samples in input on the outputfor(unsigned int j 0; j 4; j ) {output items[0][0] input items[0][j];}for(unsigned int j 0; j 2; j ) {output items[0][0] input items[1][j];} But it is not that simple. Gnu radio scheduler invokes the work function for computing achunks of output (i.e. not one output by one output, in order toavoid too many context switches) noutput item stays symbolic, it will be set dynamically duringthe execution by the scheduler for performance optimization(usually between 4000 and 10000).Tanguy RissetGNU Radio Internals40

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceWhat the code of work function should be add one loop over all noutput items output samples:for (i 0; i noutput items; i ) {for(j 0 ; j 4; j ) {output items[0][i] input items[0][4*i j];}for(unsigned int j 0; j 2; j ) {output items[0][i] input items[1][2*i j];}} Remember to avoid as much as possible samples copy.Tanguy RissetGNU Radio Internals41

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceWhat the code of work function really is Usual Gnu radio way of writing:const gr complex *in1 (const gr complex*)input items[0];const gr complex *in2 (const gr complex*)input items[1];gr complex *out (gr complex*)output items[0];for (i 0; i noutput items; i ) {for(j 0 ; j 4; j ) {*out *in1 ;}for(unsigned int j 0; j 2; j ) {*out *in2 ;}*out ;}Tanguy RissetGNU Radio Internals42

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceforecast function forecast() is a function which tells the scheduler how manyinput items are required to produce noutput items output items. In most of the case, they are the same:voidmy general block::forecast (int noutput items,gr vector int &ninput items required{ninput items required[0] noutput items;} It is used as an information by the scheduler to schedule theexecutions of the different blocs so as to prevent starvation orbuffer overflows.Tanguy RissetGNU Radio Internals43

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceconsume function The consume (int which input, int how many items)function tells the scheduler that how many items of input streamwhich input were consumed. This function should be called at the end of general work(),after all processing is finished consume each (int how many items) can be used it thenumber of items to consume is the same on each input streamsTanguy RissetGNU Radio Internals44

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfacesummary: code for my general block{my general block::general work (int noutput items,gr vector int &ninput items,gr vector const void star &input items,gr vector void star &output items)const gr complex *in1 (const gr complex*)input items[0];const gr complex *in2 (const gr complex*)input items[1];gr complex *out (gr complex*)output items[0];for (i 0; i noutput items; i ) {for(j 0 ; j 4; j ) {*out *in1 ;}for(unsigned int j 0; j 2; j ) {*out *in2 ;}*out ;}consume(0,4*noutput items);consume(1,4*noutput items);}voidmy general block::forecast (int noutput items,gr vector int &ninput items required){}ninput items required[0] 4*noutput items;ninput items required[1] 2*noutput items;Tanguy RissetGNU Radio Internals45

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceHistory or pipelined blocs Previous example was referred as a block without history in GnuRadio: every input is read only once to produce a single output. Or equivalently: each data read is immediately consumed Many processing blocs act in a pipeline fashion: produce one output data per input data but. use more than one input data to produce an output data. Example of a 4 taps FIR filter:x(i) 4Xy (i k )w(k )k 0input items[0][0]input items[0][1]output items[0][0]current itemset history(4)data.y6 y5 y4 y3 y2 y1data.Tanguy Rissetx6 x5 x4GNU Radio Internals46

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceuse of history in blocsCurrenthistorysampleold samplesdata.output items[0][0]set history(4)y6 y5 y4 y3 y2 y1data.x6 x5 x4input items[0][0] the set history() function is used by the scheduler to keepsome old sample alive (or available) to current samplecomputation. set history(hist) means that we are using hist sample(including current) to produce current output. input item[0][0] points to the oldest sample. Usually we shift the input stream: *in *(in hist-1) such that*in point to the current sample.Tanguy RissetGNU Radio Internals47

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceOther types of blocs gr::sync block is derived from gr::block and implements a1:1 block: It has a work() function rather than general work() function it omits the unnecessary ninput items parameter, and do not needthe consume each() to be called gr::gr sync decimator is used when the number of input itemsis a fixed multiple of the number of output items. The gr sync decimator constructor takes a 4th parameter, thedecimation factor The user should assume that the number of ninput items noutput items*decimation gr::gr sync interpolator is used when the number of outputitems is a fixed multiple of the number of input items. The gr sync interpolator constructor takes a 4th parameter, theinterpolation factor The user should assume that the number of ninput items noutput items/interpolationTanguy RissetGNU Radio Internals48

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceGNU Radio scheduler Dataflow programming model Each block needs a given number of data before running once(i.e. running the general work method) the forecast method of a bloc indicate this information to thescheduler. The scheduler decides to group several execution of each blocand provides a trade-off between performance efficiency andbuffer size between blocs.Tanguy RissetGNU Radio Internals49

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceTable of Contents1Introduction to GNU RadioWhat is GNU RadioGNU radio with gnuradio-companion2Creating Gnu radio blocksNaming conventionBoost, Volk ad SwigCreating a simple GNU radio module: gr-arith module3Block behavior and Schedulergeneral worksync blocks4Message passing interfacePMTMetadataTags & MessagesTanguy RissetGNU Radio Internals50

Introduction to GNU RadioCreating Gnu radio blocksBlock behavior and SchedulerMessage passing interfaceMessage passing protocols GNU Radio was originally a (infinite) streaming system with noother mechanism to pass data between blocks. Not adapted to control data, metadata, and, packet processing For solving this problem, gnuradio introduced Metada filesStream tagsMessage passingAll that heavily relying

Introduction to GNU Radio Creating Gnu radio blocks Block behavior and Scheduler Message passing interface Table of contents 1 Introduction to GNU Radio What is GNU Radio GNU radio with gnuradio-companion . Debugged (with spectrum analyzer for instanc

Related Documents:

bug-gnubg@gnu.orgor make abug report. All about GNU Backgammon iii COLLABORATORS TITLE : All about GNU Backgammon ACTION NAME DATE SIGNATURE WRITTEN BY Albert Silver and Christian Anthon July 23, 2018 REVISION HISTORY NUMBER DATE DESCRIPTION NAME All about GNU Backgammon March 2007 The GNU Backgammon Project All about GNU March 2007 Albert .

programming as well. In fact, while this guide is written and intended as an introduction to Octave, it can serve equally well as a basic introduction to MATLAB. What is GNU? A gnu is a type of antelope, but GNU is a free, UNIX-like computer operating system. GNU is a recursive acronym that stands for \GNU's not Unix." GNU Octave (and

Introduction to Gnu radio GNU radio with gnuradio-companion Creating Gnu radio blocks Block behavior and Scheduler Message passing interface Table of contents . Debugged (with spectrum analyzer for instance) Tanguy Risset Introduction to GNU Radio 13.File Size: 1MB

software environments as Matlab or GNU Radio. Figure 1. SDR with USRP and GNU Radio [10]. III. GNU RADIO GNU Radio [12] is an open-source toolkit that provides tools for development and simulation of SDR systems. It is used to design and execute algorithms that define a desired communication system. There are basically three ways to use GNU .

the GNU Radio libraries. The GNU Radio package is provided with a complete HDTV transmitter and receiver, a spectrum analyzer, an oscilloscope, a multichannel receiver . and a wide collection of modulators and demodulators. The user interface is called GNU Radio companion or GRC. GNU Ra

GNU is a Unix-like computer operating system developed by the GNU project. It is composed wholly of free software. It refers to GNU's Not Unix .GNU Project emphasizes on freedom and thus its logo type show a GNU, an animal living in freedom FSF: FSF is Free Software Foundation.

major components: a laptop running GNU Radio, a Universal Software Radio Periphery (USRP), a signal generator, and a spectrum analyzer. A block diagram of the setup is depicted in Fig. 4. A. GNU Radio GNU Radio is an open source software that is widely used as a programming plat

Accounting is an art of recording financial transactions of a business concern. There is a limitation for human memory. It is not possible to remember all transactions of the business. Therefore, the information is recorded in a set of books called Journal and other subsidiary books and it is useful for management in its decision making process. AcroPDF - A Quality PDF Writer and PDF Converter .