Electronic – wav file audio samples are signed, how does DAC deal with signed numbers when it does not have negative supply

dacfloating pointpic

I was looking into wav audio file specification, they may hold the pulse coded modulation data as signed our unsigned integers as well as floating point values.

How does a DAC deal with signed numbers? Do they need a dual supply to output signed numbers?

What would be an appropriate way to convert floating point numbers into integer when sending them to DAC? I assume e.g conversion onto 8 bit would be simply multiplying by 255 but I am not sure since floating point numbers are signed.

Yes I realise that there are multiple types of ADCs.

Best Answer

Audio is inherently AC. That means the DC level doesn't matter and can be arbitrarily subtracted off and something else added. In fact, frequencies below 20 Hz can be arbitrarily eliminated even in "HiFi" audio.

The WAV file is specifying the audio signal values as if the signal had zero DC offset. That makes sense when you think about it, as it's the logical choice for communicating arbitrary audio signals.

However, that does not mean your D/A converter needs to produce negative voltages. If the D/A converter has a output range of 0-5 V, for example, then you simply declare the midpoint of 2.5 V to be the WAV file zero level.

Note that this is little different from the arbitrary scaling you need to apply and that you don't seem to have a problem with. You scale the min to max WAV file values for whatever representation that WAV file uses, to linearly map to the D/A output range. There is no special case because one or both of these ranges include negative values. Either way it's still just a simple linear scaling with offset.

In the case of a 0-5 V A/D, the midpoint is 2.5 V, which represents the audio zero level. If the A/D is followed by a amplifier, then it will alter this range again. Eventually a power amplifier driving speakers will eliminate the average DC level so there is no net DC going to the speakers.

Electrically, DC is easily eliminated from a audio signal by a high pass filter, which can be as simple as a capacitor in series followed by a resistor to ground.