Code covered by the BSD License  

Highlights from
Shannon-fano encoder


4.0 | 1 rating Rate this file 45 Downloads (last 30 days) File Size: 97.6 KB File ID: #41727

Shannon-fano encoder



13 May 2013 (Updated )

a shannonfano encoder with a row matrix input of occurrences/probab and outputs codewords&avelength

| Watch this File

File Information

%made by Jamil Kasan from Manila, Philippines
%input = row matrix of occurrences or probabilities e.g. ss=[1 3 4 5] or
%ss=[0.4 0.3 0.2 0.1]
%outputs = string of codewords,average codeword length

to try its credibility, play sf encoder (need to change the location of ff7.txt)

sfencoderkasan is a function file for shannon-fano encoder
its input is a row matrix of occurrences or probabilities
its outputs are ​codex which is the codewords and T which is the average codeword length

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
09 Nov 2013 Jamil Kasan

btw, thanks for the comment and rate

09 Nov 2013 Jamil Kasan

the outputs are in string characters, only for display purposes, that's why.

19 Oct 2013 ahmed

this is really amazing but when i tried it it gave me {1x1 cell} instead of all codes i tried to fix it but with no result can u just tell me why it gave my these results ?

15 May 2013 Jamil Kasan

the sfencoderkasan is a pcode, comment and rate please. pm me for the source code (

13 May 2013 Jamil Kasan

Please comment or rate, that would be much appreciated. Thanks.

Contact us