sample values as short vs float or double

I'm a beginner to DSP, and so far have been reading sample values from audio files with libsndfile using sf_readf_short, and have calibrated my program to interpret sample values with a range of +-32768.

Now I am changing over to floating point values using sf_readf_float, or sf_readf_double. But for example, a sample in represented in using a 16 bit integer that has a value of 5, when represented as a 32 bit integer has a value of 327,680.

And this makes sense, because 5/32578=327680/2147583647 approximately.

And the same sample value in floating point representation is 0.000152588. So I suppose that the maximum possible values that can be used to represent a sample as a float is x where 0.000152588/x=5/32578, approximately. Is this correct?

But then I noticed that when represented as a double, the sample value is the same as when represented as a float.

So what's the difference, and what is the range?

When calibrating my dbfs signal level meter in, I am using this formula:

20 * Log10(peakvalue/32672)=db

edit: Duhh, I feel kind of stupid. Floating point representation of a sample value has a max of 1 and a min of -1. 20*log(samplevalue/1)=db, approximately.
Last edited on
Topic archived. No new replies allowed.