High sample rate output and unity gain don't mix because of inter-sample overs

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
High sample rate output and unity gain don't mix because of inter-sample overs

It's often said that one should set all software volume faders to unity gain in order to maximize dynamic range. I believe this is a mistake when the output sample rate differs from the source sample rate. This is basically all the time because music is usually 44.1kHz while audio from video is 48kHz and very few people ever change the output device sample rate.

This problem is well understood in the better DACs out there. Most DACs are oversampling, and operate at a different sampling rate than the input signal. When you convert between sample rates (or when you do any kind of digital filter, really), you risk getting into inter-sample overs if you don't have enough digital headroom. People compare DACs based on how well they perform with pathological signals, but all of it is moot when people run their audio output at a different sampling rate than their music.

Inter-sample clipping can happen with any SRC that doesn't have enough headroom, be it done "in the box" or in some other piece of hardware.

I think this problem is not obvious to most people because the audio signal is usually 16 bit, but they set their audio interfaces to 24 bit output, so they naively expect to have enough headroom because "there are more bits". But there aren't, really, because the bit rate conversion preserves the signal level. If there's no headroom in the original 16-bit signal, because it's close to 0dBFS, there isn't any in the 24-bit either because it's still 0dBFS. You have to attenuate the signal before doing sample rate conversion if you don't want to run into the risk of inter-sample clipping. Indeed, this is what good DACs like the Benchmark DAC2 and DAC3 are doing. They are attenuating the signal by 3.5dB in the digital domain before feeding the DAC, then making up for this in the analog domain after the DAC. (Btw, not only expensive DACs like the Benchmark have this feature. It seems both the Macbook and iMac outputs are immune to this problem, while my ODAC and my M-Audio ProFire 610 are not.)

But when you change the sample rate for the audio device there is no attenuation.

It seems to me that the following scenarios are the only good way to preserve signal integrity.

1. If you have a DAC that is immune to inter-sample overs, then:
1.1 If you want to set your output at the sample rate of the music then you can use unity gain both in the player and for the master volume control.
1.2 If you want to use a different (usually higher) sampling rate than your music, then you need to reduce the volume in the audio player (you can leave master volume at unity).

It's not ok to keep the audio player at unity and reduce the master level because you need to attenuate the signal before the SRC is done by your operating system. The master volume control happens after this conversion.

2. If you have a DAC that is NOT immune to inter-sample overs (most outboard DACs?), then:
2.1 You MUST reduce your volume in your audio player (and not on the master volume control) in ALL cases.

If you need to do SRC in the operating system, then you must set the volume in the player and not on the master fader for the reasons outlined in 1.2.

Even if the sample rates match and you don't need need to do SRC in the operating system, then you still need to set the volume in the player and not on the master fader because many (most?) USB DACs use the software master fader to control the analog gain after the DAC process has taken place, so after inter-sample clipping has already occured (remember in this case we're talking about common DACs which exhibit this problem).

In conclusion, you need to use 24-bit (to preserve dynamic range on software volume control), but you must always reduce the volume in the player, except in the very rare scenario of using a DAC immune to inter-sample overs and when matching the input and output sample rates. Because this is a rare scenario, the generic advice should be to simply always use 24-bit output, and always reduce the volume in your audio player! The standard advice to always set unity gain in software is wrong.

Btw, if we could make a list of DACs that are immune to inter-sample clipping, that would be great.
 
Last edited:
Member
Joined 2017
Paid Member
I agree with your concern. There is a chance to be clipped, especially pops and jazz which maximize the amplitude almost 0dbFS. When I design FIR filter or oversampling filter, I need to attenuate the amplitude by -1dB to prevent inter-sample overs. As long as I have experienced in sinewave or square wave, -1db is enough to suppress distortion(theoretically -3db is preferable). In case of clipping, you can easily notice that overflow occurs because of sudden much distortion. But when you listen to music, it's difficult to know whether overflow occurs or not. Attenuation of -3db can be a wise solution.
 
Intersample overs don't cause any problems until they get to the DAC. Distortion artifacts due to intersample overs are produced in the reconstruction filter, not before that point.

If numerical overflow were to occur during SRC, that would amount to clipping of the digital signal. Not the same thing exactly as an intersample over.

According to Bechmark Media, intersample over distortion sounds like high frequency noise bursts.

On the other hand, digital clipping is sometimes intentionally done to pop music as an alternative to limiting. Some people think it sounds better than hard limiting.

That being said, worrying much about sound quality when Windows is performing real time SRC may be a mostly wasted effort. It's made to be fast and efficient, not super high quality.
 
Last edited:
Intersample overs don't cause any problems until they get to the DAC. Distortion artifacts due to intersample overs are produced in the reconstruction filter, not before that point.

If numerical overflow were to occur during SRC, that would amount to clipping of the digital signal. Not the same thing exactly as an intersample over.

Honestly, I do not understand the difference. SRC (both in the PC or in the interpolation filter of the DAC chip) introduces new samples, some of which do clip digitally if the signal is too high. What distortion occurs in the reconstruction filter which is the analog circuit behind the actual DAC stage?
 
If a digital signal is clipped, and then level reduced, the clip is still there, but it no longer would produce an intersample over artifact in the DAC.

For example, if a signal were to be clipped in Windows SRC (as described in the first post above), then the master level which affects the signal after SRC was turned down by 3dB or so, the signal going into the DAC would not produce an intersample over in the reconstruction filter. The clipping would still have a sound though, and its a sound often heard on pop CDs these days. It doesn't sound like high frequency noise bursts.

On the other hand, I'm not sure Windows SRC would clip. So long as everything is done in floating point it shouldn't. But, I'm just going with what was described in the first post for present discussion purposes.
 
Last edited:
Okay.

The point I was trying to make was in reference to the claim that turning down the master volume in an OS produces the DAC artifacts as failing to turn it down, in the case where some kind of intersample peak occurs during real-time SRC.

My thoughts were twofold:
(1) if the OS is using floating point, I don't see how any information can be lost, nor any problem with reducing the signal at the last instant before it hits the DAC,
and (2) if the OS does clip during SRC, turning down the master control by 3 dB or so would not be expected to produce the exact same artifact as if not turning it down.

I wasn't trying to say anything about the sequence of events in a DAC that produces the sound artifact, only that clipping in the DAC itself sounds different than clipping before the DAC, but not also in the DAC. It seems to me that intersample over is a term applying to something that occurs inside the DAC, not at some prior stage of digital processing. I think we should keep the terms distinct because they sound different and in some cases some kind of digital clipping can be in intentional effect.

Also, in another sense, in oversampling DACs digital interpolation is used to replace some of the functionality of older type reconstruction filters, so that the analog filter can be simpler. It can be thought of as a component of the reconstruction subsystem system which is now partly digital and partly analog.
 
The OS might be using floating point, (macOS does), but the audio interface has an integer input, so the OS will convert the internal floating point representation to integer before sending it out to the DAC. This problem would of course be solved if the audio interface accepted floating point input and digital volume control on the frontend of the DAC. Curiously enough, I can set my iMac built-in output to 32-bit floating point. This surprises me, I haven't seen this before. I am only limited to integer for my outboard DACs and audio interfaces, however.

Markw4, you mention that distorsion artefact caused by interpolating "in the DAC" compared to digital clipping caused by SRC "in the box" plus attenuation sound different. That is true, but I do not see this as a fundamental distinction. There is a distinction between 1) distorsion caused by digital SRC/interpolation be it "in the box" or "in the DAC" and 2) distorsion caused by traditional analog reconstitution filters, specifically analog clipping.

I am talking about #1 in this thread and have used the term "intersample clipping" to refer to the distorsion artifact created in any kind of SRC, be it in "in the box" or in the digital part of an oversampling DAC. If this term is not correct, or if there's a better term for describing this phenomenon, please share.

Yes, a lot of music these days comes with intentional clipping. The difference between intersample overs (I'll keep this term for now) and intentional clipping, is that the latter present in the original 44.1kHz recording, but the intersample over happens only if we do SRC. If we output from the source at 44.1kHz and use a non-oversampling DAC we do not hear any effect of intersample clipping because there isn't any. (Of course, we can still hear the effects of #2 described above, but it's unlikely the analog stage doesn't have headroom.)

Because of this difference between the fact that in one case digital clipping exists in the input signal, and in the other case clipping exists only in the intermediary "working signal", I claim that is it important to make a distinction between these two scenarios and give them different names, hence "clipping" vs. "intersample overs".

Coming back to the original problem. As mentioned already, it seems the solution is to attenuate the digital signal before performing SRC. It has been established that the master volume control is not the right place to perform this level adjustment and that it must be done in the program used to listen to music.

What I failed to mention is that the program itself needs to allow attenuation of the signal before it applies any of its own signal processing. For example, the OS will gladly do SRC for you if you output at a different sampling frequency, but the program can also do its own SRC for various reasons. For example, iTunes on Mac performs its own SRC. iTunes correctly attenuates the signal before performing the SRC. For example, by listening to a test tone that exhibits inter-sample overs, we can fix the problem by turning down the iTunes volume knob.

Not all programs are like this, however. For example, VLC (also running on macOS) also seems to do its own SRC. Unlike iTunes, the volume control in VLC seems to happen after SRC, so reducing the volume doesn't fix the problem. It just makes the distortion quieter, but it doesn't eliminate it.

(Note that I spent less time with VLC and my test equipment is limited, I need further time before a conclusion can be established.)
 
Last edited:
E.g. in sox this issue is called regular "clipping". Sox reports whether any clipping occurred during processing (incl. rate conversion). Global parameter -G instructs sox to apply just enough gain between effects to avoid any clipping.

IMO the requirement for unity gain in sample rate conversion does not make much sense - no bit perfection is maintained anyway since brand-new samples are calculated/interpolated.
 
Member
Joined 2017
Paid Member
As long as I know, audio guys don't have a good impression about a digital pot because of none bit perfection. But you can't listen to digital data. You listen to music in analog domain converted by a DAC. It means you are under the limitation of analog SNR which is 110dB at max. Bit perfection in digital domain over 110dB is unfortunately beyond our audio system ability. That's why I don't care much about bit perfection. A digital pot is superior to an analog one for me. 3dB attenuation for headroom is acceptable.

If you use a DSM DAC, attenuation before DSM has nothing to do with the loss of dynamic range unless attenuation is over 100db. The 32bit coefficient is adequate to forget bit perfection because DSM wants to keep up with the attenuated digital data something like auto-compensation.In other words, PCM has its inherent bit resolution,16bit or 24bit. DSM doesn't have the specific resolution like PCM. It depends on the input resolution. As long as the input has high resolution(32bit coefficient attenuation), attenuated data for DSM DAC has the same resolution as the original one.
 
Member
Joined 2017
Paid Member
A DSM DAC means Delta Sigma Modulation DAC like pcm1792. Pcm 1704 is a multi-bit DAC. In other words,pcm1704 is PCM DAC. I recently designed FPGA HW for DSM and found it has no native bit resolution. The bit resolution of DSM depends on the input resolution. This is the essential difference from PCM. That's why the bit perfection of DSM is considerably different from PCM, easy to achieve.
 
PCM1792 is a 24-bit DAC, accepting up to 24bit samples. How is it different from PCM1704 24-bit DAC, accepting also up to 24bit samples? I understand the difference in the DA process but do not see the reason for

If you use a DSM DAC, attenuation before DSM has nothing to do with the loss of dynamic range unless attenuation is over 100db.

Unless your DSM DAC operates with 32bit samples. Still its real noise floor will be way above the 24th bit (unless you have some cryogenic construction), making it behave very similar to regular 24bit DACs. Digital attenuation will shift bits to LSB side, resulting in lower real-world resolution.
 
Member
Joined 2017
Paid Member
Unless your DSM DAC operates with 32bit samples. Still its real noise floor will be way above the 24th bit (unless you have some cryogenic construction), making it behave very similar to regular 24bit DACs. Digital attenuation will shift bits to LSB side, resulting in lower real-world resolution.

The concept of quantization noise has completely different meaning between PCM and DSM. It means ash in PCM system. That's why attenuation simply increases trash and decreases SNR. Quantization noise in DSM means fuel to improve THD because it is to be reused for next output. Quantization noise in DSM system will not be discarded like PCM. That's why digital attenuation in DSM will not decrease SNR in the digital domain(of course, analog domain is another issue) as long as it has enough calculation resolution.

There is a famous book about DSM "Understanding Delta-Sigma Data Converters." The author writes there are two converters; one is a Nyquist rate converter(PCM), the other is an oversampling data converter(DSM). DSM utilizes all previous input data. So, it includes memory elements in its structure.

I have a little bit different view about DSM. DSM is an NFB system like an OPamp. An OPamp can reproduce almost the same signal as the input by NFB. DSM does the same thing to make the output by digitally calculated NFB. I think the most specific character of DSM is NFB.An oversampling is also necessary for good performance. But DSM without an oversampling is possible, DSM without NFB will not work.

This is my analysis of DSM.
Physical meaning of DSM
 
DSM has been used extensively in DACs for many decades since it is cheaper and easier to design/manufacture than parallel conversion. I do not see DSM DACs having strikingly better SNR parameters than parallel ones. Because under certain delta size the output is already below the analog noise of the convertor. And that limit is the SNR limit to volume control, just like in other conversion methods of PCM samples. Volume control on PCM samples decreases effective number of bits used - lowers the resolution, increases SNR. The input PCM signal is same for any method of DA conversion
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.