I am considering the following measurement of DAC chip linearity and conversion accuracy (having 16-bit current output DAC in mind, like the TDA1541A):
Feed the DAC with an offset binary digital signal so that only the MSB has 1, all other bits are 0. The output current will be 2 mA. The accuracy of this current should be better than 1/2 LSB. The LSB current is 1/32768 * 2 mA = 61 nA. Half of this is about 30 nA. 30 nA related to 2 mA is 15 ppm. Is it possible to measure the output current with 15 ppm accuracy? The are precision 6.5 or 7.5 digit DMMs that could do it, I suppose.
What do you think about this idea?
Feed the DAC with an offset binary digital signal so that only the MSB has 1, all other bits are 0. The output current will be 2 mA. The accuracy of this current should be better than 1/2 LSB. The LSB current is 1/32768 * 2 mA = 61 nA. Half of this is about 30 nA. 30 nA related to 2 mA is 15 ppm. Is it possible to measure the output current with 15 ppm accuracy? The are precision 6.5 or 7.5 digit DMMs that could do it, I suppose.
What do you think about this idea?
That should work, but requires a DC measurement. The usual approach is to test low-level linearity on a waveform consisting of three levels:+1, 0, and -1. A constant offset -32K to +32K could be added.
I see that TDA1541A is a old ladder DAC. A 1-bit DAC would have essentially perfect linearity.
Ed
I see that TDA1541A is a old ladder DAC. A 1-bit DAC would have essentially perfect linearity.
Ed
I was experimenting with linearity testing a while ago:
https://www.diyaudio.com/community/threads/dac-linearity-test-cd.113620/
Every n-th bit was compared with n-LSB and n+LSB. The n-th bit should be between those two.
https://www.diyaudio.com/community/threads/dac-linearity-test-cd.113620/
Every n-th bit was compared with n-LSB and n+LSB. The n-th bit should be between those two.
There is some progress. I built an I2S code generator device. It does essentially the same as the above mentioned DAC Linearity Test CD. It has four toggle switches A, B, C, D on the front panel, for selecting the bit # to be tested (bit #0 to bit #15). The output I2S signal is 12x WS interval bit #n -1, then 24x WS interval bit #n, then 12x WS interval bit #n+1.
For example, let's toggle switch A (weight 8), C (weight 2) and D (weight 1) that selects bit #11. The PCM binary code is 0000|1000|0000|0000. The output will be 12x 0000|0111|1111|1111, followed by 24x 0000|1000|0000|0000, followed by 12x 0000|1000|0000|0001. This 3-level cycle repeats. The resulting analog signal is on the attached picture. There is always 1-bit change, the magnitude is 1 LSB. The #n bit this can be visually checked.
I created it for checking the TDA1541A bit accuracy. Here the 15th bit weight is -2 mA, the bit #0 is 61 nA. After the I/V conversion @ 1.5 k resistor it gives 3 V for bit #15, and 91,56 uV for bit #0. It is difficult to view so small level change on an oscilloscope, for this reason I built a x100 amplifier (NE55434A). The resulting cca. 10 mV steps can be clearly seen.
For example, let's toggle switch A (weight 8), C (weight 2) and D (weight 1) that selects bit #11. The PCM binary code is 0000|1000|0000|0000. The output will be 12x 0000|0111|1111|1111, followed by 24x 0000|1000|0000|0000, followed by 12x 0000|1000|0000|0001. This 3-level cycle repeats. The resulting analog signal is on the attached picture. There is always 1-bit change, the magnitude is 1 LSB. The #n bit this can be visually checked.
I created it for checking the TDA1541A bit accuracy. Here the 15th bit weight is -2 mA, the bit #0 is 61 nA. After the I/V conversion @ 1.5 k resistor it gives 3 V for bit #15, and 91,56 uV for bit #0. It is difficult to view so small level change on an oscilloscope, for this reason I built a x100 amplifier (NE55434A). The resulting cca. 10 mV steps can be clearly seen.
Attachments
The code generator is based on the Wemos D1 mini:
https://www.wemos.cc/en/latest/d1/d1_mini.html
It has I2S capability built-in, using DMA. Here I attach the source code, that can be uploded by Arduino IDE.
https://www.wemos.cc/en/latest/d1/d1_mini.html
It has I2S capability built-in, using DMA. Here I attach the source code, that can be uploded by Arduino IDE.
Attachments
The pins of the Wemos D1 mini board are connected like this:
Switch A (weight 8) - D6 (GPIO12)
Switch B (weight 4) - D5 (GPIO14)
Switch C (weight 2) - D2 (GPIO4)
Switch D (weight 1) - D1 (GPIO5)
WS/LE - D4 (GPIO2)
SCK/BCK - D8 (GPIO15)
SD/DATA - RX (GPIO3)
3V3 - to toggle switches position "ON"
G/GND - to toggle switches position "OFF"
The board can be powered from USB or from the 5V pin.
The assembled device is on the pictures.
Switch A (weight 8) - D6 (GPIO12)
Switch B (weight 4) - D5 (GPIO14)
Switch C (weight 2) - D2 (GPIO4)
Switch D (weight 1) - D1 (GPIO5)
WS/LE - D4 (GPIO2)
SCK/BCK - D8 (GPIO15)
SD/DATA - RX (GPIO3)
3V3 - to toggle switches position "ON"
G/GND - to toggle switches position "OFF"
The board can be powered from USB or from the 5V pin.
The assembled device is on the pictures.
Attachments
The analog signal zero crossing is at -2 mA at the DAC output, that is +3 V at the I/V converter opamp output. At this point the PCM code changes sign from 0111|1111|1111|1111 to 1000|0000|0000|0000, or 0x7fff to 0x8000 in hex. The MSB is also called "sign bit". This is the reason why is the accuracy of the MSB (bit #15) so important, because zero crossing is the most frequent event in any waveform and music.
While a computer .wav file (and I think also the audio CD) contains PCM binary code from 0x0000 to 0xffff (in hex), the I2S code is 2s complement, which is created from Offset Binary (OB). The rule is OB = 0x8000 - PCM. 2sC = all bits of OB flipped +1.
My Arduino sketch calculates these numbers correctly.
While a computer .wav file (and I think also the audio CD) contains PCM binary code from 0x0000 to 0xffff (in hex), the I2S code is 2s complement, which is created from Offset Binary (OB). The rule is OB = 0x8000 - PCM. 2sC = all bits of OB flipped +1.
My Arduino sketch calculates these numbers correctly.
Shouldn't it be in two's compliment:
https://gist.github.com/endolith/e8597a58bcd11a6462f33fa8eb75c43d?permalink_comment_id=3461842
https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html
https://gist.github.com/endolith/e8597a58bcd11a6462f33fa8eb75c43d?permalink_comment_id=3461842
https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html
- "PCM data is two's-complement except for resolutions of 1-8 bits, which are represented as offset binary."
Last edited:
Indeed, thanks. Then I mixed offset binary with signed binary?WAV files use signed integers: -1 is 0xffff, 0 is 0x0000, and +1 is 0x0001.
Ed
What I wanted to do with all this is to fine-tune the bit currents (or at least the MSB). It is possible to add or subtract a fraction of bit current through the decoupling pins. The idea came from the PCM63P adjustment method (see attached), although a bit different. I will open a separate thread on it.
Attachments
- Home
- Source & Line
- Digital Line Level
- Static measurement of DAC linearity possible?