Clipped signals and the D/A stage

    • March 6, 2023 at 10:22 am #5103

        Hello all. I’ve asked this in some of the mastering FB groups but wanted to ask it here as well… (apologies in advance, I ask a lot of questions in this post)

        I’ve got a random DSP related question, as I think I don’t understand this properly…
        When a signal is clipped in the digital realm, it’s possible to have up to and including a pure square wave. I know that when anything approaching a square wave, or really any rapid change like an impulse, leaves the digital realm and passes through a DAC stage, the resulting signal will have small overshoots that stabilize over time. (photo for an example)

        Now, my questions…

        These oscillations, or ringing, are they caused by the anti-aliasing filter?

        Does transformer slew rate have anything at all to do with this or is it 100 percent Gibbs phenomenon? I always assumed most quality gear had transformers with ultra high slew rates that wouldn’t  even come close to affecting anything audibly.

        I <think> that the duration of these overshoots will depend on anti-aliasing lpf frequency and design? Is that correct?

        Is there anything that affects the amplitude of the overshoot? Or is it always a set amount, based on signal amplitude or something like that?

        Finally, are these overshoots in the audible range, or up near Nyquist?

        I’ve always been operating under the assumption that I liked the sound of clipped transients vs pure limiting because the clipping would cause that overshoot and ring, which would result in an audible extra bit of sharp transient. I assumed that ringing in a post-DAC clipped signal was the HF saturation that gave the clipped transient that “edge” that sounds so nice. But now I’m wondering if that ringing is way beyond the audible range and isn’t the real reason a clipped transient can sound nice.

      • March 6, 2023 at 5:18 pm #5107
        James Johnston

          Oh boy. You asked an interesting question. Ripples due to bandwith limiting come along with the digital realm. If I take a square wave, and filter it to a bandwidth where any of the appreciable harmonics are removed (or changed in phase) you will see “ripples”. These are a direct consequence of modifying the spectrum (by removing or changing phase) of the signal in question.  This is, however, not the issue with digital clipping of periodic signals.

          What’s more, “Gibbs Ears” is a term that refers to two things, one of which is a theoretical issue that can only happen with theoretically perfect square waves (which do not exist in the real world!), and the other of which, which looks somewhat similar, which is the result of bandwidth limiting, but which is NOT the same. “Gibbs Ears”, the zero power amplitude excursion in a theoretic Fourier transform, has a finite amplitude and zero width, yes, ZERO width, and thence has zero energy.  This does not happen in the real world, because one must have infinite bandwidth of the square wave, which literally can never exist int he real world.  That’s “Gibbs Ears”.


          The effect of bandwidth limiting (the ripples that have finite width as well as finite amplitude) are simple results of Fourier mathematics, and are not an ‘error’, they are what you SHOULD see when a wide-band signal is filtered to narrower bandwidth.

          NEITHER of these is clipping.

          The issue with clipping (a periodic signal is worst in this case) in the digital realm is that you will generate harmonics of the periodic signal that are OVER Fs/2 (Fs is sampling rate) and as such will promptly (instantly, no other option applies) alias back down into the baseband.

          For instance, let’s propose (for a really ugly example) a sine wave (using 44.1kHz sampling) that is set to (44100-1000)/3.  Yes, that means that the third harmonic of that sine wave, when you clip that waveform symmetrically, is 1000Hz. That is both anharmonic, extremely audible, and, well, a lot of other things, mostly “bad”.  If you clip assymmetrically, you also get kHz tone, too. Note, also NOT harmonic.  And yes, this continues up the harmonic number, splattering <redacted> all over your audio spectrum.

          This is why digital clipping is bad.

          There is a short graph of this in Bob’s book somewhere, wherein he says (at my urging, not that he had to be urged much) “don’t do that!”

        • March 6, 2023 at 5:19 pm #5108
          James Johnston

            As to transients, they have widespread spectrum, and the error spectrum aliases back down, but the overall spectrum is wide vs. wide, and you don’t necessarily get any tonal components. This is also shown in Bob’s book.

          • March 6, 2023 at 6:47 pm #5109
            Alexey Lukin

              Clipping is the extreme form of limiting. When a transient goes through a slow limiter, it is softened, because its level is dropped so much. But when it is clipped, you get the maximal possible RMS and thus the transient stays relatively sharp. I don’t think it has much to do with extra ringing after the DAC.

              Good limiters know when to clip a transient, based on its spectral content, and when to switch to slower release times to avoid distorting the sustained loud signals.

            • March 7, 2023 at 9:43 am #5111
              Bob Katz

                When you combine:

                • clipping

                • possibly limiting

                • possibly aliasing

                • bandwidth limiting

                You get such a complex combination I wager no one can predict the results. Many years ago I moved over to frequently using analog non-linear processing over digital non-linear processing because I felt the sound via analog was cleaner and more open, and that the analog processing seemed to tolerate purposeful or accidental clipping much more nicely. Reasons why include: lack of aliasing, softer action (lower effective ratios, longer attack times), personal listening preference.

                I soon learned, however, that pushing the ADC above 0 dBFS — even a few tenths of a dB — was a crap shoot— if the music was complex it could mask the distortion, but single sounds (flute, piano, solo snare) quickly sounded ugly. So I moved to either avoiding clipping or to using analog peak limiting instead.

            You must be logged in to reply to this topic.

            Topic Tags