PCPT Teaser

Introduction¶

The PCPT notebooks are open-source learning materials that provide a gentle introduction to PyTorch, one of today's most widely used machine learning frameworks. Rooted in ideas from signal processing for time-series data (e.g., audio signals), the notebooks build an intuitive bridge between classical concepts such as filtering, convolution, and recursive systems, and modern learning-based methods. Built on the interactive Jupyter platform, they combine code, explanations, formulas, and visualizations in one place. Designed for learners with basic signal processing and Python skills, the PCPT notebooks focus on exploring the key ideas of machine learning in a clear and accessible way. The course emphasizes:

  • PCP continuation: The PCPT notebooks extend the PCP notebooks, which provide educational material for a Preparation Course in Python (PCP).

  • Self-study & teaching: They are suited for self-study or as course material. For example, we use them as a basis for research internships in Master's programs, including Communications and Multimedia Engineering (CME), Electrical Engineering (EEI), Information and Communication Technology (ICT), Data Science, and Artificial Intelligence (AI).

  • Math recap: The notebooks cover gradient descent, linear regression, convolution, recursion, binary and multiclass classification, cross-entropy, and evaluation metrics.

  • DSP connection: Machine learning concepts are related to digital signal processing topics such as convolutional and recursive filters, low- and high-pass filtering, smoothing, denoising, and onset detection. Unlike resources focusing on 2D image processing, we emphasize 1D sequence data, which is often less technically demanding.

  • Low entry barriers: The notebooks use toy examples and synthesized datasets, focus on principles rather than big data, and run on standard CPUs without specialized hardware. This allows learners to focus on understanding concepts without technical hurdles.

In summary, the PCPT notebooks aim to help students transition naturally from learning PyTorch fundamentals to developing the skills needed for independent research in machine learning and signal processing.

CC

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

  • Meinard Müller, Johannes Zeitler, Sebastian Strahl: PCPT Notebooks: A Preparation Course for PyTorch. 2025.
    Bibtex

Get Started¶

If a static view of the PCPT 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 PCPT notebook Get Started.

Structure and Content¶

The collection of PCPT 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 and textbook-like explanations. At the end of each unit, one finds coding exercises. For self-evaluation, the PCPT 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 libpcpt. 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 Classes class definition; object-oriented programming; __init__(); instance attributes; class attributes; .__doc__; methods; self; inheritance; super(); overriding methods [html] [ipynb]
3 PyTorch Tensors Tensor creation; torch.tensor; tensor attributes; .shape;data types; tensor operations; indexing; slicing; reshaping; .squeeze; linear algebra; eigen decomposition; storage; memory layout [html] [ipynb]
4 Automatic Differentiation Gradient computation; gradient descent; .grad; automatic differentiation; torch.autograd; requires_grad; backpropagation; .backward(); parameter update; tensor shapes; batch dimension; polynomial regression [html] [ipynb]
5 Neural Network Modules Neural networks; layers; torch.nn; nn.module; linear model; nn.linear; non-linear model; activation functions; ReLu; sigmoid; tanh; loss function; nn.MSELoss, optimizers; optim.SGD; torch.optim; training loop; polynomial regression; piecewise linear approximation [html] [ipynb]
6 Convolution and CNNs Discrete 1D convolution; cross-correlation; nn.Conv1d; kernel size; padding; stride; dilation; denoising; smoothing; edge detection; low-pass filter; high-pass filter; band-pass filter; Dataset; DataLoader [html] [ipynb]
7 Classification Binary classification; multiclass classification; sigmoid; softmax; logits; cross-entropy loss; nn.CrossEntropyLoss; nn.Sequential; sine waves; square waves; frequency; accuracy; confusion matrix; out-of-distribution data [html] [ipynb]
8 Training Dynamics Overfitting; generalization; 2D point cloud classification; training set; validation set; test set; validation monitoring; loss and accuracy curves; early stopping; learning rate scheduling [html] [ipynb]
9 Recursion and RNNs Recursive filters; FIR/IIR; impulse response; recurrent neural networks; nn.RNN; hidden states; onset detection; class imbalance; peak picking; precision; recall; F-measure [html] [ipynb]
10 Further Essential Techniques Broadcasting; gradient flow; detach; input normalization; batch normalization; regularization; weight decay; L2 regularization; dropout; custom functions; L1 loss; correlation loss; spectral loss [html] [ipynb]

Further Notes, Links, and Literature¶

The PCPT notebooks are a natural continuation of the PCP notebooks, serving as a more advanced course that moves from Python programming and signal processing fundamentals toward learning-based and data-driven methods using PyTorch. While the PCP notebooks emphasize Python programming and algorithmic principles, the PCPT notebooks focus on understanding and implementing machine learning models that learn from data. Building upon and motivating examples from classical signal processing for time-series data, they form a coherent educational sequence from structured programming to exploratory model development.

The PCPT notebooks can also be combined with other open educational resources such as the FMP notebooks (Fundamentals of Music Processing) and tools like librosa, forming a broader foundation for music and audio processing using PyTorch. These connections enable learners to transfer their knowledge between signal processing, music information retrieval, and machine learning within a unified framework.

In summary, the PCPT notebooks bridge the gap between algorithmic thinking and data-driven modeling, helping students develop a conceptual and practical understanding of machine learning in the broader context of signal and audio processing. The following literature provides additional 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 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. doi: 10.21105/jose.00148
    BibTeX PDF GitHub HTML
  •     
  • 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 PCPT 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.

PCPT License