I2S is broken
Posted: Mon Nov 04, 2013 8:59 am
I came across this back in 2010 as I was corresponding with the person who uncovered this issue, Raymond Celius, known as RayCtech on many forums.
The problem is related to how 16bit audio is extended to 24 bit or 32 bit. This is needed when sending a 16 bit audio file to a 24 or 32 DAC - which most are nowadays.
The standard way I2S is encoded at the bit level is in something called two's complement representation. http://en.wikipedia.org/wiki/Two's_complement
Two's complement coding is used because it can represent positive & negative numbers which are needed for audio that comprises of positive & negative waves. So in two's complement the first bit, the most significant bit (MSB) represents the sign of the number, 1 meaning negative & 0 meaning positive (MSB is on the left) (LSB is on the right = least significant bit)
So here's the problem - when changing a 16bit number in 2's complement into a 24 bit number the standard approach is to add 8 0's to the end irrespective of whether the number is positive or negative so:
1111 1111 1111 1111 (a neg number) under I2S becomes 1111 1111 1111 1111 0000 0000 0000 0000 - which is incorrect.
The correct way of doing it should add 0's to positive numbers & 1's to negative numbers so:
1111 1111 1111 1111 in correct 2's comp 1111 1111 1111 1111 1111 1111 1111 1111 - which is correct
The result of this mistake is that all negative numbers when converted are incorrect & therefore the negative going waveform that is generated based on these values are incorrect i.e our analogue waveform is incorrect.
How much is it off by?
Well 1 LSB is the answer.
What does this translate into? 1 LSB translates into 6dB which when the sound is loud is not much to worry about but in quieter passages & in fades of notes, it is something we should be concerned with.
Why haven't DAC chip manufacturers addressed this? Who knows?
No DAC manufacturer that I know of has implemented this correction except for Light Harmonic with their auto-LSB correction.
What can be done? Well we can correct this outside of the DAC in software.
I have spoken to Gordon & he is looking into doing this at some point on MQN. I hope LEKT reads this & might incorporate the correction in his software player. It's actually an easy correction - do a conditional bit-stuffing based on the sign of the number i.e if MSB is 1 then stuff the extra bits with 1s - if MSB is o then stuff with 0s
I would be interested in hearing the effect of this correct approach & how audible it might be.
Isn't digital audio fun? :)
The problem is related to how 16bit audio is extended to 24 bit or 32 bit. This is needed when sending a 16 bit audio file to a 24 or 32 DAC - which most are nowadays.
The standard way I2S is encoded at the bit level is in something called two's complement representation. http://en.wikipedia.org/wiki/Two's_complement
Two's complement coding is used because it can represent positive & negative numbers which are needed for audio that comprises of positive & negative waves. So in two's complement the first bit, the most significant bit (MSB) represents the sign of the number, 1 meaning negative & 0 meaning positive (MSB is on the left) (LSB is on the right = least significant bit)
So here's the problem - when changing a 16bit number in 2's complement into a 24 bit number the standard approach is to add 8 0's to the end irrespective of whether the number is positive or negative so:
1111 1111 1111 1111 (a neg number) under I2S becomes 1111 1111 1111 1111 0000 0000 0000 0000 - which is incorrect.
The correct way of doing it should add 0's to positive numbers & 1's to negative numbers so:
1111 1111 1111 1111 in correct 2's comp 1111 1111 1111 1111 1111 1111 1111 1111 - which is correct
The result of this mistake is that all negative numbers when converted are incorrect & therefore the negative going waveform that is generated based on these values are incorrect i.e our analogue waveform is incorrect.
How much is it off by?
Well 1 LSB is the answer.
What does this translate into? 1 LSB translates into 6dB which when the sound is loud is not much to worry about but in quieter passages & in fades of notes, it is something we should be concerned with.
Why haven't DAC chip manufacturers addressed this? Who knows?
No DAC manufacturer that I know of has implemented this correction except for Light Harmonic with their auto-LSB correction.
What can be done? Well we can correct this outside of the DAC in software.
I have spoken to Gordon & he is looking into doing this at some point on MQN. I hope LEKT reads this & might incorporate the correction in his software player. It's actually an easy correction - do a conditional bit-stuffing based on the sign of the number i.e if MSB is 1 then stuff the extra bits with 1s - if MSB is o then stuff with 0s
I would be interested in hearing the effect of this correct approach & how audible it might be.
Isn't digital audio fun? :)