Hands-on Digital transmission with your soundcard¶

00 - Setting up the Development Environment¶

Welcome to this introduction to digital transmission presented by dspillustrations.com! Throughout this course, we will develop an end-to-end signal transmission chain, that transmits textual data using your soundcard. However, before we can dive into the actual coding, let's setup the coding environment.

The project uses Jupyter notebooks to present the content. The project requires Python 3.4 or higher. A quite handy distribution for python is e.g. Anaconda, but a standard Python3 installation also fits. To setup your development environment, follow these steps:

  1. Obtain the required hardware. An overview is given on dspillustrations.com. Essentially, you will need a USB soundcard, speakers and a microphone.

Please note: This description has been superseeded by a more detailed description here: Setting up Anaconda

  1. Open a command line and move to the directory where the ipynb-files are located.

  2. Create a virtual environment. For example with the following commands:

    #
    python -m venv ewAudio
    ewAudio\scripts\activate      # on Windows
    source ewAudio/bin/activate   # on Linux```
    
  3. Install all required packages (note that the requirements.txt file is located in the code subdirectory):

    pip install -r requirements.txt

    This will load all the files from the requirements txt file and install the packages

  4. (Optional:) Install a LaTeX distribution to regenerate the block diagrams.

  5. Run the jupyter notebook with

    jupyter notebook

Below, you can try out if you got the packages installed (need to open the Jupyter notebook in Jupyter to run these cells):

In [1]:
# try out numpy and scipy
import numpy as np
print("Numpy:", np.version.full_version)
import scipy as sp
print("Scipy:", sp.version.full_version)
Numpy: 2.2.0
Scipy: 1.14.1
In [2]:
# try out matplotlib
import matplotlib
print("Matplotlib:", matplotlib.__version__)
import ipympl
print("Ipympl:", ipympl.__version__)
%matplotlib ipympl
Matplotlib: 3.10.0
Ipympl: 0.9.5
In [3]:
# try out sounddevice
import sounddevice as sd
print("sounddevice:", sd.__version__)
sounddevice: 0.5.1
In [4]:
# try loading the tikzmagic extension
%load_ext tikzmagic

Great, if the above cells run without errors, you are ready for diving into the actual content.

Below, we test the matplotlib plotting functionality

In [5]:
import matplotlib.pyplot as plt
t = np.linspace(0, 1, 100)
matplotlib.pyplot.plot(t, np.sin(2*np.pi*2*t));

For completeness, let's try out the tikz extension to draw a simple figure. Remember, that this requires LaTeX to be installed:

In [6]:
%%tikz
\draw (0,0) [fill=blue!10!white] ellipse (2cm and 1cm);
\node at (0,0) {\sffamily DSPIllustrations.com};
No description has been provided for this image

Now, I wish you fun with the first notebook which is about setting up your soundcard for the upcoming experiments!

Your Max (dspillustrations.com)

Copyright (C) 2025 - dspillustrations.com