2

I'm generating a 440Hz sine wave in 32bit floating point audio format with SDL2.

I've read else where that 32bit floating point audio format is normalised between -1.0 and +1.0.

With that statement I would expect clipping to occur for values beyond -1 and +1.

as I increase the amplitude of the sine wave beyond -1.0 and +1.0, the tone becomes loader (really really loud at 3000 amplitude), and no clipping seems to occur.

so my questions are:

  • what is happening with amplitudes beyond -1.0/+1.0 and why doesn't it clip?

  • what is the maximum amplitude value in 32bit floating point audio format?

  • Is there anywhere that defines the -1/+1 normalisation convention?

Cœur
  • 37,241
  • 25
  • 195
  • 267
MrRadiotron
  • 71
  • 1
  • 7

1 Answers1

3

When converting from integer formats to floating point, SDL maps to [-1, 1], however when mixing it clips at max float: [-3.402823466e+38F, 3.402823466e+38F].

Apart from this, SDL appears to pass float audio data through directly to its many audio device implementations unmodified, so your question becomes operating system/audio card specific.

In your case, your signal has probably been "logarithmed" at some point, hence the lack of clipping at 3000x.

Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159