• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Let's develop an ASR inter-sample test procedure for DACs!

If you control audio volume before it enters a DAC chip, then it is not a problem. In the other case it depends on the design od the chip. Check previous replies.

For example the latest chips from ESS “should” be OK:

- https://www.audiosciencereview.com/...procedure-for-dacs.49050/page-14#post-2098671

Thanks! It's an interesting question. I've done a little bit of online searching (for example about Genelec speaker systems' volume controls) and it appears that most DACs and DAC-containing systems with built-in volume controls implement the digital volume control properly inside the DAC. But I'm sure there are outliers.
 
Older chips from ESS, namely I tried old ES9018, and it implemented volume control after signal processing.
 
9. Some DACs invert the audio when an intersample peak occurs. The inversion can extend before and after the actual peak (due to the length of the FIR filter) The polarity inversion is caused by a failure to recognize an arithmetic overflow in the DSP. DACs that have an inversion problem, produce very nasty distortion. It is very audible. I believe some of these have been tested on ASR, but this problem was missed.

I've experienced this myself. A few years ago I hunted down an Australia-exclusive version of Aimee Mann's 2012 album Charmer, because that pressing of the CD had an exclusive bonus track that I really enjoy. When I played the CD, the entire thing was full of staticky-sounding clicks.

I ripped the disc, and when I loaded the waveform into Audacity, I found 1000s (probably 10s of 1000s) of instances of what I've outlined in red here:

click screenshot.jpg


Every time the waveform hits a 0.0 peak, it's inverted, resulting in a very audible click/tick sound even when the music is moderately loud/dense at that moment. Very loud/dense moments in the music no doubt do mask it - but it's very clearly audible more often than not, and it makes the CD unlistenable.

The standard US CD uses the identical base mastering, just as dynamically compressed and limited - but the US CD was mastered to a peak level of -0.3dB and does not suffer from this issue. The Australian version was mastered to 0.0 - and it appears somewhere along the line a piece of equipment inverted those 0.0 peaks as John has explained in the above-quoted comment.

The story had a happy ending - I emailed the Australian record label about the issue and they generously shared with me their WAV files of all the tracks on the CD, which did not have this problem. They were otherwise bit-identical to the CD - peaks at 0.0, identical waveform. So when they sent the files to the CD mastering/production facility they were fine. It must have been an issue with a piece of kit or software in the CD facility's workflow.
 
Every time the waveform hits a 0.0 peak, it's inverted...

...It must have been an issue with a piece of kit or software in the CD facility's workflow.
Correct! Bad/amateur programming.

The most significant bit is the sign-bit. If you simply count-up you eventually flip the sign bit from 0 to 1 and you've got a negative number. Making matters worse, it uses two-complement which means if you have the 16-bit number 1000000000000000, that's not "negative zero" (which doesn't exist in two's complement). It represents the maximum negative decimal value of −32,768. If you keep counting-up in binary, the decimal value counts up from there (less negative).

So if the software is amplifying, mixing, bosting the bass, or ANYTHING that goes over the limits (-32,768 to +32767 decimal at 16-bits) the software should check for that and "force" clipping by resetting to the maximum positive or negative value.



P.S.
Most DSP is done in floating point, where 0dBS is defined as a value of 1.0. For all practical purposes there are no upper or lower, or positive or negative, limits.. The software that converts-back to integer can check the levels and avoid accidental inversion.
 
Last edited:
Your document says:
"Nevertheless, in a little over 5 minutes, this track has 559 intersample overs on the left track and 570 on the right track for a total of 1129. This means that there are about 3.7 intersample overs per second. "

What;s left out is that each sample is 1/44K th of a second in duration. Individually these aren't likely to be audible at all.

If there are consecutive overs, and the consecutive run is long enough, no doubt it can be audible. But that isn't established here.

Your doc claims that the overs add unnatural 'sparkle' to the snare in Gaslighting Abby, but that seem to be a subjective claim, with no DBT data backing it up.

If intersample overs can be avoided, they should be; and I appreciate all this detailed explanation and demonstration of the issue. I want to be clear about that.

That said, I think @krabapple also makes a good point. If the time period frequency of a clipped sample is sufficiently short, then we can't hear it, yes?

So I would speculate that 1 or 2 clipped samples in a row in a 44.1kHz sample rate file would be inaudible. Two clipped samples in a row would have a time period frequency equivalent to a 22.05kHz signal, yes?

So I would presume 3 clipped samples in a row would be the minimum that could possibly be audible, with a time period of 14.7kHz. And as a practical matter it might have to be more in a row, depending on the person and the character of the musical signal at that moment.

I understand that the time period of a series of clipped samples is not actually an encoding of any particular sound frequency - but when converted to analogue sound there is that mathematical correlation between time and frequency, yes? Isn't that why when people claim 44.1kHz isn't "fast enough" for human hearing or not "fast enough" to produce "fast transients with sufficient resolution," we can say that claim doesn't hold water?

Finally, a small historical footnote: in the early days of CD production when the Sony 1600-series tape-and-ADC setups were used to master CDs, I believe the units had a setting on them where they would light up when they detected clipping. If memory serves they could be set to light up when they detected 8, 16, or 32 consecutive clipped samples. I know the technology was limited at the time, but my understanding was that those were the choices because it was believed that fewer than 8 clipped samples in a row was not an issue. I'm not saying that was correct - just always thought it was interesting.
 
Last edited:
Finally, a small historical footnote: in the early days of CD production when the Sony 1600-series tape-and-ADC setups were used to master CDs, I believe the units had a setting on them where they would light up when they detected clipping. If memory serves they could be set to light up when they detected 8, 16, or 32 consecutive clipped samples. I know the technology was limited at the time, but my understanding was that those were the choices because it was believed that fewer than 8 clipped samples in a row was not an issue. I'm not saying that was correct - just always thought it was interesting.
Keep in mind that these choices would have been by the standard of raw, acoustic unprocessed signals. It is quite well known that brickwall limiters weren't the sole culprit for bad-sounding loudness war era CDs; it was when they were hit with material that had been extensively compressed and limited beforehand that all hell broke loose. When used to only catch occasional rogue peaks as originally intended, they actually tended to work quite splendidly.

Older chips from ESS, namely I tried old ES9018, and it implemented volume control after signal processing.
Oops. Close but no cigar. You can't tell from the datasheet because filter and volume are lumped together on there.

The old NPC SM5803 filter had the exact same issue.

The folks at Pacific Microsonics seem to have been well aware of intersample issues, the PMD100 specifically includes 1 dB of attenuation because of this (plus potentially 6 more for non-HDCD content if you let the level matching be handled internally). Mind you, that would have been at least 1993 or so. If you add all the shaped dithering trickery, these have to be among the most advanced digital filters of the '90s.
 
View attachment 397104

Every time the waveform hits a 0.0 peak, it's inverted, resulting in a very audible click/tick sound even when the music is moderately loud/dense at that moment.
@tmtomh, Thanks for the waveform plot!

Some DACs have this exact same problem when they encounter a 0 dBFS+ event. These DAC make that same "very audible click/tick" sound whenever a 0 dBFS event occurs.

This is one reason why ASR should test for 0 dBFS+ performance. Sadly, these egregious DSP bugs still exist in DACs that are currently on the market. They will continue to exist until someone starts running 0 dBFS+ tests.

Other DACs have less-severe 0 dBFS+ overload problems, but in many cases, these may audible.

We cannot continue to ignore these problems by claiming that 0 dBFS+ test are unnecessary!
 
If your system has a digital volume control and you listen to it at about -3 to 5dB or lower, which everyone with that setup does if it’s your main system volume control, then it would seem this issue is irrelevant.

It applies only if you’re running a full-volume digital signal through a DAC and controlling the system volume farther down the playback chain, or if you have a D/A/D conversion ahead of the digital volume control - yes?
In case you are using a sample rate converter - especially for upsampling - prior to your master volume control (like e.g. in minidsp Flex and SHD) this is still an issue.
 
Keep in mind that these choices would have been by the standard of raw, acoustic unprocessed signals. It is quite well known that brickwall limiters weren't the sole culprit for bad-sounding loudness war era CDs; it was when they were hit with material that had been extensively compressed and limited beforehand that all hell broke loose. When used to only catch occasional rogue peaks as originally intended, they actually tended to work quite splendidly.

But "loudness war era" doesn't correspond with the 'early days of CD production" that tmtomh referred to. The loudness war didn't really kick in until the mid 1990s, more than a decade after CDs went on sale.

I've experienced this myself. A few years ago I hunted down an Australia-exclusive version of Aimee Mann's 2012 album Charmer, because that pressing of the CD had an exclusive bonus track that I really enjoy. When I played the CD, the entire thing was full of staticky-sounding clicks.

I ripped the disc, and when I loaded the waveform into Audacity, I found 1000s (probably 10s of 1000s) of instances of what I've outlined in red here:

View attachment 397104

Every time the waveform hits a 0.0 peak, it's inverted, resulting in a very audible click/tick sound even when the music is moderately loud/dense at that moment. Very loud/dense moments in the music no doubt do mask it - but it's very clearly audible more often than not, and it makes the CD unlistenable.

The standard US CD uses the identical base mastering, just as dynamically compressed and limited - but the US CD was mastered to a peak level of -0.3dB and does not suffer from this issue. The Australian version was mastered to 0.0 - and it appears somewhere along the line a piece of equipment inverted those 0.0 peaks as John has explained in the above-quoted comment.

I.e., it means somewhere along the line there was another digital-to-analog conversion, using a 0dBFS peak-inverting DAC.

Unless there's some other piece of kit that would do this?

Either way, it's nasty and I'd call it broken design.
 
Some statistics on the signal White_PN_64k_Full_-1.09_dBFS_48.0k_Float_LR.wav:


And resampled 8x (linear phase):

Once again with 4dB volume attenuation:

And once again with 5dB volume attenuation that does not generate clipped samples with 8x VHQ SoX resample algorithm:
The "over" caused by MP3 and other similar codecs like AAC and Vorbis are floating point overs. The SoX command line tool (contrary to other software that uses the SoX resampling algorithm, like foo_dsp_resampler and Audacity) uses 32-bit integer intermediate format which cannot handle floating point samples above +/-1.0. This type of over cannot be mitigated by having intersample headroom in the DAC.

Relevant reading:

Download the test MP3 files below, and read the subsequent replies:

It is important to differentiate intersample over and floating point over in order to avoid spreading misinformation and false hope that having intersample headroom in the DAC can prevent distortion induced by floating point over.

On the other hand, using a floating point compliant software decoder/player/processor to manage playback level before sending data to external hardware can prevent both floating point over and intersample over.
 
@tmtomh, Thanks for the waveform plot!

Some DACs have this exact same problem when they encounter a 0 dBFS+ event. These DAC make that same "very audible click/tick" sound whenever a 0 dBFS event occurs.

This is one reason why ASR should test for 0 dBFS+ performance. Sadly, these egregious DSP bugs still exist in DACs that are currently on the market. They will continue to exist until someone starts running 0 dBFS+ tests.

Other DACs have less-severe 0 dBFS+ overload problems, but in many cases, these may audible.

We cannot continue to ignore these problems by claiming that 0 dBFS+ test are unnecessary!

No problem! I remember being gob-smacked after ripping the CD and seeing the waveform. It took me a few minutes to realize what I was looking at.

I of course agree that this is an egregious design flaw in any gear that does this. That said, I got my first CD player in March 1985 and have listened to a few thousand CDs 10s of thousands of times in the intervening 39 years, played back through more than a dozen CD players and multiple DACs - not to mention small/cheap/integrated DACs in iPhone headphone dongles, cheap TVs, and so on. And I've never once heard this problem (except with that one CD where the problem was "baked in" by equipment in the production chain). So I know it exists, and it should be stamped out - and at the same time I have a lot of trouble believing that it's a common problem because the results of this problem are in my experience super audible and more of us would've heard it if it were anywhere close to common.
 
The SoX command line tool (contrary to other software that uses the SoX resampling algorithm, like foo_dsp_resampler and Audacity) uses 32-bit integer intermediate format which cannot handle floating point samples above +/-1.0. This type of over cannot be mitigated by having intersample headroom in the DAC.
I used SoX tool to determine how much headroom SoX needs for signals when they are resampled, without reaching minimum/maximum of the intermediate format. This is just an approximation of a headroom needed for an oversampling DAC.

Also I assume that DACs are used integer format. Floating format would be an expensive/complex to implement/support.
 
Quite perfect behaviour of the overloaded ADC (Focusrite 2i2):

ADC_overload_big.png

(sine input)
 
Were you expecting anything else? (Assuming that's a 3rd gen or older Scarlett, that's a CS4272 in there. Quite old but not designed by amateurs. Any out-of-band components from clipping are being absorbed by the digital filters during decimation.)

There's the occasional case where the analog stage clips before the ADC does, but that generally is about it.
 
@pma would you reveal name of the second DAC with bad clipping?

This simple sine tone could be a candidate for the test signal we are looking for in this thread. Maybe it could be generated directly by an AP analyzer.
 
It was an old consumer grade USB soundcard. IMO power supplies in such USB powered devices often make a headroom limit.
---------

BTW, DacMagic+ has very nice clipping behaviour (and more headroom than Topping D10s, post #356 top image):
DM+_clipping.png


(25MHz sampling of the DAC output) DM+_clipping_big.png
 
Last edited:
This simple sine tone could be a candidate for the test signal we are looking for in this thread.
Haven't we found it already? This one will even tell you how much headroom you have:
 
Haven't we found it already? This one will even tell you how much headroom you have:

I think we have known this test tone for several decades. The key factor is: use the fast oscilloscope to check the DAC output behaviour, not the low Fs audio ADC, which would hide the issues.
 
Back
Top Bottom