Huffman Coding with norm2huff and huff2norm function

I have an 8000 information signal and then it is compressed using huffman coding (norm2huff) and then the signal is transmitted over the rayleigh channel. And during the decompression process using the huff2norm function, the number of information signals increases to 8932. Can you explain why that happened? Thanks before
[zipped,info] = norm2huff(quantized_sound); %compress
unzipped = huff2norm(uint8(decoded),info); %de-compress

10 Comments

What kind of error detection and correction is done on the Rayleigh channel?
After being compressed, the information signal enters the channel coding block using the 2/3 rate convolutional code technique. the information signal is transmitted through the rayleigh channel with a value of snr = 5 db. Then enter the channel decoding (viterbi) and get BER 0.49. After that the information signal is de-compressed but the information signal becomes 8932
Huffman coding can only be used when the channel is perfect after error detection and correction, unless you introduce synchronization points in the stream that act to restrict error propagation (in which case a portion of the output might be wrong, but then you recover and start outputing correct data again.)
Thank you for the answer, that's very helpful. But it does not matter for me if the information signal after being de-compressed got an error if the channel is not perfect. But I'm just confused why the number of information signals after being compressed has increased (from 8000 to 8932). Is it back again because the channel isn't perfect?
Imagine that you have a huffman dictionary:
01 -> Darajat
00 -> wins!
1 -> Ibnu
Now let us imagine that you have the "message" Darjat to send. That gets encoded as 01 . Now let that 01 get transmitted, but let there be a bit error on the 01 such that what is received after detection and correction is 11 . Decode that bit stream according to the dictionary. You start from the beginning of the stream and see that you have a 1 in hand. Match that to the dictionary. Temporarily eliminate all of the items in the dictionary that start with 0, and retain the rest and discard the leading 1 bit. That gives you the dictionary that contains only (empty) -> Ibnu . Are you at a dictionary with a single empty entry? Yes you are -- emit the corresponding string and restore the full dictionary, so you emit Ibnu and continue on to the second 1 out of the 11 that the receiver got. Some decoding logic again, so the 1 matches and again you emit Ibnu . So now you have emitted Ibnu Ibnu -- two items where you only expected one item, Darajat
If you have even a single bit error in a huffman sequence, then everything after that can get messed up in decoding and the number of items emitted can be quite different than if you did not have the error.
one last question, can I get a value of average length from this fuction?
I am not sure what you mean by the average length of the function?
In Huffman's theory, after data compression we can calculate the entropy, efficiency, and average code length. in this function, can we calculate the average code length (avglen)?
Sum of (probability times length of encoding) , where probability is fraction of occurrences in the original source.

Sign in to comment.

Answers (0)

Categories

Products

Asked:

on 14 Aug 2019

Commented:

on 15 Aug 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!