|
|
# Software Basics
|
|
|
|
|
|
As its name would suggest, the use of software-defined radio to implement communication algorithms requires some programming ability along with knowledge of related software development tools and processes. Although the number of topics included can be a bit daunting at first, a strong understanding of programming and computing in general is invaluable to engineers of all disciplines. Strong computing skills can offer you additional flexibility and opportunities in terms of career progression.
|
|
|
|
|
|
This page provides a number of references you may find useful in getting up to speed for the CDC design project.
|
|
|
|
|
|
## The Linux Command Line
|
|
|
|
|
|
The primary software environment used in CDC will be an Ubuntu Linux virtual machine (VM). An efficient way for interacting with Linux is the use of the command line (also called the terminal/shell/prompt), a textual interface to issue commands for execution by the Linux OS. In the CDC Ubuntu VM, you can open the terminal by clicking on the following icon: 
|
|
|
|
|
|
If you are unfamiliar with the Linux command line or feel you need a refresher, the following tutorials and guides are helpful.
|
|
|
|
|
|
- [The Linux command line for beginners](https://ubuntu.com/tutorials/command-line-for-beginners#1-overview)
|
|
|
- [linuxcommand.org](https://linuxcommand.org)
|
|
|
- [Linux command line cheat sheet](https://cheatography.com/davechild/cheat-sheets/linux-command-line/)
|
|
|
|
|
|
A number of your CDC peers likely also have experience with Linux, so they will be good resources for help. When forming a project team you may consider ensuring at least one team member has a moderate programming background.
|
|
|
|
|
|
## Version Control with Git
|
|
|
|
|
|
A version control tool tracks changes to the software codebase of a project, allowing multiple team members to develop concurrently. Such tools allow for rolling back to previous versions of the code when mistakes are introduced and also allow the merging of conflicting changes made to the codebase. These days, Git is the most widely used version control tool for managing source code.
|
|
|
|
|
|
We will maintain a number of GNU Radio modules, useful code and templates, and this wiki (!) in a CDC project hosted on the university's Gitlab server.
|
|
|
|
|
|
- [ELEN90089 Gitlab Project](https://gitlab.eng.unimelb.edu.au)
|
|
|
|
|
|
You can create your own projects and repos on Gitlab and are strongly encouraged to do so as part of the management of your design project. Login to Gitlab with your normal university credentials.
|
|
|
|
|
|
- [UoM Engineering Gitlab](https://gitlab.eng.unimelb.edu.au)
|
|
|
|
|
|
Git takes a little bit of practice, so make sure to checkout the following tutorials and references.
|
|
|
|
|
|
- [Atlassian Bitbucket Tutorial](https://www.atlassian.com/git/tutorials/what-is-version-control)
|
|
|
- [Git Handbook on Github Guides](https://docs.github.com/en/get-started/using-git/about-git)
|
|
|
- [Git cheatsheet on Github](https://training.github.com/)
|
|
|
- [MUEEC's Basics of Git Workshop](https://www.youtube.com/watch?v=vUgsyfbOUl4)]
|
|
|
|
|
|
> **Note:** Version control tools like git work best with textual programming languages such as Python and C++. They have more limited functionality for resolving conflicts in the graphical flow graphs created with GRC (*.grc). They would, however, allow reverting to older versions of your flow graph.
|
|
|
|
|
|
## Python Programming Language
|
|
|
|
|
|
A key design feature of GNU Radio is the use of the Python programming language for creating application flow graphs, computationally non-intensive signal processing blocks, and scripting work. Python is an interpreted general-purpose programming language that is very popular among computer scientists, data analysts, and engineers. It consistently ranks as one of the most widely used languages.
|
|
|
|
|
|
The design philosphy behind Python is to make programming easy and fun, which has resulted in a very accessible and readable syntax. The following is an example of defining a simple Python function.
|
|
|
```
|
|
|
# example of Python's clean syntax
|
|
|
def my_divide(a, b):
|
|
|
c = a / b
|
|
|
return c
|
|
|
```
|
|
|
|
|
|
Python has an extensive standard library and is easily extended by others. See the [Python Package Index (PyPI)](https://pypi.org) for a large collection of third party libraries adding to Python's functionality. Chances are, whatever you are trying to do, someone has already created a Python module that can help you.
|
|
|
|
|
|
Some Python programming knowledge will be needed to develop applications in GNU Radio. The following are useful tutorials and references to star learning the language.
|
|
|
|
|
|
- [Beginner's Guide to Python](https://wiki.python.org/moin/BeginnersGuide)
|
|
|
- [The Python Tutorial](https://docs.python.org/3.9/tutorial/)
|
|
|
- [The Python Language Reference](https://docs.python.org/3.9/reference/)
|
|
|
|
|
|
Scientific computing functionality, similar to that possible with MATLAB, is possible using the [NumPy](https://numpy.org), [SciPy](https://scipy.org), and [Matplotlib](https://matplotlib.org) libraries. NumPy adds array and matrix support to Python along with a host of efficient mathematical calculation routines.You will need basic knowledge of NumPy arrays when creating or analyzing GNU Radio blocks in Python.
|
|
|
|
|
|
- [NumPy for absolute beginners](https://numpy.org/devdocs/user/absolute_beginners.html)
|
|
|
- [NumPy for MATLAB Users](https://numpy.org/devdocs/user/numpy-for-matlab-users.html)
|
|
|
|
|
|
As an *interpreted* language, Python code is not precompiled to executable machine code but rather read and executed by an interpreter. This makes Python very flexible and easy to use, but means it is not fast enough to implement computationally intensive signal processing blocks. See the next section on C++.
|
|
|
|
|
|
## C++ Programming Language
|
|
|
|
|
|
In GNU Radio, most signal processing blocks are implemented using C++, as it is a highly efficient *compiled* language. C++ is another very popular language that is an object-oriented extension of the C programming language. You should have some familiarity with C through Embedded System Design. An understanding of C++ will be helpful in understanding what certain GNU Radio blocks are doing as well as creating your own blocks should you choose to do so.
|
|
|
|
|
|
- [C++ Language Tutorial](https://www.cplusplus.com/doc/tutorial/)
|
|
|
- [W3 School's C++ Tutorial](https://www.w3schools.com/CPP/cpp_intro.asp) |