Re: [linux-audio-user] Flac vs wavpack and float32 to pcm24 conversion tests

From: Erik de Castro Lopo <mle+la@email-addr-hidden-nerd.com>
Date: Mon Mar 05 2007 - 02:53:07 EET

Paul Davis wrote:

> On Mon, 2007-03-05 at 08:37 +1100, Erik de Castro Lopo wrote:
> > I would be **very** surprised if it was. For a normalised WAV file
> > the maximum value would be 1.0 which will correspond to a pcm24
> > value of 0x7ffffff.
>
> i see no problem with that value, assuming you mean it represent 2^24-1.
> do you?

No, 2^23 -1. We need a sign bit. Remember? :-)

In signed 24 bit numbers all negative numbers have the most significant
bit set and all negative numbers have it clear. That means the maximum
positive 24 bit number is 0x7fffff.

> IEEE 32 bit floating point has 1 sign bit and 23 bits of mantissa. i
> don't see how you can get 1/(2^25) out of that. the small representable
> value with an effective non-unity exponent (i.e. ignoring the bias
> stuff) is 1/(2^23), isn't it?

That value (1/(2^25)) was just given as an example.

Let me put it another way. The smallest value we can respresent with
signed 24 bit numbers as a notmalised float is

       1.0 / 0x7fffff

But, the value

       1.0 / (0x7fffff + 1.0)

is also a legal normalised float value but it is less than the smallest
value that can be represented as signed pcm24.

This is basically an existance proof that there are normalised floating
point numbers that will not survive the

      float32 -> pcm24 -> float 32

transformation.

Erik

-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
Linux, the UNIX defragmentation tool.
Received on Mon Mar 5 04:15:03 2007

This archive was generated by hypermail 2.1.8 : Mon Mar 05 2007 - 04:15:03 EET