Setup:Octave - UQ-Communication-Systems/public GitHub Wiki

Octave is a Scientific programming language which runs on Linux, Mac, BSD and Windows. It has a syntax which is compatible with MATLAB. In Communication Systems at UQ, the MATLAB code we run is compatible with both MATLAB and Octave.

Installation

To set up Octave, you can either use the standalone Octave, or one that runs in a Jupyter like notebook (xeus-octave).

  • Octave Standalone: Download the latest version of Octave (currently version 9.2.0 in 2024). Use the guide for your operating system on that page.
  • Octave Standalone: If your operating system has a package manager, you might be able to install in that. e.g. apt-get install octave, yum install octave, brew install octave, port install octave.
  • Xeus-Octave: Install using the install scripts. Xeus is recommended to be installed using either conda or mamba. It seems to work well on each operating system.

Testing Octave

After installation, run Octave and test if you can run the following code:

    x = randn(1, 101);
    plot(x);

(A plot should come up, which looks like a random line).

Secondly, for Communication systems we need a few toolboxes, like the signal processing and communications toolboxes. You can test if these are active using the following code:

    x = randn(1, 101);
    [y, shifts] = xcorr(x);
    plot(shifts, y, 'r.:');

Exporting figures from Octave

If you would like to export images from Octave, you can use the guide: Exporting Figures in Octave

Installing the toolboxes

If there is an error in the line with xcorr in it - it means that the "signal" package/toolbox is not installed. In this case you can try installing it with the following command:

pkg install -forge general
pkg install -forge control
pkg install -forge specfun
pkg install -forge -auto signal 

Troubleshooting

  • Windows Octave 6.x: Problems with plotting? Seems that it was caused by using the VS release instead of MingW release.

  • Windows Octave 6.x: Seems that the 'print' command has problems if there are spaces in the directory where Octave is installed. Try to avoid this where possible.

Please report your success/findings by editing this page.