ThinkRF
                        logo Home          Products         Applications         Technology         Resources         About Us         Contact Us



Product Overview
WSA4000 RF Digitizer
RDC2000 RF Tuner
RFE0108 Radio Front End
RFE0440 Radio Front End
TK-LTE Toolkit
MATLAB® API
Octave API

Application Overview

Technology Overview

Resources

About Us

Contact Us

PrevNext

GNU Octave for Windows with Drivers, Examples and CLI Software

GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command-line interface (CLI) for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with MATLAB®.  It may also be used as a batch-oriented language. As part of the GNU Project, it is free software under the terms of the GNU General Public License (GPL).

ThinkRF provides Octave drivers for connecting to ThinkRF's WSA4000 Wireless Signal Analyzers and Octave program code examples to get you started towards developing your own.  The following provided program code examples demonstrate control of the WSA4000 via ThinkRF's CLI (command line interface) program and visualization of waveforms via Octave.  The CLI program also enables you to save waveforms to file.   

You can use Octave to Connect via the Internet to ThinkRF's Evaluation WSA4000s

The WSA4000 Wireless Signal Analyzer is designed for distributed or remote deployment and as such you can use and/or evaluate any of our third-party software applications by connecting to one of ThinkRF's WSA4000s which we have deployed on the internet.  Install Octave application and/or drivers, run the example programs using the following simple instructions and then connect via the internet to one of our evaluation units.   
 

If you'd like access to one of our evaluation units on the internet then please contact us by phone +1.613.369.5104 ext 2803 or by email sales@thinkrf.com

If you do not already have Octave v3.4.3 installed.... 

The Octave drivers and scripts for the ThinkRF WSA4000 have been verified and tested with latest Octave version v3.4.3.  If you already have Octave v3.4.3 installed then skip to the next section, otherwise the following instructions will step you through installing Octave v3.4.3. 

The "Octave 3.4.3 for Windows MinGW Installer" is available on the GNU Octave Repository for Windows webpage located at http://sourceforge.net/projects/octave/files/Octave_Windows%20-%20MinGW/Octave%203.4.3%20for%20Windows%20MinGW%20Installer/.   The GNU Octave Repository for Windows web page provides installation instructions which are repeated as follows with a few additional notes in italics.  
Note also that the ThinkRF WSA4000 only requires the main Octave executable contained with the  Octave3.4.3_gcc4.5.2_20111025.7z.   The "octaveforge packages" contained within the Octave3.4.3_gcc4.5.2_pkgs_20111026.7z are not required but do provide additional Octave functionality, binaries and libraries.  
  1. Create an installation directory that doesn't have space chars (i.e. C:\Octave\Octave3.4.2_gcc4.5.2\). This directory is referred hereafter as <your_install_dir> (For the simplicity, it's recommended that the directory location C:\Octave\Octave3.4.2_gcc4.5.2\ is used and the 7-zip program will create that Octave3.4.2_gcc4.5.2 subdirectory in the following steps.) 
  2. Extract the complete directories tree from Octave3.4.3_gcc4.5.2_20111025.7z to the installation directory keeping the original directory structure as in the archive (you can use 7zip tool from http://www.7-zip.org/.  If you open the Octave3.4.3_gcc4.5.2_20111025.7z within 7-zip and extract to C:\Octave then the subdirectory will be created automatically.)
  3. Extract libreadline.dll.a from libreadline.dll.a.7z and copy it to <your_install_dir>\lib subdir (the libreadline.dll.a.7z is a file separately listed on the GNU Octave Repository for Windows webpage.)  
  4. Copy octave3.4.3_gcc4.5.2.lnk to any convenient location and edit its properties respectively to point to <your_install_dir>\bin\octave.exe and <your_install_dir>\share\octave\3.4.3\imagelib\octave-logo.ico as an icon 5. (The octave3.4.3_gcc4.5.2.lnk file is located in the archive file Octave3.4.3_gcc4.5.2_20111025.7z.  If you have used the suggested directory C:\Octave\Octave3.4.2_gcc4.5.2\ then you do not have to edit it's properties. The octave3.4.3_gcc4.5.2.lnk is a shortcut to the Octave.exe executable and can be also copied to your taskbar and/or desktop for convenience.)     
  5. Copy octave3.4.3_gcc4.5.2_docs.lnk to any convenient location and edit its properties respectively to point to <your_install_dir>\doc\octave and <your_install_dir>\share\octave\3.4.3\imagelib\octave-logo.ico as an icon.    

Download the ThinkRF CLI Software and Octave Driver and Example Files

The following provides CLI software and Octave drivers and example scripts for controlling the WSA4000 and visualizing results respectively.  For example, the wsaGUI.m script provides visualization of streamed IQ data from the WSA4000 via a frequency domain FFT spectrum graph and a 3D spectrogram history of the last 30 frames of that same FFT spectrum.     

  1. Download ThinkRF_CLI_Octave_111201.7z [2011-12-01 407 KB]
  2. Extract the complete directories tree from the above archive file ThinkRF_CLI_Octave_111201.7z to C:\Octave\MyScripts\ThinkRF\ directory keeping the original directory structure as in the archive (if you have not used the default directory C:\Octave\MyScripts\ThinkRF\ then extract the ThinkRF directory tree to the directory in which you keep your script files.)
  3. The WSA4000_CLI_v1.1.exe file is the WSA4000 CLI tool.  It is an executable that does not require installation and the executable and/or a short-cut link may also be copied to your taskbar and/or desktop for convenience.

The following is an description of the files and directories contained with the
ThinkRF_CLI_Octave_111201.7z archive file. 
  • WSA4000_CLI_v1.1.exe
    • WSA4000 CLI (command line interface) tool which is a self-contained executable providing control, status and data storage to file
  • wsaGUI.m
    • The main GUI application. 
  • wsa-octave-api (folder)
    • Contains C++ functions that integrate with the WSA API, wrapped inside OCT files including:
      • openWSA, readData, and closeWSA
    • Note that to use these files in your own scripts, ensure you add the wsa-octave-api folder to your Octave path
  • gui-implementation (folder)
    • Contains helper scripts for the GUI application
    • These files may be disregarded
  • signal-processing-implementation (folder)
    • Contains helper scripts for doing the data processing (windowing, FFT transforms, etc.)
    • These files may be used as examples or disregarded
  • samples (folder)
    • Contains simple scripts that illustrate interaction with the WSA using OCT files and provide examples for data processing in Octave
  • readme (folder)
    • Version file and license

Running the Octave Scripts

The following steps you through initiating Octave, connecting to a WSA4000 and executing Octave scripts for visualizing data from the WSA4000, controlling the WSA4000 and storing data to a file.   The following assumes that your <your_install_dir> is C:\Octave\.
  • Launch Octave by double-clicking the C:\Octave\octave3.4.3_gcc4.5.2.lnk short-cut (or C:\Octave\bin\Octave.exe executable) which will open the following window.   
ThinkRF
                                    Octave

Note that Octave's terminal is a shell script and has many of the same file management commands as unix.
  • On the first and only first execution of Octave type "install" <enter>.
  • As per the following illustration, type "pwd" <enter> to display your current working directory which should be C:\Octave\MyScripts. If it is not then navigate to your MyScripts directory by typing "cd C:\Octave\MyScripts" <enter>. 
  • Type "cd ThinkRF" <enter> to navigate to the C:\Octave\MyScripts\ThinRF subdirectory.
  • Type "ls" <enter> to confirm the contents of the directory as illustrated. 
  • Type "wsaGUI('<IP>')" <enter> where <IP> parameter is the IP address of the WSA4000, for example "wsaGUI('192.168.215.104')" or "wsaGUI('kanata.demo.thinkrf.com')".  The first time you execute wsaGUI you will have to wait a moment for the OCT files to be built (this happens automatically).     
ThinkRF
                                    Octave


Upon the execution of the wsaGUI command the following waveform visualization window will appear.      
ThinkRF
                                    Octave


Running the ThinkRF CLI

The WSA CLI provides: a simple command text method to control or query a WSA4000; a means to load script file containing either CLI or SCPI commands (no save); and a means to save IQ data to a file along with header information inclduing samples size/frame, number of frames/file, and optionally a prefix file name and extension type. 

The CLI can be run either as a console window in which commands can be entered or as a stand-alone DOS command line executable with parameters.   Either method allows users to run script files containing sets of commands in either CLI or SCPI.  The standalone mode is useful also for users when it is called directly from within a programming application such as MATLAB, Java, C/C++, etc.
 
  • Launch the CLI by double-clicking the C:\Octave\WSA4000_CLI_v1.1.exe executable which will open the following window. 
  • Type <IP> <enter> where <IP> is the IP address of the WSA4000, for example "192.168.215.104" or "kanata.demo.thinkrf.com".  The "Connecting to WSA..." message will appear as illustrated below.       
ThinkRF
                                    Octave
  • You may now set, change and/or query the WSA4000's setting such as frequency, gain, etc.   Type "h" and <enter> to display a list of commands as follows.  
  • Type the IP  wsaGUI('<IP>') where <IP> parameter is the IP address of the WSA4000, for example wsaGUI('192.168.215.104') or wsaGUI('hq.demo.thinkrf.com').  The first time you execute wsaGUI you will have to wait a moment for the OCT files to be built (this happens automatically).     
ThinkRF
                                    Octave


CLI Command-line Useage, Examples and Saving Data to a File

The CLI may be used as a command-line with parameters within a Window's DOS shell using the following syntax: 
  • WSA4000_CLI_v1.1 -c [-h] -ip=<#.#.#.# or host name> [{h}] [{<cmd1>}] [{<cmd2>}] [{...}]
    • Case insensitive
    • -c : for standalone mode
    • -h : optional -h help mode that print out usage instruction and command manual
    • cmd : any commands as shown in the console mode
    • [ ]: optional parameter
    • < >: required parameter
For example to get usage help
  • WSA4000_CLI_v1.1 -c
  • WSA4000_CLI_v1.1 -c -h
  • WSA4000_CLI_v1.1 -c -ip=hq.thinkrf.com {h}
For example to some controls:
  • WSA4000_CLI_v1.1 -c -ip=hq.thinkrf.com {set freq 2440.15} {set gl rf high}
  • WSA4000_CLI_v1.1 -c -ip=hq.thinkrf.com {get freq} {set cal on}
For example to run a script file:
  • WSA4000_CLI_v1.1 -c -ip=hq.thinkrf.com {run cmdf cli c:\thinkrf\set default.txt}
  • WSA4000_CLI_v1.1 -c -ip=hq.thinkrf.com {run cmdf scpi c:\thinkrf\set default.txt} {set freq 2440.15}
For example to save data:
  • WSA4000_CLI_v1.1 -c -ip=hq.thinkrf.com {sd test data csv}
  • WSA4000_CLI_v1.1 -c -ip=hq.thinkrf.com {set freq 2441.5} {set gl rf high} {sd test data csv}
  • WSA4000_CLI_v1.1 -c -ip=hq.thinkrf.com {run cmdf cli c:\thinkrf\set default.txt} {sd test data csv}
  • WSA4000_CLI_v1.1 -c -ip=hq.thinkrf.com {run cmdf cli c:\thinkrf\settings_with_save_data.txt}
The following is an example CLI script file:

set bpf on

set cal on
set freq 2441.5
set gl rf HIGH
set gl if -30
set ant 1
set ss 1024
set fs 100
set ss 1024
sd test data csv
 
And the following is an example SCPI command file:

*CLS

:CAL:RFE ON
:CAL:GAIN ON
:SENS:FREQ 2441.5 MHz
:INPUT:GAIN:RF HIGH
:INPUT:GAIN:IF -30
:INPUT:ANTEnna 1
:INPUT:FILT:PRESELECT 1
:DATA?

Implementing Custom Octave Scripts for the ThinkRF WSA4000

To implementing custom Octave scripts, the "C:\Octave\MyScripts\ThinkRF\wsa-octave-api\" folder needs to be added to the Octave path.   This can be done automatically in the script using Octave's addpath function. It is also recommended to call "buildWsaOct" at the start of the script, to ensure all OCT files are up to date.  Refer to the wsaBasic.m in the samples folder for examples.      
 

sitemap