Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Compressing a signal with loss
Hello,

I would like to compress a signal that has some major constraints, and
compress it so that it will still keep the constraint after
decompression.

It a signal made of 0 and 1, where there can't be less than 2 ones in
a row, and more than 8. There can't be as well less than 2 zeros in a
row, and no more than 20 zeros.

The signal is coding for something, and 15 bits in the signal only
code a bit less than 3 bits. I would like to compress the 15 bits on 4
bits, and to be able to do it on the fly.

A dictionnary looks like the simplest thing, since i can allow bit
inversions (and stay in the constraint), but i don't know how to
choose the 'closest' pattern mapping the data. I'm not even sure it's
the best thing to do...

Thank you very much for your advices,
Nick

Report this thread to moderator Post Follow-up to this message
Old Post
Nick
04-09-05 08:55 PM


Re: Compressing a signal with loss
On Sat, 09 Apr 2005 16:26:17 +0200, Nick <no-email@published.nul>
wrote:
>Hello,
>
>I would like to compress a signal that has some major constraints, and
>compress it so that it will still keep the constraint after
>decompression.
>
>It a signal made of 0 and 1, where there can't be less than 2 ones in
>a row, and more than 8. There can't be as well less than 2 zeros in a
>row, and no more than 20 zeros.
>
>The signal is coding for something, and 15 bits in the signal only
>code a bit less than 3 bits. I would like to compress the 15 bits on 4
>bits, and to be able to do it on the fly.
>
>A dictionnary looks like the simplest thing, since i can allow bit
>inversions (and stay in the constraint), but i don't know how to
>choose the 'closest' pattern mapping the data. I'm not even sure it's
>the best thing to do...
>
>Thank you very much for your advices,
>Nick

Use simple run length encoding.
Each series of 1 can be encoded as 3 bits
and each series of 0 can be encoded as 5 bits.
(for an average of 4 bits)
You will of course also need to store/transmit which (0 or 1) comes
first.
(A simple dictionary lookup combing a 0-1 pair results in basically
the same thing)

It's simple, easy to do on the fly and doesn't depend of the data
distrubution.  If you know the distribution before hand  (ie. 4 zeros
occurs twice as often as 20 zeros, etc.) then huffman or other coding
may help further.

-Tim

Report this thread to moderator Post Follow-up to this message
Old Post
Tim Arheit
04-12-05 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Compression archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:13 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.