The PCP notebooks offer open-source educational material for a Preparation Course for Python (PCP) while using signal processing as a motivating and tangible application for practicing the programming concepts. Building upon the open-access Jupyter framework, the PCP notebooks consist of interactive documents that contain executable code, textbook-like explanations, mathematical formulas, plots, images, and sound examples. Assuming some general programming experience and basic knowledge in digital signal processing, the PCP notebooks are designed to serve several purposes.
First, the PCP notebooks provide interactive and well-structured material that may be suited for self-study or may serve as course material. For example, we use the PCP notebooks as the basis for a one-week intensive preparatory course offered to new students admitted to the international Master's study programme Communications and Multimedia Engineering (CME).
Second, the PCP notebooks provide a foundation for working with more advanced signal-processing toolboxes. In particular, the PCP notebooks are inspired and designed to bridge the gap to the FMP notebooks for teaching and learning fundamentals of music processing (FMP).
Third, the PCP notebooks recap central mathematical concepts needed in signal processing, including complex numbers, the exponential function, signals and sampling, and the discrete Fourier transform.
Finally, the PCP notebooks indirectly guide students to employ open-source tools for software development and reproducible research. For example, the PCP notebooks may motivate students to start using software tools such as Conda for creating and managing Python environments, Google colab or Binder for executing code, or GitHub for version control and software archiving.
In summary, we hope that the PCP notebooks help students to naturally transition from starting to learn about Python programming and signal processing to beginning independent research following good scientific practices.
If a static view of the PCP notebooks is enough for you, the exported HTML versions can be used right away without any installation. All material, including the explanations, the figures, and the audio examples, can be accessed by just following the HTML links. If you want to execute the Python code cells, you have to download the notebooks (along with the data), create an environment, and start a Jupyter server. You then need to follow the IPYNB links within the Jupyter session. As an alternative for executing the notebooks, one can also use web-based services such as Google colab or binder via the notebooks' GitHub repository. The necessary steps and technical details are explained in the PCP notebook on how to get started.
The collection of PCP notebooks is organized into ten units. Each unit, corresponding to an individual notebook, gives an overview, explains its learning objectives, and then presents the main content using executable code, textbook-like explanations, mathematical formulas, plots, images, and sound examples. At the end of each unit, one finds short coding exercises. For self-evaluation, the PCP notebooks provide for each exercise a sample solution in the form of a Python function contained in one of the modules of the Python package libpcp. Roughly speaking, the first half of the PCP notebooks covers general Python concepts, while the second half applies these programming concepts in the context of signal processing. The following table gives an overview of the PCP notebooks' ten units and their main content.
Unit | Title | Notions, Techniques & Algorithms | HTML | IPYNB |
1 | Get Started | Download; Conda; Python environment; Jupyter | [html] | [ipynb] |
2 | Python Basics | Help; variables; basic operators; list; tuple; boolean values; set; dictionary; type conversion; shallow and deep copy | [html] | [ipynb] |
3 | NumPy Basics | Array; reshape; array operations; type conversion; constants; matrix | [html] | [ipynb] |
4 | Control Structures and Functions | Loop; for; while; break; continue; Python function; efficiency; runtime | [html] | [ipynb] |
5 | Visualization Using Matplotlib | Plot (1D); figure; imshow (2D); surface (3D); logarithmic axis | [html] | [ipynb] |
6 | Complex Numbers | Real part; imaginary part; absolute value; angle; polar representation; complex operations; conjugate; polar coordinate plot; roots; Mandelbrot | [html] | [ipynb] |
7 | Exponential Function | Power series; exponentiation identity; Euler's formula; differential equation; roots of unity; Gaussian function; spiral | [html] | [ipynb] |
8 | Signals and Sampling | Continuous-time signal; periodic; frequency; Hertz; amplitude; phase; discrete-time signal; sampling; aliasing; interference; beating; | [html] | [ipynb] |
9 | Discrete Fourier Transform (DFT) | Inner product; DFT; phase; optimality; DFT matrix; fast Fourier transform (FFT); FFT algorithm; runtime; time localization; chirp signal; inverse DFT | [html] | [ipynb] |
10 | Python Modules and Packages | Python modules; Python packages; libpcp; documentation; docstring; sample solutions to exercises | [html] | [ipynb] |
The immediate contribution of the PCP notebooks is to provide basic material on Python programming as required, e.g., for more advanced lab courses in a signal processing curriculum. The PCP notebooks are not intended to give a comprehensive overview of Python programming, as provided by online sources such as The Python Tutorial or the Scipy Lecture Notes. Instead, restricting to simple data structures and basic functions (while avoiding more complex topics such as object-oriented programming), the PCP notebooks do not want to overwhelm students when using Python for the first time.
When designing the PCP notebooks, one main motivation was to provide some basics as required for working with more advanced signal-processing toolboxes. In particular, the PCP notebooks are inspired and designed to bridge the gap to the FMP notebooks for teaching and learning fundamentals of music processing (FMP). Furthermore, we want to point out the excellent Python package librosa, which is a widely used Python library containing standardized and flexible reference implementations of many common methods in audio and music processing.
The following literature gives further pointers to educational material in the context of music and audio signal processing in the spirit of the PCP notebooks.
Prof. Dr. Meinard Müller
Friedrich-Alexander Universität Erlangen-Nürnberg
International Audio Laboratories Erlangen
Lehrstuhl Semantic Audio Processing
Am Wolfsmantel 33, 91058 Erlangen
Email: meinard.mueller@audiolabs-erlangen.de
The PCP notebooks build on material and insights that have been obtained in close collaboration with different people. We would like to express our gratitude to former and current students, collaborators, and colleagues who have influenced and supported us in creating this course, including (in alphabetical order):
The International Audio Laboratories Erlangen are a joint institution of the Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU) and Fraunhofer Institute for Integrated Circuits IIS.