• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Easy question about digital audio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Easy question about digital audio


  • Subject: Re: Easy question about digital audio
  • From: Michael Ashton <email@hidden>
  • Date: Sun, 7 Dec 2003 14:44:22 -0700

On Dec 4, 2003, at 11:53 PM, Andrew Garber wrote:

I'm trying to write my very first AudioUnit. What are the max and minimum floating point values for a sample of 16-bit audio?

is the range -1.0 to +1.0?

The *nominal* range for floating-point is in fact -1 to 1; by convention, this is the range to which a signed fixed-point sample is mapped.

An IEEE-754 format floating-point number has one sign bit, 8 exponent bits, and 23 mantissa bits. The nice thing about floating-point is that when you exceed the 23-bit-plus-sign range, you can change the exponent, which moves you to a different range. This way you don't clip - in other words, you lose bits on the right, but gain them on the left.

A floating-point number is like a window on a very, very wide fixed-point number. The window is 23 bits wide, so you can only look at 23 bits of the fixed-point number at a time, but the window can be slid around so that you can look at any 23 bits of the fixed-point number.

Of course, there's no such thing as a floating-point DAC (or ADC), so it all goes back to fixed-point eventually. But before that happens, you can reduce the gain so that you don't get clipping at the output. This is why audio people like to use floating-point.

There's an interesting article at Rane which argues against the use of floating-point in audio processing. If you can get past the polemic tone, the article offers good insight into floating-point in audio DSP:

http://www.rane.com/note153.html

cheers
----
Michael Ashton <email@hidden>
"I'm really lucky that Microsoft set the bar so low for my profession ..."
--- My brother-in-law, a (very good) professional programmer
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Easy question about digital audio (last time, I promise ...)
      • From: Michael Ashton <email@hidden>
    • Re: Easy question about digital audio
      • From: Michael Ashton <email@hidden>
References: 
 >Easy question about digital audio (From: "Andrew Garber" <email@hidden>)

  • Prev by Date: talking to my kernel driver
  • Next by Date: Re: Easy question about digital audio
  • Previous by thread: Re: Easy question about digital audio
  • Next by thread: Re: Easy question about digital audio
  • Index(es):
    • Date
    • Thread