LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help! i need an example of huffman encoding

i dont compleately understand the theory.. a working vi example would be apreciated . Thanks in advance
0 Kudos
Message 1 of 5
(3,447 Views)
What is it exactly that you are trying to compress? What will the compression be used for?

If all you need is to do something like compress datafiles to make them smaller for transmission, a much easier road is to utilize a commercially available library to do the compression for you.

One I have used with great success in the past is the DynaZIP activex controls from InnerMedia. They are cheap and have no license fee for redistribution.

To learn more about Huffman encoding in general, do an online search for "Huffman Encoding". There are many easy-to-understand explainations of the algorithm and how it's used. This type of encoding isn't rocket science, once you understand how it works the implementation is trivial--as demonstrated by the number o
f programming classes that use huffman encoding as a class design projects.

Give me a little more information on exactly what you are trying to do, and I should be able to come up with something for you...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(3,447 Views)
first of all, Mike, thanks for answering my call
I am taking a LABVIEW course in college, and the teacher asked us to build a VI that compresses a text message using the hoffman method.
Understanding the theory seems simple enough, but implementing it in a LABVIEW program is another .
If you think tou have any suggestions...
Thanks in advance
0 Kudos
Message 4 of 5
(3,447 Views)
Ok, the way to approach this problem is divide-and-conquer:There is really two parts to the problem of encoding a text file. First, you have to generate the tree containing the codes. Second, you have to use that tree as a lookup to encode the data. The harder of the two parts is the first.This first part in turn, can be broken into subtasks: generating the tree and traversing the tree to extract the codes.Now concentrating on the first subtasks, the most natural way to represent a tree structure is as a linked-list. Think about how to implement a linked-list that would represent the Huffman tree structure.Start with the data-structure that will hold the data and then look at the alogorithm for building the linked-list. Work on the data-structu
re first because if you get that right, the algorithm will be a snap.As you generate code, post it here and we can talk about it.Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 5
(3,447 Views)
the principe of huffman encoding is very simple.
if a letter is used a lot of time (like spc or 'e'), it will be coded with
few bits (2 or 3). if you want to compresse the char '%' or '#', it will
take 10 or 12 bits...
Hufmann made a tree for encoding every char. This tree is different for
every langage. In french, it's spc, e, s, a, n, t, i, l, u , o, ...
You must find your tree. I don't remember the coding of the letters but you
it's particular.
(by example a char begin by a 1 and finish by a 1, without two consecutive
1). So if you encounter two 1, it's a new letter.)


--
Jerome LANGE
Strasbourg
andromed@club-internet.fr

"dan6809" a ecrit dans le message news:
506500000008000000D8480000-1019262487000@exchange.ni.com...
> i dont comple
ately understand the theory.. a working vi example would
> be apreciated . Thanks in advance
0 Kudos
Message 3 of 5
(3,447 Views)