This repository contains comprehensive course materials for the Adaptive Signal Processing course from the Graduate Program in Electrical Engineering at the Federal University of Campina Grande (UFCG), Brazil.
The course covers fundamental and advanced topics in adaptive signal processing through interactive Jupyter notebooks with theory, Python implementations, and visualizations.
The course is organized in nine Jupyter notebooks:
-
Introduction to Adaptive Signal Processing - Applications of adaptive signal processing and review of basic concepts of digital signal processing (sampling theorem, discrete-time convolution, z-transform, DTFT, and DFT)
-
Introduction to Adaptive Filtering - General structure of adaptive filters, system identification, linear prediction, interference cancellation, and inverse modeling
-
Review of Probability and Stochastic Processes - Random variables, probability distributions, expected values, correlation functions, and stationarity
-
The Wiener Filter and the LMS Algorithm - Optimal linear filtering in the mean-square sense, Wiener-Hopf equations, gradient descent optimization, and the Least Mean Squares (LMS) algorithm
-
Variants of the LMS Algorithm - Normalized LMS (NLMS), LMS-Newton algorithm, and convergence analysis
-
RLS Algorithms - Recursive Least Squares algorithm, forgetting factor, and comparison with LMS methods
-
Kalman Filters - State-space representation, Kalman filtering for linear systems, prediction and update steps
-
MLP Neural Networks - Multi-layer perceptrons, backpropagation algorithm, and applications in adaptive signal processing
-
Blind Adaptive Filtering - Adaptive equalization without training sequences, constant modulus algorithm (CMA), and other blind adaptation techniques
AdaptiveSignalProcessing/
├── notebooks/ # Jupyter notebooks with course materials
│ ├── *.ipynb # 9 interactive notebooks covering all topics
│ ├── algorithms.py # Adaptive filtering algorithm implementations
│ ├── utils.py # Utility functions for visualization and processing
│ └── figures/ # Images and diagrams used in notebooks
├── python scripts/ # Additional Python scripts
│ └── gradient_adaptation.py
├── slides pt-br/ # Course slides in Portuguese
└── README.md # This file
- Python 3.7 or higher
- Jupyter Notebook or JupyterLab
- Basic knowledge of signal processing and linear algebra
- Familiarity with Python and NumPy
-
Clone the repository:
git clone https://github.com/edsonportosilva/AdaptiveSignalProcessing.git cd AdaptiveSignalProcessing -
Install required packages:
The notebooks require the following Python packages:
- NumPy
- Matplotlib
- SciPy
- SymPy
- Numba
- SciencePlots (for IEEE-style plots)
Install them using pip:
pip install numpy matplotlib scipy sympy numba scienceplots
-
Launch Jupyter:
jupyter notebook
Navigate to the
notebooks/directory and open any notebook to start learning.
The notebooks are designed to work seamlessly with Google Colab. Simply:
- Open any notebook in GitHub
- Click the "Open in Colab" button (or manually open in Colab)
- The notebook will automatically clone the repository and install dependencies
This module provides optimized implementations of adaptive filtering algorithms using Numba's just-in-time compilation:
estimate_correlation_matrix(x, N): Estimates the unbiased correlation matrix from a signal sequenceestimate_cross_correlation(x, d, N): Estimates the unbiased cross-correlation vector between input and desired signalslms(x, d, Ntaps, μ): Least Mean Squares adaptive filter with step size μnlms(x, d, Ntaps, μ, γ=1e-6): Normalized Least Mean Squares algorithm with step size μ and regularization parameter γ (default: 1e-6)lms_newton(x, d, Ntaps, μ, α): LMS-Newton algorithm with step size μ and inverse correlation matrix update parameter αrls(x, d, Ntaps, λ): Recursive Least Squares algorithm with forgetting factor λkalman_filter(A, C, Rn, Rv, x_init, y): Kalman filter for state estimation in linear systemstime_varying_filter(x, H): Applies a time-varying filter with coefficient evolution matrix H
All adaptive filtering functions return the filtered output, final filter coefficients, squared error history, and the evolution of filter coefficients over time.
This module provides visualization and utility functions for the notebooks:
set_preferences(): Configures matplotlib plotting parameters for consistent figure stylingroll_zeropad(a, shift, axis): Rolls array elements with zero-paddingdiscreteConvolution(x, h, steps, D): Computes discrete convolution with visualization supportgenConvGIF(): Generates animated GIF visualizations of the convolution processgenTapsUpdateGIF(H, figName, ...): Creates animated visualizations of adaptive filter coefficient evolutionsymdisp(expr, var, unit, numDig): Displays symbolic mathematical expressions with proper formattinground_expr(expr, numDig): Rounds symbolic expressions to specified precisionrandom_square_signal(num_samples, period, duty_cycle): Generates random square wave signals for testing
This work is licensed under CC0 1.0 Universal (Public Domain). Feel free to use, modify, and distribute for educational and research purposes.
Edson Porto Silva
Graduate Program in Electrical Engineering
Federal University of Campina Grande (UFCG)
Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.
