This repository is intended to be an introduction to digital signal processing concepts. The included Python scripts are designed to provide a basic understanding about how common signal processing algorithms are used to perform operations on discrete time signals and systems. The code is just for the educational purposes and by no means is production-ready.
| Topic | Program | Description |
|---|---|---|
| Audio Processing | read_audio.py |
read a .wav file, plot its left & right channels |
noisy_audio.py |
read a .wav file, add WGN to it, plot noisy signal, and save it to a new file |
|
chirp.py |
create a chirp signal. play, plot and save as file. | |
| Biomedical Signal Processing | ecg.py |
read ECG data from WFDB format file, unpack and plot it. |
ecg_mit.py |
read, unpack, and plot a 12-bit packed ECG file (MIT-BIH). | |
| Fourier Transform & Convolution | dft.py |
compute FFT using numpy. |
convo.py |
perform linear and circular convolution of two sequences using FFT with numpy. | |
circ_zeropad_conv.py |
perform circular zero-padded convolution of two sequences using FFT. | |
dct.py |
write functions for DCT & inverse DCT and use on an example. | |
dht.py |
write functions for Discrete Heartly Transform (DHT) with example. | |
fft_conv_perf.py |
performance analysis of linear & zero-padded circular convolution. | |
| Discrete Time Systems | diff_eq.py |
calculate amplitude and phase response of a system with FFT & series methods. |
conv_overlap_save.py |
convolution of long sequence using overlap and save method. | |
conv_overlap_add.py |
convolution of long sequence using overlap and add method | |
| Simple FIR Filters | fir_lpf1.py |
First order FIR low-pass filter |
fir_lpf2.py |
Second order FIR low-pass filter | |
fir_hpf1.py |
FIR high-pass filter | |
fir_bpf1.py |
FIR band-pass filter | |
fir_bsf1.py |
FIR band-stop filter | |
| Simple IIR Filters | iir_lpf1.py |
IIR low-pass filter |
iir_hpf1.py |
IIR high-pass filter | |
iir_bpf1.py |
IIR band-pass filter | |
iir_bsf1.py |
IIR band-stop filter | |
| Windowed FIR Filters | window_fir_lpf1.py |
FIR LPF using Hanning window (Example#1) |
window_fir_hpf1.py |
FIR HPF using Hanning window (Example#2) | |
window_fir_bpf1.py |
FIR BPF using Hanning window (Example#3) | |
window_fir_bsf1.py |
FIR BSF using Hanning window (Example#2) | |
| Optimal FIR Design |
All programs are written and tested in Python 3.10.12 on Ubuntu 22.04. The list of required packages is provided as a requirements.txt. It's advised to create a separate virtual environment to test the code.
Although playsound package, used to play wave files, has no dependencies, but it performs better with pygobject that depends on: libcairo2-dev, libgirepository1.0-dev.
Some useful documentation on core concepts and programming patterns is also included in markdown docs:
All source code files are located in the project root. Moreover, there are other directories that serve different purposes:
data: datasets and output files.fig: plots and figures saved as files.docs: reading material.
- Sound Examples
- Will Two Do? Varying Dimensions in Electrocardiography: The PhysioNet/Computing in Cardiology Challenge 2021
- The PhysioNet/Computing in Cardiology Challenge 2021
- Yoo et. al., Standardized Database of 12-Lead Electrocardiograms...
- Zheng et. al., A 12-lead electrocardiogram database for arrhythmia research covering more than 10,000 patients
- Norwegian Endurance Athlete ECG Database
- MIT-BIH Arrhythmia database