- zero value in samples
- Posted by Fraser Ross on October 8th, 2004
When using sound samples that are signed 8 bit is there a midpoint value?
Since there is an even number of possible values there is not a logical
midpoint. Should I view 0 as a positive value so that there are 128
positive values and 128 negative values or call it the midpoint and not use
the value -128?
Fraser.
- Posted by Paul Lutus on October 8th, 2004
"Fraser Ross" <fraserATmembers.v21.co.unitedkingdom> wrote:
If the sound samples are signed, then yes, zero is the midpoint.
Typically in signed bytes, the range is +127 ... -128, but there may be a
convention to use +127 ... -127 for the sake of symmetry.
Why not create a test file and try it out? If your assumptions are wrong, it
will sound terrible.
--
Paul Lutus
http://www.arachnoid.com
- Posted by Fraser Ross on October 8th, 2004
"Paul Lutus"
Why? Its only a minor accuracy issue.
The document wav.doc by Robert Shuler says 0 is the midpoint for the range
32767 to -32768. What I have been assuming seems to be the norm where 0 is
the first positive value and also used as the midpoint.
Fraser.
- Posted by Paul Lutus on October 8th, 2004
"Fraser Ross" <fraserATmembers.v21.co.unitedkingdom> wrote:
Because if you make the wrong assumption about how signed numbers are
handled, the interpreted value will wrap around. For example, if you take
32768 to be the largest positive value, the wave player will disgree and
your speakers will complain. It's a change of only one count, but it will
produce the maximum change in value.
Yes. That is the normal arrangement.
--
Paul Lutus
http://www.arachnoid.com
- Posted by Thomas G. Marshall on October 10th, 2004
Fraser Ross coughed up:
....[thwack]...
Unless, of course, someone somewhere is being mathematically picky in their
spec. 0 is a non-negative, it ain't a positive. Sorry, I should probably
go drink something with a /lot/ of alcohol in it.....
--
Framsticks. 3D Artificial Life evolution. You can see the creatures
that evolve and how they interact, hunt, swim, etc. (Unaffiliated with
me). http://www.frams.alife.pl/