Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Digital Line Level DACs, Digital Crossovers, Equalizers, etc.

Solving the intersample DAC clipping problem for about ten euros
Solving the intersample DAC clipping problem for about ten euros
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 11th February 2018, 05:03 PM   #1
MarcelvdG is offline MarcelvdG  Netherlands
diyAudio Member
 
Join Date: Mar 2003
Location: Haarlem, the Netherlands
Default Solving the intersample DAC clipping problem for about ten euros

Hi all,

Many audio DACs and DAC chips have spectacular SINAD and dynamic range numbers when measured with sine waves of 0 dBFS or less, but actually run into clipping when driven with music, especially on recordings with relatively low sample rates (such as 44.1 kHz) that are peak normalized to 0 dB (like most recordings are nowadays).

One reason for this is the fact that the interpolation and reconstruction filters can have overshoots on non-sinusoidal waveforms. A more important reason is that when the waveform is not sampled exactly at the peaks, normalizing the largest samples to full scale means that the reconstructed peak must be greater than 0 dBFS. These facts are rarely taken into account by DAC manufacturers. See the Benchmark Media site for a very clear explanation.

A solution is to buy a 2200 euro DAC from Benchmark Media, another is to build one of my hobby DAC designs (less expensive than Benchmark Media, but certainly not cheap), a third is to renormalize all recordings to -3 dBFS or so (inconvenient when the music is on physical media like CDs) and a fourth is to attenuate the signal going into the interpolation filter.

Assuming two's complement data sent over an I2S connection, the attached circuit should be sufficient to attenuate the signal by 1 bit (6.02 dB), thereby creating 6.02 dB of headroom for intersample overshoots. If your DAC has 110 dB dynamic range referred to 0 dBFS, it will be only 104 dB after installing this circuit, but in practice that still means you don't hear any noise at all. Mind you, it is only a paper design so far, I haven't tried this circuit.

The circuit shifts the whole signal one bit to the right and applies sign extention (repeats the MSB). This means that 16 bits data become 17 bits, 24 bits become 25 bits et cetera. When the number of bits gets larger than the DAC or the ratio of bit clock to word clock supports, the LSB will be rounded down bluntly without any dithering. In practice this is no problem for DACs with a large input wordlength, like 24 or 32 bits DACs. For a 16 bits DAC, very soft signals will be degraded by the extra quantization distortion.

Built with 74HC74's and a 74HC4053, the circuit should be able to handle 44.1 kHz and 48 kHz sample rates at 3.3 V supply voltage, and 96 kHz at 5 V. With the indicated 74AHC74's and 74LV4053A, even 384 kHz at 3.3 V should be no problem.

The values of the output resistors depends on the lines between the circuit and the load. When the wires are short, no resistors are needed, otherwise they need to be chosen such that reflections stay limited.

The top right flip-flop is abused as an inverter.

Best regards,
Marcel
Attached Images
File Type: jpg I2Sattenuator2B.jpg (126.4 KB, 407 views)
  Reply With Quote
Old 11th February 2018, 05:23 PM   #2
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: California
Your second paragraph is a good reason why it is a good idea to look for a DAC with voltage headroom, the more the better. Then one can do a digital volume reduction at -6dB or less and still get enough gain out of the DAC.

Marcel, what is the motivation for doing your hardware modification versus using digital volume reduction? You mention CDs, so perhaps your application is intended for hardware based playback like a CD player where there is no provision for digital volume control?
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins

Last edited by CharlieLaub; 11th February 2018 at 05:26 PM.
  Reply With Quote
Old 11th February 2018, 06:08 PM   #3
Tam Lin is offline Tam Lin  United States
diyAudio Member
 
Join Date: May 2010
Location: Texas
That's a very clever circuit. In exchange for eliminating an occasional clipped sample, which would probably be inaudible, you reduce the available dynamic range by 6dB, add distortion, and increase BCLK jitter. Well done!

Last edited by Tam Lin; 11th February 2018 at 06:11 PM.
  Reply With Quote
Old 11th February 2018, 07:04 PM   #4
MarcelvdG is offline MarcelvdG  Netherlands
diyAudio Member
 
Join Date: Mar 2003
Location: Haarlem, the Netherlands
Quote:
Originally Posted by CharlieLaub View Post
Your second paragraph is a good reason why it is a good idea to look for a DAC with voltage headroom, the more the better. Then one can do a digital volume reduction at -6dB or less and still get enough gain out of the DAC.

Marcel, what is the motivation for doing your hardware modification versus using digital volume reduction? You mention CDs, so perhaps your application is intended for hardware based playback like a CD player where there is no provision for digital volume control?
If you already have a digital volume control before any filter, you can use that of course. If you have no digital volume control or if any kind of sample rate conversion or filtering takes place before the digital volume control, then you are in trouble.
  Reply With Quote
Old 11th February 2018, 07:10 PM   #5
MarcelvdG is offline MarcelvdG  Netherlands
diyAudio Member
 
Join Date: Mar 2003
Location: Haarlem, the Netherlands
Quote:
Originally Posted by Tam Lin View Post
That's a very clever circuit. In exchange for eliminating an occasional clipped sample, which would probably be inaudible, you reduce the available dynamic range by 6dB, add distortion, and increase BCLK jitter. Well done!
On what do you base your assumption that 3.7 clipped samples per second are inaudible, while a slight increase in a minus one hundred something dB noise floor would be a problem?

By the way, I forgot to add a link to this:

Intersample Overs in CD Recordings - Benchmark Media Systems, Inc.

and to mention that the BCK inversion is optional; it improves hold time at the expense of set-up time, but is not required according to the I2S standard.

Last edited by MarcelvdG; 11th February 2018 at 07:16 PM.
  Reply With Quote
Old 11th February 2018, 10:02 PM   #6
MarcelvdG is offline MarcelvdG  Netherlands
diyAudio Member
 
Join Date: Mar 2003
Location: Haarlem, the Netherlands
As an example of digital volume control that won't help against intersample overshoots, the SRC4392 datasheet ( http://www.ti.com/lit/ds/symlink/src4392.pdf ) states explicitly that the SRC4392 asynchronous sample rate converter has an output attenuator:

Page 1: "-Digital output attenuation and mute functions"
Page 34: "The SRC includes output soft muting and digital attenuator functions"
  Reply With Quote
Old 13th February 2018, 04:23 AM   #7
xx3stksm is offline xx3stksm  Japan
diyAudio Member
 
xx3stksm's Avatar
 
Join Date: Jun 2017
Location: Hokkaido(north area)
It's interesting. I have IIS interface configured by FPGA to pcm1792. It takes few hours to add "divide by two" and reconfigure. It worked successfully. The attached is schematics. I am out of date person who still uses the schematic entry to design FPGA. But I'm sure it is useful to understand circuit visually.

BTW, I have several pieces of music files which have a 0.5dBFS amplitude at maximum because of "loudness war." There is a good chance to have intersample overs which result in much distortion in FFT. They are little change in time domain but are very audible as FFT says. Most of my music files are from vinyl which has enough headroom. Oversampling filter itself has no problem. But if you play
"loudness war" files, "divide by two" is one solution. NOS with steep analog LPF is another one. I wonder a NOS lover can perceive intersample overs.
Attached Images
File Type: jpg divide_by_2.jpg (153.3 KB, 314 views)
  Reply With Quote
Old 13th February 2018, 04:46 AM   #8
MarcelvdG is offline MarcelvdG  Netherlands
diyAudio Member
 
Join Date: Mar 2003
Location: Haarlem, the Netherlands
Good point. The intersample overshoot story could indeed explain why some prefer non-oversampling DACs, like you wrote. It could also explain why many prefer high sample rate files without needing to hypothesize that ultrasonics are somehow audible; the intersample overshoot problem is smaller on high sample rate recordings, as explained by Benchmark.
  Reply With Quote
Old 13th February 2018, 05:46 AM   #9
xx3stksm is offline xx3stksm  Japan
diyAudio Member
 
xx3stksm's Avatar
 
Join Date: Jun 2017
Location: Hokkaido(north area)
I agree with you. Some people say high sample rate files have quiet sound compared to normal one. Intersample overs is often overlooked by a sine wave. It does appear in real music files which is difficult to measure.
  Reply With Quote
Old 13th February 2018, 08:57 AM   #10
xx3stksm is offline xx3stksm  Japan
diyAudio Member
 
xx3stksm's Avatar
 
Join Date: Jun 2017
Location: Hokkaido(north area)
The attached are recent music files ripped from CD. You can easily find several clipped sample points(0dBFS). Their usual maximum level is almost -0.3dBFS(97%) which has a good chance to have intersample overs though it depends on the oversampling process. DAC manufacturer has no responsibility for this because they can't predict what music files are played by a customer. A customer must recognize the probability.

No oversampling filter, which means NOS, is one solution. DSD stream is another one which inherently no need to have an oversampling filter. Some people say DSD has quiet sound like high sample rate files. I'm sure DSD is free from intersample overs but not sure it can have quiet sound because DSD has much quantization noise from 20kHz.
Attached Images
File Type: jpg ov2.jpg (76.8 KB, 287 views)
File Type: jpg ov1.jpg (77.2 KB, 288 views)
  Reply With Quote

Reply


Solving the intersample DAC clipping problem for about ten eurosHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help solving problem on new 2A3 build jmillerdoc Tubes / Valves 54 13th February 2010 03:19 PM
PC sound output clipping problem hajame Digital Source 3 29th April 2008 04:39 AM
clipping problem maxpou Solid State 4 26th January 2008 12:49 PM
solving hum problem using external mic with camcorder David94114 Analog Line Level 0 14th March 2007 07:40 AM
Problem w/Clipping new 2 car audio need help bmxkris Car Audio 2 4th April 2005 05:27 PM


New To Site? Need Help?

All times are GMT. The time now is 03:34 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 15.00%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Copyright ©1999-2018 diyAudio
Wiki