

While and the corresponding end statement is called the The list of statements contained between keywords like if or Preferred because if you use them, Octave is able to provide betterĭiagnostics for mismatched or missing end tokens. You can use the keyword end anywhere a more specificĮnd keyword is expected, but using the more specific keywords is Statement, and endwhile marks the end of a while ForĮxample, the keyword endif marks the end of an if Statement that marks the end of the end of the control statement. Each control statement has a corresponding end If statement contains another statement which may or may not beĮxecuted. Many control statements contain other statements for example, the While, to distinguish them from simple expressions. Statements start with special keywords such as if and With these tools, you can use Python to plot and analyse data.Go to the first, previous, next, last section, table of contents.Ĭontrol statements such as if, while, and so onĬontrol the flow of execution in Octave programs. Most likely you have several scientific Python libraries installed, such as SciPy and NumPy components (in particular, Matplotlib). Plot(c) Using Python as an alternative to Octave and Matlab Generating an I/Q plot (x-axis I, y-axis Q) can be done using: To plot I and Q separately over time, graph each component separately:

#Who uses gnu octave install
You can install GNU plot from source or using the Ubuntu repository: To plot data using octave, it is easiest to do with gnuplot.

To read this data, first use read_short_binary() and then split it into a two dimensional vector: ' _'read_short_binary()_: gr.sizeof_shortįor example, after capturing 64-bit complex using gr.file_sink(gr.sizeof_gr_complex, "capture.dat") in a Python script:ĭata captured directly from the USRP is stored as 32-bit complex, rather than 64-bit complex (gr.sizeof_gr_complex). ' _'read_float_binary()_: gr.sizeof_float ' _'read_complex_binary()_: gr.sizeof_gr_complex Each method takes a filename as the first parameter, and an optional second parameter which is the number of items to read from the file: You want to use one of the following methods, based on the size parameter used in gr.file_sink(). These help you read data that you may have dumped to disk using gr.file_sink( size, filename). Ensure that you have added the GNU Radio script path to your octave path, as described in the installing guide. To parse data output from GNU Radio, the easiest thing to do is use the provided scripts. If you check out the GNU Radio trunk to /home/username/gnuradio/, you can add the following to ~/.octaverc:Īddpath("/home/username/gnuradio/gr-utils/octave") Parsing Data This is easily done using your local ~/.octaverc configuration file. To use the GNU Radio octave scripts, you must add the path to your Octave path variable. Installing Octave can be done from source, or in Ubuntu using: Matlab is a closed source tool, and very expensive-but if you already have it installed, you might prefer it to Octave.

Octave is the most popular analysis tool with GNU Radio, as the GNU Radio package includes its own set of scripts for reading and parsing output.
