Skip to content

Repository files navigation


Python Multimedia Signals

A collection of Python applications and algorithms for multimedia signal processing, covering image manipulation, probability, Huffman coding, and JPEG compression.

Explore the Documentation »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Lessons Learned
  3. Getting Started
  4. Usage
  5. Contact
  6. Acknowledgments

About The Project

JPEG Compression Performance

Performance analysis of JPEG compression: Visual comparison and Signal-to-Noise Ratio (SNR).


This repository contains Python Multimedia Signals, an academic project developed from scratch for the Codificação de Sinais Multimédia course at ISEL - Instituto Superior de Engenharia de Lisboa.

The primary goal of this project is to implement and analyze multimedia coding algorithms. The repository is divided into four main practical assignments that explore the fundamentals of digital signal processing, from raw image manipulation and probability analysis to advanced source coding techniques like Huffman and JPEG compression.

(back to top)


Built With

  • Python
  • Jupyter
  • OpenCV
  • NumPy
  • Matplotlib
  • SciPy

(back to top)


Features & Key Highlights

  • Image Processing & Error Correction: Implementation of grayscaling, colormaps, histogram generation, and transmission simulations across a Binary Symmetric Channel with Hamming (7,4) error correction.
  • Statistical Signal Analysis: Practical application of Probability concepts, Bayes Theorem, and Joint/Conditional Probabilities on visual data.
  • Huffman Coding: Lossless data compression using entropy concepts and Huffman trees, achieving optimal source coding for varying data formats.
  • JPEG Compression Pipeline: Full implementation of a lossy compression pipeline, including 8x8 block Discrete Cosine Transform (DCT), quantization matrices, and zigzag scanning.

(back to top)


Output Examples

Note

The images below represent only a small fraction of the outputs generated by this project. The notebooks contain extensive additional tests, theoretical explanations, and varied input examples for each algorithm.

Here are some visual results and outputs generated by the algorithms implemented in the practical assignments:

TP1: Image Processing & Error Correction

Example of an image corrupted by transmission noise across a Binary Symmetric Channel (left) and its successful recovery using Hamming Codes (right).

Corrupted Image Corrected Image
Corrupted Image (Transmission Noise) Corrected Image (Hamming Codes)

TP2: Probability & Statistical Analysis

Probability Analysis

Statistical analysis of pixel intensity distributions.

TP3: Huffman Coding Efficiency

Huffman Coding

Relation between symbol probability and Huffman code length.

TP4: JPEG Compression Quality Levels

Comparison of JPEG compression with different quality factors.

High Quality Low Quality
High Quality (Q=80) Low Quality (Q=10)

(back to top)


Lessons Learned

  • Signal Processing Fundamentals: Deepened the understanding of the mathematical foundations behind multimedia signals and their digital representations.
  • Data Compression Algorithms: Gained hands-on experience in effective data compression, balancing lossless (Huffman) guarantees and lossy (JPEG) efficiency.
  • Statistical Modeling: Consolidated theoretical knowledge on probability and statistical tools applied to practical signal analysis and prediction.
  • Algorithm Implementation: Improved programming skills by writing robust and efficient signal processing algorithms using Python and Jupyter Notebooks.

(back to top)


Getting Started

Follow these instructions to set up a local copy of the project on your machine.

Prerequisites

  • Python 3.8+
  • Jupyter Notebook or JupyterLab
  • Git

Installation & Running Locally

  1. Clone the repository:
    git clone https://github.com/GuilhermeGraca/python-multimedia-signals.git
  2. Navigate to the project directory:
    cd python-multimedia-signals
  3. Start Jupyter Notebook:
    jupyter notebook
  4. Open the desired assignment: Navigate through the folders and open the corresponding .ipynb file to run the code.

(back to top)


Usage

You can use the notebooks in this repository to study and test various multimedia coding algorithms. Each folder contains a standalone Jupyter Notebook detailing the theoretical background and the Python implementation for its specific topic.

  • tp1-image-processing-hamming: Explore colormaps, image statistics, Hamming distance, and error correction.
  • tp2-probability-bayes: Run statistical analysis and conditional probability tests on image signals.
  • tp3-huffman-coding: Test source coding and optimal data compression algorithms with Huffman trees.
  • tp4-jpeg-compression: Compress and decompress images using the DCT and quantization steps of the JPEG standard.

(back to top)


Contact

Guilherme Graça - LinkedIn - GitHub

Project Link: https://github.com/GuilhermeGraca/python-multimedia-signals

(back to top)


Acknowledgments

  • ISEL - Instituto Superior de Engenharia de Lisboa for providing the academic context and resources.
  • The professors and staff of the Codificação de Sinais Multimédia course for their guidance and support.

(back to top)

About

Python implementations of multimedia signal processing algorithms, covering image manipulation, statistical analysis, Huffman coding, and JPEG compression.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages