maximus
maximus

Reputation: 4302

Compression algorithms for a sequence of integers

Are there any good compression algorithms for a large sequence of integers (A/D converter data). There is similar question

But the data is different in my case. It can be negarive or positive and changing like wave data.

EDIT1:sample data added

Please refer to this file for a data sample

Upvotes: 3

Views: 730

Answers (4)

Walter Mundt
Walter Mundt

Reputation: 25281

Nearly any standard compression algorithm for byte strings can be applied; after all, any file of data can be interpreted as a sequence of signed integers. Is there something special about your particular integers that you think will make them amenable to some more-specific algorithm? You mention wave data; maybe take a look at FLAC which is designed for audio data; if your data has similar characteristics those techniques may be valuable.

Upvotes: 2

Cybercartel
Cybercartel

Reputation: 12592

You want a Delta Encode and then you want to apply a RLE or a Golomb Code. The Golomb Code can be as good as a Huffman Code.

Upvotes: 2

maxim1000
maxim1000

Reputation: 6375

Generally if you have some knowledge about the signal, use it to predict next value basing on previous ones. Then - compress difference between predicted and real value.

If prediction is good, differences will be small and their compressing will be good.

Anything more specific is unlikely possible without seeing the data and knowing about its physical nature.

update:

If the prediction is really well and uses all knowledge about dependencies, the differences are likely to be independent and something like arithmetic encoding would work for them.

Upvotes: 4

Eugen Constantin Dinca
Eugen Constantin Dinca

Reputation: 9150

You could diff the data then apply RLE on suitable subregions (i.e. between inflection points).

Upvotes: 1

Related Questions