|
# Software Basics
|
|
# 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.
|
|
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.
|
|
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 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, or 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:
|
|
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, or 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.
|
|
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)
|
|
- [The Linux command line for beginners](https://ubuntu.com/tutorials/command-line-for-beginners#1-overview)
|
|
- [linuxcommand.org](https://linuxcommand.org)
|
|
- [linuxcommand.org](https://linuxcommand.org)
|
|
- [Linux command line cheat sheet](https://cheatography.com/davechild/cheat-sheets/linux-command-line/)
|
|
- [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.
|
|
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.
|
|
|
|
|
|
## Python Programming Language
|
|
## Python Programming Language
|
|
|
|
|
|
A key design feature of GNU Radio is the use of the Python programming language for creating application flowgraphs, 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.
|
|
A key design feature of GNU Radio is the use of the Python programming language
|
|
|
|
for creating application flowgraphs, 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.
|
|
|
|
|
|
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.
|
|
|
|
```python
|
|
```python
|
|
# example of Python's clean syntax
|
|
# example of Python's clean syntax
|
|
def my_divide(a, b):
|
|
def my_divide(a, b):
|
... | @@ -30,45 +52,78 @@ def my_divide(a, b): |
... | @@ -30,45 +52,78 @@ def my_divide(a, b): |
|
return c
|
|
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.
|
|
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 start learning the language.
|
|
Some Python programming knowledge will be needed to develop applications in GNU
|
|
|
|
Radio. The following are useful tutorials and references to start learning the
|
|
|
|
language.
|
|
|
|
|
|
- [Beginner's Guide to Python](https://wiki.python.org/moin/BeginnersGuide)
|
|
- [Beginner's Guide to Python](https://wiki.python.org/moin/BeginnersGuide)
|
|
- [The Python Tutorial](https://docs.python.org/3.9/tutorial/)
|
|
- [The Python Tutorial](https://docs.python.org/3.9/tutorial/)
|
|
- [The Python Language Reference](https://docs.python.org/3.9/reference/)
|
|
- [The Python Language Reference](https://docs.python.org/3.9/reference/)
|
|
|
|
|
|
Scientific computing functionality, similar to that of MATLAB, is also possible with Python 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.
|
|
Scientific computing functionality, similar to that of MATLAB, is also possible
|
|
|
|
with Python 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 absolute beginners](https://numpy.org/devdocs/user/absolute_beginners.html)
|
|
- [NumPy for MATLAB Users](https://numpy.org/devdocs/user/numpy-for-matlab-users.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 parsed and then executed by an intermediate interpreter. This makes Python very flexible and easy to use but means it is often not fast enough to implement computationally intensive signal processing blocks. See the next section on C++ for these cases.
|
|
As an *interpreted* language, Python code is not precompiled to executable
|
|
|
|
machine code but rather parsed and then executed by an intermediate interpreter.
|
|
|
|
This makes Python very flexible and easy to use but means it is often not fast
|
|
|
|
enough to implement computationally intensive signal processing blocks. See the
|
|
|
|
next section on C++ for these cases.
|
|
|
|
|
|
## C++ Programming Language
|
|
## 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.
|
|
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/)
|
|
- [C++ Language Tutorial](https://www.cplusplus.com/doc/tutorial/)
|
|
- [W3 School's C++ Tutorial](https://www.w3schools.com/CPP/cpp_intro.asp)
|
|
- [W3 School's C++ Tutorial](https://www.w3schools.com/CPP/cpp_intro.asp)
|
|
|
|
|
|
## Version Control with Git
|
|
## 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 code when mistakes are introduced and for the merging of conflicting changes made to the codebase by different developers. These days, Git is the most widely used version control tool for managing source code.
|
|
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 code when mistakes are introduced and for
|
|
|
|
the merging of conflicting changes made to the codebase by different developers.
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
- [TBD]()
|
|
- [TBD]()
|
|
|
|
|
|
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.
|
|
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)
|
|
- [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.
|
|
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)
|
|
- [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 Handbook on Github Guides](https://docs.github.com/en/get-started/using-git/about-git)
|
|
- [Git cheatsheet on Github](https://training.github.com/)
|
|
- [Git cheatsheet on Github](https://training.github.com/)
|
|
- [MUEEC's Basics of Git Workshop](https://www.youtube.com/watch?v=vUgsyfbOUl4)]
|
|
- [MUEEC's Basics of Git Workshop](https://www.youtube.com/watch?v=vUgsyfbOUl4)
|
|
|
|
|
|
> **Important 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 flowgraphs created with GRC (*.grc). They do, however, allow reverting to older versions of your flowgraph. |
|
> **Important Note:** Version control tools like Git work best with textual
|
|
\ No newline at end of file |
|
> programming languages such as Python and C++. They have more limited
|
|
|
|
> functionality for resolving conflicts in the graphical flowgraphs created with
|
|
|
|
> GRC (*.grc). They do, however, allow reverting to older versions of your
|
|
|
|
> flowgraph. |