INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Clip protection not working correctly for 2-channel audio?  (Read 1004 times)

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Clip protection not working correctly for 2-channel audio?
« on: June 07, 2020, 12:27:05 am »

I have a track where I've discovered clip protection does not seem to be operating effectively.

Without going into exhaustive detail, I have MC volume set to -5db to allow headroom. I have Volume Leveling, EQ, PEQ, and Surround Field engaged. So I know I'm messing with the signal; that's not the point because clip protection should take that into account, so bear with me.

The track has a R128 Peak Level of -0.5db. Due to Volume Leveling on the album, MC adjusts the volume +3.6db during playback.

First question: I wonder if MC is doing album volume leveling appropriately, since applying +3.6db to a track with a peak of -0.5db is knowingly pushing it to clipping.

Second question: When I get to position 3:20 in this track, I hear significant audible distortion from the speakers, Analyzer shows pegged at 100%, but Clip Protection does NOT show engaged in audio path.  If I reduce volume another -3db, distortion disappears.  My understanding is clip protection works by reducing volume to prevent distortion. Since distortion is present, but the distortion is eliminated by further reducing volume, is clip protection not working effectively or as intended?

For those who might be interested, the album is Gardiner's recording of Bach's St. Matthew Passion, track 29.

Any insight appreciated...  Thanks!

Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10935
Re: Clip protection not working correctly for 2-channel audio?
« Reply #1 on: June 07, 2020, 12:59:20 am »

First question: I wonder if MC is doing album volume leveling appropriately, since applying +3.6db to a track with a peak of -0.5db is knowingly pushing it to clipping.

If you use internal volume and reduce the volume below max, then it'll use that headroom for volume leveling. Which means that if you used internal volume to leave headroom for PEQ etc, you might end up double-using that headroom - in which case I would recommend to actually use PEQ to add headroom for all normal DSP, instead of your volume control.

Second question: When I get to position 3:20 in this track, I hear significant audible distortion from the speakers, Analyzer shows pegged at 100%, but Clip Protection does NOT show engaged in audio path.  If I reduce volume another -3db, distortion disappears.  My understanding is clip protection works by reducing volume to prevent distortion. Since distortion is present, but the distortion is eliminated by further reducing volume, is clip protection not working effectively or as intended?

Clip protection is not a binary decision, it doesn't just snap on and lowers the volume, instead it tries to be friendly about it and reduces the volume slowly to avoid a too drastic change - afterall the peak might be a transient thats over again quickly, and a too big volume change might be worse. This design works well for badly authored tracks with short transient peaks over the limit, or riding the limit with DSP. Its not necessarily designed for boosting a large part of the audio over the limit - in which case you'll likely want to fix your DSP anyway. It will still flatline those overflows naturally, they don't "get out".
Logged
~ nevcairiel
~ Author of LAV Filters

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Clip protection not working correctly for 2-channel audio?
« Reply #2 on: June 07, 2020, 01:34:46 am »

If you use internal volume and reduce the volume below max, then it'll use that headroom for volume leveling. Which means that if you used internal volume to leave headroom for PEQ etc, you might end up double-using that headroom - in which case I would recommend to actually use PEQ to add headroom for all normal DSP, instead of your volume control.
Thanks for your reply, Hendrik.  That is very interesting. Could you elaborate on that a little more, especially about "it'll use that headroom for volume leveling... double-using that headroom"?  I have always heard on the forum, for years, that reducing the internal volume control was the proper way to all headroom for inter-sample peaks and EQ.  But you're saying that's wrong and using PEQ to reduce volume is preferable. This is potentially very valuable information.

Clip protection is not a binary decision, it doesn't just snap on and lowers the volume, instead it tries to be friendly about it and reduces the volume slowly to avoid a too drastic change - afterall the peak might be a transient thats over again quickly, and a too big volume change might be worse. This design works well for badly authored tracks with short transient peaks over the limit, or riding the limit with DSP. Its not necessarily designed for boosting a large part of the audio over the limit - in which case you'll likely want to fix your DSP anyway. It will still flatline those overflows naturally, they don't "get out".
My EQ is not doing large boosts, but Volume Leveling is; +3.6db to the entire album, as I mentioned. And this is not a short transient. The distortion (and the analyzer at 100%) persists for about 5 seconds when this happens.  It's a choral work, so there are no percussion transients; it's voices.  I have had clip protection engage on movies, and it engages on much shorter duration peaks than 5 seconds, but it is not engaging here.  When I add +10db with PEQ, clip protection does engage.  So it seems that clip protection is sensitive to the magnitude of clipping that occurs, not just the duration, because it is letting some low-level extended duration clipping distortion though.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10935
Re: Clip protection not working correctly for 2-channel audio?
« Reply #3 on: June 07, 2020, 01:57:56 am »

Volume was never a good choice to avoid clipping by DSP, imho.  Its too easy to accidentally increase it and drive it into clipping again. If you cause clipping by PEQ, why not also use PEQ to avoid it? Its safe and cannot be accidentally overriden by a simple slider in the main UI.

It also "always works" and is not reliant on actually using internal volume. It also works when using the same DSP setup for audio conversion, etc.

For Clip Protection - its not designed to be a system that you absolutely rely on, so I'm not too worried about not catching some special DSP-induced cases "properly". Whenever it has to trigger, something is already terribly wrong and you should actively want to avoid using it at all times. No matter how it operates, it activating will reduce quality of playback.
Logged
~ nevcairiel
~ Author of LAV Filters

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Clip protection not working correctly for 2-channel audio?
« Reply #4 on: June 07, 2020, 02:19:18 am »

Sorry, it's still not clear what you meant by "double using the headroom".

When using PEQ to provide the headroom then, must it be moved to the top of the order, before any boosts, to avoid clipping, or does it not matter as long as it's in there somewhere (before the bit depth is reduced from 64 bits to the output bit depth at the end)?
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: Clip protection not working correctly for 2-channel audio?
« Reply #5 on: June 07, 2020, 02:30:47 am »

Sorry, it's still not clear what you meant by "double using the headroom".
Doesn't it just mean that if you were thinking "I will limit myself to - 5dB in the volume control because of my peq" then MC is thinking the same thing so then you are both using/relying on that 5dB which results in clipping.

You need a way to signal to MC that the max volume is actually -5 and a gain adjustment in peq is the simplest way to do that today.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10935
Re: Clip protection not working correctly for 2-channel audio?
« Reply #6 on: June 07, 2020, 02:51:13 am »

Matt is right. MC doesn't know that you use internal volume for DSP headroom. So you designed PEQ/DSP to need headroom, and you provide that with internal volume (which leaves you with no headroom leftover). On the other side, MC wants to do volume leveling, and it needs headroom to apply a boost from album mode. It sees that you use internal volume, and it uses that headroom to apply that boost. Two things are now using your one headroom, and thus there is no longer enough headroom. Without internal volume, volume leveling would not actually apply that boost, since it knows it might clip then.

This is why I would recommend using PEQ to create headroom for DSP, since MC will not try to use that for anything else.

When using PEQ to provide the headroom then, must it be moved to the top of the order, before any boosts, to avoid clipping, or does it not matter as long as it's in there somewhere (before the bit depth is reduced from 64 bits to the output bit depth at the end)?

It doesn't really matter since the internal floating point format does not clip - floating point can go over 100% (its designed for  -1.0 .. 1.0, but it can go above that no problem). Its only when you convert to integer that you have to enforce the limit, since you cannot exceed the maximum value of an integer. That said, personally I would try to create the headroom as early as possible, just to avoid any potential for some processing algorithm just not liking values that exceed max.
Logged
~ nevcairiel
~ Author of LAV Filters
Pages: [1]   Go Up