INTERACT FORUM

Please login or register.

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

Author Topic: PEQ Bug Causing Clipping (or at least causing JRiver to report Clipping)  (Read 4131 times)

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient

There's an issue with a specific combination of DSP causing clipping when no clipping should occur in this thread:  http://yabb.jriver.com/interact/index.php?topic=99406.msg688449#msg688449

I managed to reproduce it, so it's "real." If you recreate that DSP chain exactly and start playback at 100% of internal volume, most media with a peak at or near 0dB will clip repeatedly, but if you disable the high pass filter at the end of the chain, JRiver will report no clipping or overages.   This is very puzzling as a high pass filter should add no boost and if anything should reduce the total energy present. 

I didn't actually hear any clipping while testing, but that doesn't mean it wasn't clipping.  I'd appreciate it if someone could take a look a this as non-boost DSP should never cause clipping.

Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10933

High-pass or low-pass increasing the level at or near the cut off (depending on the algorithm) is not unexpected. Its documented all over the web in various audio forums, people asking about the same things because it caused unexpected problems for them. ;)
Its usually caused by the phase change from the filter.

Some explanation that seemed most logical which I found on a quick look:
https://www.gearslutz.com/board/7793641-post5.html
Logged
~ nevcairiel
~ Author of LAV Filters

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient

High-pass or low-pass increasing the level at or near the cut off (depending on the algorithm) is not unexpected.

But JRiver's filters are butterworths, right? They don't spike like a Chebyechev, they just roll uniformly downwards ("maximally flat magnitude") https://en.wikipedia.org/wiki/Butterworth_filter.  

Or do you mean the total level rises?  Or something else?  I've never seen boosts in level from applying JRiver's crossover filters previously.

Also, the levels in analyzer (including the RMS) don't appear to be clipping, but the clip indicator reports clipping, which is odd.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10933

You can't see that on a frequency plot like that, but the waveform itself changes shape and can increase in peak. Check the link in my post, I edited it in after.
Logged
~ nevcairiel
~ Author of LAV Filters

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient

That makes perfect sense and is kind of fascinating.  I'm surprised I haven't run into the issue before. I wonder how much overhead people should allow for this kind of thing?  Probably 6dB would guarantee it.

It's never bitten me personally because my max volume is set to 90% internal and I use volume leveling.  I'll head back to the thread an report your findings!
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re:
« Reply #5 on: August 14, 2015, 02:07:21 pm »

I will be surprised if this effect is the root cause here, I thought pretty large magnitude peaks were being reported?
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient

I will be surprised if this effect is the root cause here, I thought pretty large magnitude peaks were being reported?

I'm seeing less than a dB or so, sometimes a little more in my testing.  I think Hendrik's answer is probably the answer.  The attenuation of a second order butterworth high pass at 40Hz isn't much, but the phase shift casts a long shadow.  A dB (or even 2) is well within the range of what phase summing (or reduced cancellation) could possible cause.

The nature of the effect would make it invisible to most types of measurement (single tone sine waves, pink noise, or swept tones wouldn't show this effect, you need actual program material or multitone sine waves).

There may be an issue here, but the filters are performing correctly when measured, so I'm not sure how they could be boosting the signal other than in the way Hendrik described (i.e. why wouldn't it show up in a sine sweep)?
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re:
« Reply #7 on: August 14, 2015, 02:22:37 pm »

I thought Lisbeth was talking about -10dB on a channel basis but +1dB clipping? Perhaps I misinterpreted but that seems way out of line for this effect.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient

I thought Lisbeth was talking about -10dB on a channel basis but +1dB clipping? Perhaps I misinterpreted but that seems way out of line for this effect.

If that's what she's seeing I agree, that's out of the realm of this effect.  I don't think this effect could cause more than 6dB of gain in perfect storm conditions.

There's definitely a discrepancy between what analyzer is reporting and what the clip detector is reporting.  But as between the two I think analyzer is probably wrong. For example I was using some program material with a peak near 0db and R128 dynamic range of less than 2dB(!) and watching the clip meter.  It was clipping like crazy under the test conditions (which is what you'd expect), but the total overage was always less than 150% (usually closer to 120%).  Analyzer's RMS level was all over the place (plus or minus 5dB) during this even when there were no meaningful perceptual changes in volume.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re:
« Reply #9 on: August 14, 2015, 04:20:34 pm »

I have done limited testing recently on this sort of thing (the effect of minimum vs linear vs composite filters on a signal) and the effect is really about deformation of the waveform rather than serious level changes.

 i could be wrong of course :) I think she needs to provide a sample track to rule out a bug though. I need to find that bug report I mentioned in the thread, that came from someone who really knows his stuff so would be inclined to trust him.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re:
« Reply #10 on: August 14, 2015, 05:05:22 pm »

I have done limited testing recently on this sort of thing (the effect of minimum vs linear vs composite filters on a signal) and the effect is really about deformation of the waveform rather than serious level changes.

It's definitely not just about the shape of the waveform, constructive interference can result in larger or smaller waveforms, and changing phase relationships can create constructive interference (or remove destructive interference).  Given that most audio is mastered to ride 0dBFS, it doesn't take much boost to make things clip.

To use a fairly extreme case, if you have a 500Hz signal and a 1KHz signal that are 180 degrees out of phase and of equal amplitude in the recording (so comb filtering is being introduced) and a crossover filter introduces even minimal relative phase shift between them it will bring them out of total cancellation resulting in a signal that's significantly more energetic than it previously was at the comb dip points in time above the crossover (the comb dips will start to fill in).  If "everything else" in the signal is at or near 0dBFS at those moments that will cause the signal to clip.  

See also, someone getting close to 5dB of boost from a 48Hz high pass.: https://sound.stackexchange.com/questions/24981/why-is-my-cutting-equalizer-increasing-output-level

Quote
Fundamentally, the filtering process changes the shape of the waveform, so although there may be less total energy in the signal, the peak amplitude may well increase.

I do agree that some additional testing would be worthwhile.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: PEQ Bug Causing Clipping (or at least causing JRiver to report Clipping)
« Reply #11 on: August 15, 2015, 05:35:05 am »

The thread I referred to about jriver not handling certain filters correctly was this one - http://yabb.jriver.com/interact/index.php?topic=93578.msg646991#msg646991 - unfortunately the link is dead now, I imagine I could recreate the test case though if Hendrik wants one.

I suppose the problem is exacerbated by the fact she's not peak level normalise which, as mojave pointed out in another thread, adjusts the level for intersample peaks.

Ultimately I think this is one of those things where jriver lets the user shoot themselves in the foot. A nice, if somewhat niche, enhancement might be if audio analysis were DSP aware, i.e. you could assign a DSP profile to a track (or inherit it from a zone) and then audio analysis runs with that DSP applied and then can adjust levels automatically to keep the signal clean.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re: PEQ Bug Causing Clipping (or at least causing JRiver to report Clipping)
« Reply #12 on: August 15, 2015, 06:26:25 am »

I suppose the problem is exacerbated by the fact she's not peak level normalise which, as mojave pointed out in another thread, adjusts the level for intersample peaks.

I agree; volume leveling also solves a lot of these problems.


Ultimately I think this is one of those things where jriver lets the user shoot themselves in the foot. A nice, if somewhat niche, enhancement might be if audio analysis were DSP aware, i.e. you could assign a DSP profile to a track (or inherit it from a zone) and then audio analysis runs with that DSP applied and then can adjust levels automatically to keep the signal clean.

You're right that you'd basically need to reanalyze all of your content to make that possible (It's hard to predict if a given combination of DSP would cause a track to clip in advance without doing analysis).  

Honestly, I'm not sure a more sophisticated solution is really necessary as all any such solution would do is just turn down the volume a bit, which:
a) a user could easily do themselves on demand in a way that addresses their situation (either permanently in the DSP chain or on demand using the actual volume control).  
b) If you enable volume leveling or adaptive volume with peak level normalize, you get a 90% solution as they both attenuate tracks a minimum of the amount of 1dB + whatever is needed to avoid intersample peaks, and volume leveling will often provide even more headroom.
c) And if things get out of hand clip protection will catch any oops's, by turning down the volume on demand.

Basically, it all comes down to turning down the volume some when using DSP.  If I were facing this problem, I'd probably rather just dial in a permanent -2dB for all channels in PEQ rather than reanalyze 80,000 files  ;D
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: PEQ Bug Causing Clipping (or at least causing JRiver to report Clipping)
« Reply #13 on: August 15, 2015, 06:51:24 am »

But I have all these spare cpu cycles!! :'(

I agree we can file that idea under technically feasible but not sensible :D
Logged
Pages: [1]   Go Up