Skip to content

Huffman coding using Matlab (Generalised Code for Binary or Terenary or So on.)

Notifications You must be signed in to change notification settings

uktentu/Huffman_Coding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Huffman_Coding

This repository contains Python and MATLAB implementations of Huffman coding, a data compression algorithm.

Repository Structure

  • Python: Python code for Huffman coding.
  • Matlab: MATLAB code for Huffman coding.

Usage

Python (Huffman in Python)

  1. Go to the Python folder.
  2. Open Huffman.py.
  3. Modify symbols and values to match your data.
  4. Run Huffman.py to generate Huffman codes.

MATLAB (Huffman in MATLAB)

  1. Go to the Matlab folder.
  2. Run MainHuffman.m in MATLAB.
  3. Modify symbols and values to match your data.
  4. Run MainHuffman.m to generate Huffman codes.

Functionality

  • The code generates Huffman codes for a given set of symbols and their probabilities.
  • It calculates and displays Huffman codes for the given set of symbols using the generated Huffman codes.

Files

  • Python: Huffman.py
  • Matlab: Node.m, buildHuffmanTree.m, printNodes.m, MainHuffman.m

Example Data

Example data is provided in the scripts. Replace it with your data.

About

Huffman coding using Matlab (Generalised Code for Binary or Terenary or So on.)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published