Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Small Data Packet Compression

Status
Not open for further replies.

salman83

Newbie level 4
Joined
May 23, 2006
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,343
Hi,
I am reading some data on microcontroller which i want to send out to pc using usb. I need to compress the data so that i can send as much data as possible on usb. One data packet size is 16 bytes which I need to compress to 12 bytes as max. Does anybody know any algorithm which compresses this small packet of data.
Any help will be appreciated.
Regards.
 

Hi,

What data format is it now?
And what information is in the data?

Klaus
 

Hi, Thanks for the reply.
Yes, it needs to be lossless compression. Also, the data is byte array.
 

Do you understand how data compression works? It's only feasible if the data involves redundancy that can be reduced by recoding, e.g. repeated bytes or more generally repeated patterns. Achieving a guaranteed reduction of small data entities is rather unlikely. What's the nature of your data, beyond being byte arrays?
 

Yeah my thought is that you're probably better off compressing it yourself.

You have information and knowledge about the data which no general purpose algorithm has access too. Thus you're probably in a better position to cut out extra data than any general purpose algorithm.

For example if you're transmitting ASCII characters in standard 8-bits but you know you're not using most symbols you might be able to encode them with 7, 6 or even 5 bits. This is knowledge only you have and this is the thought process you need to use to shrink the data format.
 

It's kind of a rule that no lossless compression algorithm will actually compress all files. Asking for a 25% compression for only 16 bytes might be unobtainable.

For example, do you think you can compress 2 bytes down to one byte?
 

It might be a peace of cake if it's an ascii protocol that could be converted to binary for example.

Or not...I assume information theory has definitions for this stuff but you can't actually compress information. You can optimize how information is packed into a given container. You can identify and throw out repetition. You can have sender and receiver agree on certain things so they don't need to be retransmitted. Lossy compression can intelligently throw out the least important things. But information is information. If you have X bits of actual information then you need to send X bits. No less.
 

You have managed to totally miss the point of data compression while also contradicting yourself.

Like I said, there are probably actual terms to use to describe this more precisely....however the point stands. If the OP really needs to transmit 2^(8*16) possibilities then no compression algorithm is going to help.

Lossless compression algorithms can't throw out actual information: they can only identify bits that are carrying redundant or unnecessary information and throw away those.

And again: a general purpose algorithm with no special knowledge about the data being transmitted is going to have almost no chance of working on such a small word. Hence the OP is better off compacting the data format for themself.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top