INTERACT FORUM

Please login or register.

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

Author Topic: Analyze audio and clipping potential  (Read 3396 times)

Guybrush

  • Regular Member
  • World Citizen
  • ***
  • Posts: 109
Analyze audio and clipping potential
« on: May 17, 2016, 10:40:08 pm »

If I analyze audio on my bluray files, is there anything in the peak level information or otherwise that will tell me how loud I can turn up internal volume before clipping occurs? Is analyze audio based on 100% internal volume? Is there a way to account for the channel gains I have applied in dsp/room correction? Sorry for the noob questions.
Logged

Guybrush

  • Regular Member
  • World Citizen
  • ***
  • Posts: 109
Re: Analyze audio and clipping potential
« Reply #1 on: May 19, 2016, 10:09:22 am »

What about when I observe the analyze graph while playing a clip? What is the peak level %? Is that % to clipping? I never see it go above 45% or so on my loudest demo clips. If that's the case I need to nail down the pictures on the wall a little better and turn it up. This is my first experience with powerful speakers and a powerful amp, so I'm walking things up a little cautiously, even though I have the amps sized so they can't damage my speakers.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10935
Re: Analyze audio and clipping potential
« Reply #2 on: May 19, 2016, 10:18:42 am »

The peak level information in the audio analysis would tell you when it clips if you do not use Volume Leveling  (which would usually move the volume down a bit).
With Volume Leveling MC will try to avoid any clipping, the only case where it might still happen is during downmixing to stereo on extremely loud and uncorrelated signals.

During Playback, the peak level displayed in the DSP Studio screen does indicate the current peak of the signal going out.
Logged
~ nevcairiel
~ Author of LAV Filters

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Analyze audio and clipping potential
« Reply #3 on: May 19, 2016, 10:24:39 am »

Audio analysis is based on the file, not your DSP settings.
If you use Adaptive Volume set to Peak Level Normalize after analysis, it will play the track as loud as possible without clipping.
 
JRiver's volume control cannot add volume, it can only subtract. 100% is 0dB.
 
However if you are increasing the volume of other channels via DSP that could potentially lead to clipping - though JRiver tries to prevent it.
If you are adjusting channel volume via DSP, you should always subtract to equalize the channels, not add.
So instead of adding 3dB to the left channel, you would subtract 3dB from the right for example.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Analyze audio and clipping potential
« Reply #4 on: May 19, 2016, 10:35:51 am »

Guy,

What are you trying to accomplish?  The answer to that question should lead us to the proper path for you to follow.

Brian.
Logged

Guybrush

  • Regular Member
  • World Citizen
  • ***
  • Posts: 109
Re: Analyze audio and clipping potential
« Reply #5 on: May 19, 2016, 12:38:41 pm »

What are you trying to accomplish?  The answer to that question should lead us to the proper path for you to follow.

As I mentioned, I'm new to the whole big speakers/big power amp thing, so I'm just being cautious with my system. I have a running library of my favorite clips from my movie collection that largely include big explosions and lots of LFE. I'm worried as I continue to watch them at higher and higher volumes that I'm going to push it too high and cause damage. So, I'm just trying to be aware of how much headroom I have. I'm a music lover, too, but haven't experimented with turning up my music as loud as my movies, yet.

At the same time, I'm trying to understand the relationship between JRiver internal volume, channel gain from room correction, preamp gain from the equalizer, etc. Basically, if I want my system to go louder, what's the best and safest way of doing it.

If you are adjusting channel volume via DSP, you should always subtract to equalize the channels, not add.
So instead of adding 3dB to the left channel, you would subtract 3dB from the right for example.

Good to know. I've been doing this wrong. I have to add 10-12db to my rears to get them at the same SPL as my fronts on the volume calibration test. Not to mention that I like having my center channel louder than all those for dialogue. So I'm worried I'm eating into my headroom quite a bit.

The peak level information in the audio analysis would tell you when it clips if you do not use Volume Leveling  (which would usually move the volume down a bit).

I don't use volume leveling. The peak levels in the audio analysis when watching a demo clip or THX intro or something turned up to about 75% volume reach only 40-45% at the highest. Am I really that far from saturating the signal? Would a lot of that be made up in the last 25% volume increase? Does this mean I have room to increase preamp gain for more volume if needed?

Thanks for all your replies, everyone!
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re: Analyze audio and clipping potential
« Reply #6 on: May 19, 2016, 01:08:02 pm »

As I mentioned, I'm new to the whole big speakers/big power amp thing, so I'm just being cautious with my system. I have a running library of my favorite clips from my movie collection that largely include big explosions and lots of LFE. I'm worried as I continue to watch them at higher and higher volumes that I'm going to push it too high and cause damage. So, I'm just trying to be aware of how much headroom I have. I'm a music lover, too, but haven't experimented with turning up my music as loud as my movies, yet.

At the same time, I'm trying to understand the relationship between JRiver internal volume, channel gain from room correction, preamp gain from the equalizer, etc. Basically, if I want my system to go louder, what's the best and safest way of doing it.

Good to know. I've been doing this wrong. I have to add 10-12db to my rears to get them at the same SPL as my fronts on the volume calibration test. Not to mention that I like having my center channel louder than all those for dialogue. So I'm worried I'm eating into my headroom quite a bit.

I don't use volume leveling. The peak levels in the audio analysis when watching a demo clip or THX intro or something turned up to about 75% volume reach only 40-45% at the highest. Am I really that far from saturating the signal? Would a lot of that be made up in the last 25% volume increase? Does this mean I have room to increase preamp gain for more volume if needed?

Thanks for all your replies, everyone!

I think you're blurring some categories here.  As noted above, you can't actually add digital gain as almost all digital audio is mastered to peak at or near 0dB (you can see this looking at the peak levels from analyze audio).  If the peak of a track is at or over 0dB that means that you can add zero gain without digital clipping, and may need to to actually reduce the volume from 100% to avoid clipping (if the peak is over 0dB). 

JRiver tries to prevent clipping in several ways: for example if you add gain to a speaker in the Room Correction module specifically, JRiver actually just attenuates the other channels instead of boosting the one you're trying to boost.  This only applies to the Room Correction module!  Gain added in the equalizer or parametric EQ module can and will cause clipping (think of it as "expert mode" where the safety is off to some extent).

As an additional safeguard JRiver has a clip protection module that acts as a fast attack limiter that just turns down the volume rapidly when music would clip.  That doesn't guarantee no sudden momentary clipping, but it prevents continuous clipping. This applies in general unless you explicitly turn it off, but if you've tried to add net gain in parametric EQ, you'll find clip protection keeps engaging and turning the volume down at loud parts which is not ideal, and you will on very sudden spikes in volume have the risk of real clipping (think gunshots). 

To be clear, you should never configure DSP to add net gain in software, because 99% of all professionally mastered audio (stereo and film) peaks at or near 0dB.  So you either need to convert desired gain into reductions other places (like with relative levels of channels), or reduce the total volume of all channels by enough to give you the headroom you need to add the gain (like with speaker correction). 

All of that is about clipping in the digital domain.  What happens once the signal is analog is entirely different and subject to an entirely different type of clipping (amplifiers also clip, but for different reasons). You mention a pre-amp; I'm not sure if you meant the "pre-amp" setting in JRiver's equalizer or a physical analog pre-amp separate from your computer.  If you mean the JRiver equalizer, you can't add gain there either, the same rules apply as in the rest of the digital domain.  If you mean a physical pre-amp, turning it up has nothing to do with the digital level; you have to do the math on your pre-amp, power amp, and speakers to determine if you can turn up the pre-amp without clipping.  If you can describe your signal chain a little bit, we can help. 

If your main concern is safety, first figure out how much power your speakers can handle (A), and how much power your amplifier can put out when fully driven by your soundcard/DAC (B).  If (A) is less than (B), you should set your analog amp/pre-amp volume controls so 100% in JRiver is as loud as you'd ever want to listen to anything.  If (B) is less than (A), you need to be careful, and do the math with your speaker's sensitivities and power handling to determine how loud you can safely drive them.  Then set the analog volume controls appropriately.  If you follow that method carefully, 100% volume will not pose an equipment safety hazard or an "ear" safety hazard.  If you are only using digital volume controls, it's a little different (JRiver offers a max volume setting, and there are some tips to avoid system sounds), but the same kind of analysis applies.   
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Analyze audio and clipping potential
« Reply #7 on: May 19, 2016, 02:15:04 pm »

Digital gain structure, analog gain structure, digital clipping, analog clipping, and avoiding speaker damage.  These subjects are inter-related, and can get complex.  MWilliems has covered a lot of ground.

Avoiding speaker damage is kind of complex when you take all of the above into account.  But, in another way, it's actually very simple:  Listen for the sound changing at high volumes.  If you hear bad noises, turn it down immediately.  You can learn to hear clipping pretty easily, as clipping sounds really nasty.  You should also listen for distortion and for things just not sounding right.  If you just apply some common sense to it, and listen, you'll likely avoid any speaker damage.

Woofers and subwoofers are a little bit different in this respect because hearing clipping much, much harder with bass drivers.  But I'm not sure what compliment of speakers you have and/or whether you have self amplified subwoofer(s) or not.

Good luck on your audio journey.  :)

Brian.
Logged

Guybrush

  • Regular Member
  • World Citizen
  • ***
  • Posts: 109
Re: Analyze audio and clipping potential
« Reply #8 on: May 19, 2016, 02:41:59 pm »

As noted above, you can't actually add digital gain as almost all digital audio is mastered to peak at or near 0dB (you can see this looking at the peak levels from analyze audio).  If the peak of a track is at or over 0dB that means that you can add zero gain without digital clipping, and may need to to actually reduce the volume from 100% to avoid clipping (if the peak is over 0dB). 

Thanks for the detailed response. This is what I thought, but I questioned my understanding when viewing the audio analysis plot in DSP. Like I said, the max I see on videos is ~45% @ 75% volume, and on music which I generally only turn up to 60% volume, I only read about 15% peak on the analysis plot. I guess I need to see what it is like closer to 100% volume, but I guess intuitively I didn't think the signal strength would double in the last 25% volume increase, and yes, I understand the logarithmic nature of sound.

If your main concern is safety, first figure out how much power your speakers can handle (A), and how much power your amplifier can put out when fully driven by your soundcard/DAC (B).  If (A) is less than (B), you should set your analog amp/pre-amp volume controls so 100% in JRiver is as loud as you'd ever want to listen to anything.  If (B) is less than (A), you need to be careful, and do the math with your speaker's sensitivities and power handling to determine how loud you can safely drive them.  Then set the analog volume controls appropriately.  If you follow that method carefully, 100% volume will not pose an equipment safety hazard or an "ear" safety hazard.  If you are only using digital volume controls, it's a little different (JRiver offers a max volume setting, and there are some tips to avoid system sounds), but the same kind of analysis applies.  

My concern is safety while still trying to optimize my system and reasonably get as much power as I can out of it for the occasions when my wife isn't close enough to tell me to turn it down :).  My fronts are a pair of Klipsch RF-82ii's and my center is Klipsch RC-62ii, all of which are rated for 150W RMS/600W peak. My rears are Klipsch F-20 towers which are rated for 100W RMS/400W peak. I built my HTPC with Claro Halo soundcard and JRiver to serve as my preamp, and I built a 6-channel power amp using connexelectronic modules with each channel rated at 160W. I also built my sub which is a 1000W RMS/2000W peak ultimax 18, powered by a bridged connex amp good to ~1200W.

Some built-in safety measures I have is that I have line attenuators on everything but the sub to keep PC noise from coming through the speakers, as well as volume pots built into the amp (which I have turned almost all the way up anyway, so they aren't doing much.) Also, I realized after I ordered my amp and power supply modules from connex, that there is a bit of a voltage mismatch from what my soundcard can put out and what the amps' operating range is. That is, I believe max voltage output from the soundcard is about 80% of the voltage range of the amp. Also, my rears, which are the lowest rated speakers in terms of wattage, are connected by about 100ft or more of crappy gauge wire that was prewired into my walls. Basically, I'm betting on a lot of line loss through them.

So, all-in-all I think I would have a hard time doing damage to my speakers or amps except by digital clipping; hence my interest. Also, because of all the factors I listed that prevent me from reaching the full potential of my amps, I'm trying to learn how to get the most out of them that I can.  
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Analyze audio and clipping potential
« Reply #9 on: May 19, 2016, 03:06:32 pm »

Also, my rears, which are the lowest rated speakers in terms of wattage, are connected by about 100ft or more of crappy gauge wire that was prewired into my walls. Basically, I'm betting on a lot of line loss through them.

You've got a rather complex gain chain going on.  But it's not so bad.  If you were so inclined, you could calibrate it to know the power that each amplifier outputs at full scale in MC... though it gets more complex since you are applying EQ.  The big thing is to just listen and make sure you aren't overdriving any part of the system.

The above quote is nothing for you to worry about.  100 ft of 18 ga wire (pretty skinny stuff) is only about 0.7 Ohms.  Even if it were thinner and ended up being more than 1 Ohm, you still won't lose a lot of sound level.  Now the sound quality and damping change with that amount of wire and resistance.  But that's another thing.

Brian.
Logged

Guybrush

  • Regular Member
  • World Citizen
  • ***
  • Posts: 109
Re: Analyze audio and clipping potential
« Reply #10 on: May 19, 2016, 03:51:56 pm »

If you were so inclined, you could calibrate it to know the power that each amplifier outputs at full scale in MC... though it gets more complex since you are applying EQ. 

I am definitely interested in measuring the output of my amps some day. Haven't thought about how, but I'm assuming I'd need a rather pricey o-scope.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Analyze audio and clipping potential
« Reply #11 on: May 19, 2016, 03:59:08 pm »

the simplest way is to solder an 8 ohm resistor over a couple of speaker leads and plug in to the amp (instead of the speaker), turn up to 100% and read the voltage
P=v^2 / R

it's not super crazy accurate but it's a close enough, cheap and easy DIY for output power. you need a fat resistor to take the power, car audio places often have them (called dummy loads)

if you're patient and nerdy enough you can get a fair estimate of power/frequency by using test tones
Logged

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: Analyze audio and clipping potential
« Reply #12 on: May 19, 2016, 04:11:50 pm »

Thanks for the detailed response. This is what I thought, but I questioned my understanding when viewing the audio analysis plot in DSP. Like I said, the max I see on videos is ~45% @ 75% volume, and on music which I generally only turn up to 60% volume, I only read about 15% peak on the analysis plot. I guess I need to see what it is like closer to 100% volume, but I guess intuitively I didn't think the signal strength would double in the last 25% volume increase, and yes, I understand the logarithmic nature of sound.
The signal level increases 3.16x for every 10 dB increase in volume. Since JRiver's internal volume control raises the volume by 20 dB from 60% to 100%, then that is a 10x increase in signal level.

40% volume level (-30 dB) = 3.16% signal level
60% volume level (-20 dB) = 10.01% signal level
80% volume level (-10 dB) = 31.65% signal level
100% volume level (0 dB) = 100% signal level

Even at 100% volume level, most of the time the peak levels will be fairly low like less than 20%. This is due to the headroom for when there is a really loud sound in the content.
Logged

Guybrush

  • Regular Member
  • World Citizen
  • ***
  • Posts: 109
Re: Analyze audio and clipping potential
« Reply #13 on: May 19, 2016, 04:36:00 pm »

the simplest way is to solder an 8 ohm resistor over a couple of speaker leads and plug in to the amp (instead of the speaker), turn up to 100% and read the voltage
P=v^2 / R

it's not super crazy accurate but it's a close enough, cheap and easy DIY for output power. you need a fat resistor to take the power, car audio places often have them (called dummy loads)

if you're patient and nerdy enough you can get a fair estimate of power/frequency by using test tones

Good thinking. I hadn't thought of testing at discrete frequencies. I figured an actual audio signal would be all over the place so v2/r would be hard to nail down.
Logged

Guybrush

  • Regular Member
  • World Citizen
  • ***
  • Posts: 109
Re: Analyze audio and clipping potential
« Reply #14 on: May 19, 2016, 04:37:08 pm »

The signal level increases 3.16x for every 10 dB increase in volume. Since JRiver's internal volume control raises the volume by 20 dB from 60% to 100%, then that is a 10x increase in signal level.

40% volume level (-30 dB) = 3.16% signal level
60% volume level (-20 dB) = 10.01% signal level
80% volume level (-10 dB) = 31.65% signal level
100% volume level (0 dB) = 100% signal level

Even at 100% volume level, most of the time the peak levels will be fairly low like less than 20%. This is due to the headroom for when there is a really loud sound in the content.


This is enlightening. I guess I should've just done the math. Makes sense. Thanks.
Logged
Pages: [1]   Go Up