Path: news.mathworks.com!newsfeed-00.mathworks.com!news.mv.net!news.glorb.com!news2.glorb.com!news.glorb.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.web-ster.com!news.web-ster.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 03 Apr 2010 18:04:43 -0500
Date: Sat, 03 Apr 2010 16:05:36 -0700
From: Tim Wescott <tim@seemywebsite.now>
User-Agent: Thunderbird 2.0.0.24 (X11/20100317)
MIME-Version: 1.0
Newsgroups: comp.soft-sys.matlab,comp.dsp
Subject: Re: How do I compress an array of floating numbers in Matlab?
References: <205a603e-cc38-4088-8d39-5d5b8464abf7@d34g2000vbl.googlegroups.com>
In-Reply-To: <205a603e-cc38-4088-8d39-5d5b8464abf7@d34g2000vbl.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <j9idncb1zqsWVCrWnZ2dnUVZ_gqdnZ2d@web-ster.com>
Lines: 36
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-vhsuScgJEIzYIP91fagynmbCCKlWgOwxYyWAzGKdF7KsfIFTYIOTkIPMkDpTxPrcK+7QtXFub5XskJi!+VSzt0ZahDoJaUcg5Q1wIoMKF3KMHcHnvWnBxp+SeBxqV1s++wI+zkQkBbWb/tmQyk8NwKZZ4vaN!AjPhpY6Tr5sDN2Y=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
Xref: news.mathworks.com comp.soft-sys.matlab:623220 comp.dsp:269977

Luna Moon wrote:
> Hi all,
> 
> I have a vector of real numbers in Matlab. How do I compress them?  Of
> course this has to be lossless, since I need to be able to recover
> them.
> 
> The goal is to study the Shannon rate and entropy of these real
> numbers, so I decide to compress them and see how much compression
> ratio I can have.
> 
> I don't need to write the result into compressed files, so those
> headers, etc. are just overhead for me which affect me calculating the
> Entropy... so I just need a bare version of the compress ratio...
> 
> Any pointers?

Find another approach to getting an answer, maybe.

First, most lossless compression algorithms are designed for things like 
text, executables, and data bases -- they don't do well with floating 
point numbers, tending to see them as "random" even when they're not.

Second, if you measure a bunch of meaningless white noise and put the 
result into floating point numbers, then put them into a lossless 
algorithm that _can_ handle floating point, it's not going to compress 
at all, because the algorithm can't distinguish between white noise and 
a signal that's chock-full of information.  In effect you'll have 
_given_ it a signal full of information, in great detail, about the noise.

I think you're leading yourself down the garden path.

-- 
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com