PCP Teaser

Overview

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.

CC

Note: The code, text, and figures of the PCP notebooks are licensed under the MIT License. The latest version of the PCP notebooks is hosted on GitHub. Alternatively, you can download a zip-compressed archive containing the PCP notebooks and all data. Further details can be found in the PCP notebook on how to get started. We try to continuously improve the PCP notebooks and provide updates on a regular basis (current version: 1.1.3). For suggestions and feedback, please contact Meinard Müller. If you use and want to refer to the PCP notebooks, please cite:

  • Meinard Müller and Sebastian Rosenzweig: PCP Notebooks: A Preparation Course for Python with a Focus on Signal Processing. The Journal of Open Source Education (JOSE), 5(47), 2022.
    Bibtex PDF GitHub

Get Started

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.

Structure and Content

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]

Further Notes, Links, and Literature

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.

  • Brian McFee, Colin Raffel, Dawen Liang, Daniel P.W. Ellis, Matt McVicar, Eric Battenberg, and Oriol Nieto: Librosa: Audio and Music Signal Analysis in Python. Proceedings the Python Science Conference, 2015. doi: 10.25080/Majora-7b98e3ed-003
    Bibtex PDF GitHub
  • Brian McFee, Jong Wook Kim, Mark Cartwright, Justin Salamon, Rachel M. Bittner, and Juan Pablo Bello: Open-Source Practices for Music Signal Processing Research: Recommendations for Transparent, Sustainable, and Reproducible Audio Research. IEEE Signal Processing Magazine, 36(1) 128-137, 2019. doi: 10.1109/MSP.2018.2875349
    Bibtex PDF
  • Meinard Müller: Fundamentals of Music Processing – Using Python and Jupyter Notebooks. Springer Verlag, 2021.
    Bibtex Details
  • Meinard Müller, Brian McFee, and Katherine Kinnaird: Interactive Learning of Signal Processing Through Music: Making Fourier Analysis Concrete for Students. IEEE Signal Processing Magazine, 38(3) 73-84, 2021. doi: 10.1109/MSP.2021.3052181
    Bibtex PDF
  •     
  • Meinard Müller and Frank Zalkow: FMP Notebooks: Educational Material for Teaching and Learning Fundamentals of Music Processing. Proceedings of the International Conference on Music Information Retrieval (ISMIR), Delft, The Netherlands, 2019.
    Bibtex PDF
  • Meinard Müller and Frank Zalkow: libfmp: A Python Package for Fundamentals of Music Processing. Journal of Open Source Software (JOSS), 6(63) 3326:1-5, 2021. doi: 10.21105/joss.03326
    Bibtex PDF GitHub

Contact

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

Acknowledgment

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.

PCP License