Taperssection.com

Gear / Technical Help => Post-Processing, Computer / Streaming / Internet Devices & Related Activity => Topic started by: StarkRavingCalm on March 30, 2015, 08:32:10 AM

Title: Measure max\average amplitude?
Post by: StarkRavingCalm on March 30, 2015, 08:32:10 AM
I have been going thru my recordings to mix and master them and I realize that I mastered some of them a little too 'hot'.
I probably need to re-do most of them but it would save me alot of time if I knew which were of an acceptable level.

Does anyone know of software out there that will analyze a wav and tell you peak and average amplitude?
I dont see a way to get this data from Audacity, CDWave, foobar, etc...
A scripted solution would be perfect as I could just point it at a directory and have it read all of them.
I see some perl modules out there to analyze audio data but havent been able to get it work out of the box.


Thanks
Title: Re: Measure max\average amplitude?
Post by: it-goes-to-eleven on March 30, 2015, 09:16:08 AM
You are definitely on the right path.  When I post-process a recording I always take notes on the avg RMS levels and the peak levels. I write that down in a notebook, and it also includes my location in the venue, mic pattern, the gear I ran and the gain I ran.  That information is absolutely invaluable for estimating the required amount of gain, pattern choice, etc, at future performances.

There is a really great free command line tool, called normalize.  I love that tool, and I've been using it for over a dozen years. It will report levels, and set levels based on peak, or avg RMS.  It can just increase gain, or it can do compression to raise the avg RMS while avoiding clipping (that is the default). It can treat multiple tracks independently, or it can scan and adjust all of them so they are uniform (batch mode).

You can have it add a fixed amount of gain to files, you can have it just apply a limiter, etc. It is very powerful.

To scan some files and just report the levels:

% normalize -n *wav
Computing levels...
  level        peak         gain
-33.7506dBFS -4.0635dBFS  21.7506dB  w1.wav

In that example, file w1.wav is just a random file. -33dBFS is the avg RMS level (that's really low). It peaks at -4dBFS. The default behavior of normalize is the adjust and compress as necessary so the avg RMS is -12dB. That is pretty hot.  So if I ran it with default settings, it would increase the gain by 21.75dB, but it would first compress the audio to prevent clipping.

I don't normally compress my audio in this way.  But an exception is when I use this tool to quickly take a recording, with individual tracks, and make a "car" version that is louder for windows-down driving, etc.


Normalize

   This is release 0.7.7 of Normalize, an audio file volume normalizer.

You can get it from here:

http://normalize.nongnu.org/

Title: Re: Measure max\average amplitude?
Post by: Sloan Simpson on March 30, 2015, 10:54:17 AM
Does anyone know of software out there that will analyze a wav and tell you peak and average amplitude?

http://www.pleasurizemusic.com/es/es/download (http://www.pleasurizemusic.com/es/es/download)

TT Dynamic Range Meter. You can use it as a plugin for something you're currently working on, or there's an offline version you can use to scan existing files.
Title: Re: Measure max\average amplitude?
Post by: Ultfris101 on March 30, 2015, 10:58:13 AM
I'll have to check these out. I've been thinking about the same thing lately.

Especially when I combine with video I'm trying to figure out how much I need to compress and/or add gain to get to standard RMS values. Partly I want to fit in with videos others make and not be lots quieter or louder but also to give some consistency to my output.

Seems like targeting about -14dBFS to -12 dBFS RMS is about right but measuring that rather than eyeballing the meters in Samplitude I haven't figure out how to do yet (just need time to research).


Title: Re: Measure max\average amplitude?
Post by: capnhook on March 30, 2015, 05:17:40 PM
Does anyone know of software out there that will analyze a wav and tell you peak and average amplitude?

http://www.pleasurizemusic.com/es/es/download (http://www.pleasurizemusic.com/es/es/download)

TT Dynamic Range Meter. You can use it as a plugin for something you're currently working on, or there's an offline version you can use to scan existing files.

^x2
Title: Re: Measure max\average amplitude?
Post by: voltronic on March 30, 2015, 09:49:01 PM
Does anyone know of software out there that will analyze a wav and tell you peak and average amplitude?

http://www.pleasurizemusic.com/es/es/download (http://www.pleasurizemusic.com/es/es/download)

TT Dynamic Range Meter. You can use it as a plugin for something you're currently working on, or there's an offline version you can use to scan existing files.

This is the way to go.  I use the Foobar component available here:
http://www.pleasurizemusic.com/de/free-downloads (http://www.pleasurizemusic.com/de/free-downloads)

Just load your file / files into Foobar and it spits out a .txt file in the directory of said files that shows exactly what you're looking for.
Title: Re: Measure max\average amplitude?
Post by: StarkRavingCalm on April 12, 2015, 01:21:59 PM
need to play with normalize some more but the Dynamice Range component in Foobar has expired?

"This foobar2000 component has an expiration date set to 1 September 2011. Around this date the Pleasurize Music Foundation has planned an update for the Dynamic Range Meters and the foobar2000 component. These releases will have an updated algorithm for the DR metering.

Please update this component. The latest information can be found on the website www.pleasurizemusic.com."

That's where I downloaded from....
Title: Re: Measure max\average amplitude?
Post by: StarkRavingCalm on April 12, 2015, 01:23:54 PM
While the discussion is still open...

Most people like to record around -12db, is it safe to say most people like to master at 0db?
Title: Re: Measure max\average amplitude?
Post by: goodcooker on April 12, 2015, 01:36:48 PM
While the discussion is still open...

Most people like to record around -12db, is it safe to say most people like to master at 0db?

I increase gain to -2dB then add a little Waves LC3 compression with the output ceiling at -1dB. Gives it just a little extra oomph but sounds really natural with little to no chance of overs.
Title: Re: Measure max\average amplitude?
Post by: voltronic on April 12, 2015, 07:05:16 PM
need to play with normalize some more but the Dynamice Range component in Foobar has expired?

"This foobar2000 component has an expiration date set to 1 September 2011. Around this date the Pleasurize Music Foundation has planned an update for the Dynamic Range Meters and the foobar2000 component. These releases will have an updated algorithm for the DR metering.

Please update this component. The latest information can be found on the website www.pleasurizemusic.com."

That's where I downloaded from....
You could try this one.  I'm using 1.1.0 with foobar and it hasn't "expired"...
http://www.hydrogenaud.io/forums/index.php?showtopic=101980 (http://www.hydrogenaud.io/forums/index.php?showtopic=101980)
Title: Re: Measure max\average amplitude?
Post by: dabbler on April 19, 2015, 03:45:00 AM
I love the sox stats effect.  It's actually typed almost instinctively with every invocation I run :D

  sox $INPUT -n stats

On any existing file shows peaks, RMS Peaks (over 50ms windows), RMS level, Flat factor, Pk count, etc without writing anything to disk ("-n" means to not generate an output file in the above example)

Once the final file is encoded to FLAC, I might also use "metaflac --add-replay-gain $OUTPUT" to see what the ReplayGain standard thinks of it.

I used to shoot for peaks around -12 dB, but lately I've been inching my way higher and higher to avoid self noise during quieter moments.  I usually leave at least 0.5 dB headroom after limiting to avoid clips when resampling or doing lossy encoding.  sox issues a warning if there's even a single clipped sample introduced at any stage of the effects chain, including resampling and lossy encoding (but AFAIK, a single clipped sample, or even a small handful is not audible).
Title: Re: Measure max\average amplitude?
Post by: StarkRavingCalm on April 21, 2015, 12:05:52 PM
Here is sox output for a show I taped on Friday.
What should be my focus?


             Overall     Left      Right
DC offset  -0.000031 -0.000031 -0.000031
Min level  -0.166111 -0.166111 -0.146197
Max level   0.125307  0.125307  0.124587
Pk lev dB     -15.59    -15.59    -16.70
RMS lev dB    -35.66    -35.37    -35.97
RMS Pk dB     -23.92    -23.92    -25.48
RMS Tr dB     -68.09    -66.40    -68.09
Crest factor       -      9.75      9.19
Flat factor     0.00      0.00      0.00
Pk count           2         2         2
Bit-depth      22/24     22/24     22/24
Num samples     195M
Length s    4066.224
Scale max   1.000000
Window s       0.050
Title: Re: Measure max\average amplitude?
Post by: dabbler on April 22, 2015, 06:50:00 AM
The "Pk lev dB" puts you at -15.59, so you can add around 15dB to both channels without introducing any clipping and still have -0.59 dB headroom on the left channel.  Most everything else is left to taste :)

I always save the stats output of the original file to a text file so I can know how much gain to add to a recording instead of using the sox "gain -n" (normalize) effect, as "gain -n" requires decoding + scanning the entire file every time before knowing what gain to apply.

You can compress and EQ (downwards) further, too, depending on where your peaks are.  If your Pk count or Flat Factor increases, you might be in trouble.  I suggest listening carefully with decent headphones or IEMs to better detect audible clipping.  I've found it much easier to detect distortion (or any other flaws) using headphones than even good nearfield speakers.

You can also try comparing RMS stats from your recording to some existing releases from the same artist (assuming you like the audio engineering of the artist's releases) if you want your recording to be competitive with the studio stuff in shuffle.

That said, this is just what I'm doing myself nowadays, but I'm still endlessly tweaking my recordings and not sharing much, yet...
Title: Re: Measure max\average amplitude?
Post by: StarkRavingCalm on April 26, 2015, 04:51:26 PM
Ok, different file:

BEFORE:

          Overall     Left      Right
DC offset  -0.000031 -0.000031 -0.000031
Min level  -0.203824 -0.203824 -0.195891
Max level   0.213292  0.181262  0.213292
Pk lev dB     -13.42    -13.81    -13.42
RMS lev dB    -33.84    -33.70    -33.98
RMS Pk dB     -22.33    -22.33    -22.57
RMS Tr dB     -66.59    -66.59    -65.87
Crest factor       -      9.87     10.66
Flat factor     0.00      0.00      0.00
Pk count           2         2         2
Bit-depth      22/24     22/24     22/24
Num samples     222M
Length s    4617.144
Scale max   1.000000
Window s       0.050



AFTER:

        Overall     Left      Right
DC offset  -0.000124 -0.000124 -0.000124
Min level  -0.811439 -0.811439 -0.779854
Max level   0.849132  0.721617  0.849132
Pk lev dB      -1.42     -1.81     -1.42
RMS lev dB    -21.84    -21.70    -21.98
RMS Pk dB     -10.33    -10.33    -10.57
RMS Tr dB     -54.59    -54.59    -53.87
Crest factor       -      9.87     10.66
Flat factor     0.00      0.00      0.00
Pk count           2         2         2
Bit-depth      24/24     24/24     24/24
Num samples     222M
Length s    4617.144
Scale max   1.000000
Window s       0.050



Raised db by +12 on the source and set Master Fader to 0db. This is where I ended up.
Title: Re: Measure max\average amplitude?
Post by: bombdiggity on April 27, 2015, 03:35:46 PM
You don't need to leave the dc offset in...  I'd argue for removing it, though have no idea how to do that with command line programs. 
Title: Re: Measure max\average amplitude?
Post by: StarkRavingCalm on April 27, 2015, 03:42:47 PM
You don't need to leave the dc offset in...  I'd argue for removing it, though have no idea how to do that with command line programs.

I didnt use sox to increase the amplitude.
Different program.
Title: Re: Measure max\average amplitude?
Post by: bombdiggity on April 27, 2015, 05:50:26 PM
^ You should be able to remove the dc offset.  In audition it's called "center wave" under amplify/fade (process)

While the discussion is still open...

Most people like to record around -12db, is it safe to say most people like to master at 0db?

Also I think this was answered but just as you wouldn't record to 0db you shouldn't master to it.  You can come as close as you want while leaving a little room though.  How you get there will impact the sound though.  Sometimes trial and error but with a dynamic live recording a bit of limiting or compression usually gets you a more even listen and more solid output.  Too much will sound forced though.  Loud rock shows usually have that built into the mix so you can often just amplify. 
Title: Re: Measure max\average amplitude?
Post by: dabbler on April 27, 2015, 07:19:45 PM
sox has a "dcshift" effect to remove DC offset, however AFAIK it only works if DC offset is constant throughout the file.  Alternatively (as noted in the sox manpage), you can also use a highpass filter at a low frequency such as 10 or 15Hz to remove the offset (while introducing a short phase delay).

I usually highpass at 15Hz myself (and often higher depending on the material)
Title: Re: Measure max\average amplitude?
Post by: rocksuitcase on April 27, 2015, 08:23:10 PM
bump to learn things >:D
I am so old skool I still use Wavelab's Global analysis tool ,and then adjust overall gain that way. My preference is to never master above -.5. lately on my PMD661 I've been recording around -12 to -8 avg, but find when I get it on the computer, there is some peak which goes to -4 or so.
Obviously I am NOT the person to answer your question, but i like learning what other people use.
Title: Re: Measure max\average amplitude?
Post by: StarkRavingCalm on April 29, 2015, 11:03:40 AM
I am using MPowered ProTools. Mainly, because I like the vertical slides.
I have the source in one 'channel' and I create a Master Fader.
In the example above, I increase the source channel by 12db (this is max) and I leave the MF at 0db.
Depending on the source I may need to set MF to +2db or such so that the final mix is about 0db (or -2db for headroom) but that is for another day.

My question now refers to dithering.
I don't want to go too far with that topic as I have a decent understanding of it.
My questions are:

Do you only need to dither IF you are down-sampling? (i.e.. 24/28 > 16/44)

At what point in the process do you dither?
Pre-Mix? Or when finalizing?
Or if you have already finalized at 24/48 and want to convert your file to a 16/44 version?
Title: Re: Measure max\average amplitude?
Post by: bombdiggity on April 29, 2015, 02:07:03 PM

At what point in the process do you dither?
Pre-Mix? Or when finalizing?
Or if you have already finalized at 24/48 and want to convert your file to a 16/44 version?


Always last.  You want to make any editorial changes to the files at the original rate. 
Title: Re: Measure max\average amplitude?
Post by: Gutbucket on April 29, 2015, 03:03:40 PM
Apply dither immediately prior to truncating excess bits, anytime you truncate.  That means whenever going from a higher bit-depth file to a lower bit-depth one.  Typically that's done when saving your 24bit source (or whatever internal rate the software is using, which is probably higher than that, regardless of the bit-depth of your source files) as 16bit final output files.  Most software will dither and truncate for you in one step, automatically.  IMHO, you needn't worry too much about the type of dither and if it's "noise-shaped" or not, especially with live music which you have level adjusted so that the peaks are at a decently high level.  In that case the dither will be so low in level it will be completely burred beneath the much higher noise-floor of your recording so you'll never hear it.  Basic "triangular" dither is fine.

This is not the same as down-sampling however, often done at the same time.  That's a different process which converts from one sample-rate to another. Typically converting a 48kHz or 96kHz file to 44.1Khz.  That's a more calculation intense type of conversion, and any artifacts from that conversion can potentially manifest throughout the entire frequency range rather than only effecting the very quietest portions.  For that reason, I suspect using higher quality re-sampling routine may be more important than using fancy dither, as long as your machine can handle the processing load.
Title: Re: Measure max\average amplitude?
Post by: StarkRavingCalm on July 17, 2015, 02:11:43 PM
Ok, so I have a few more questions.

It's either my poor math skills, or me not understanding Master Fader, or something else...


(hypothetical)
So I have a file that has been imported into a audio project
Say it is:
      Overall     Left      Right
Pk lev dB       -12.50      -12.50    -12.50


I raise "channel 1/2" to 12.0 db (the max)
I then set my MF to -1.5db

Shouldnt my resulting file be -2.00 db?


How is it calculated if there is say, "channel 3/4" and/or "channel 5/6"?



Basically, my "mix and master method" is:

Bring SBD to 0db
Bring AUD mics up to where I like the sound
Mix them down into one file where the resulting file is -2db (mainly to give headroom)

Or if straight AUD:

Bring AUD to 0db
Mix it down into one file where the resulting file is -2db (mainly to give headroom)
Title: Re: Measure max\average amplitude?
Post by: bombdiggity on July 17, 2015, 02:33:05 PM
Ok, so I have a few more questions.

It's either my poor math skills, or me not understanding Master Fader, or something else...


(hypothetical)
So I have a file that has been imported into a audio project
Say it is:
      Overall     Left      Right
Pk lev dB       -12.50      -12.50    -12.50


I raise "channel 1/2" to 12.0 db (the max)
I then set my MF to -1.5db

Shouldnt my resulting file be -2.00 db?


How is it calculated if there is say, "channel 3/4" and/or "channel 5/6"?


I suspect your MF overides the individual channel applications, so if MF is set to max -1.5 then -1.5 is what you get regardless of what else you did at the same time (or prior to it). 

Basically, my "mix and master method" is:

Bring SBD to 0db
Bring AUD mics up to where I like the sound
Mix them down into one file where the resulting file is -2db (mainly to give headroom)

Or if straight AUD:

Bring AUD to 0db
Mix it down into one file where the resulting file is -2db (mainly to give headroom)

There's no reason to leave -2db "headroom" in mastering if the final output is really -2db.  You need some headroom for recording since you can't fully predict the ultimate levels in an evolving live performance.  Once it's all committed to a recording there's no reason for headroom anymore.  You don't want to to all the way to 0 since that is the clip point but you are fine going to -.25 or -.2 or -.1.  I usually master to -.1. 

Limiting to -2 leaves basically 2 db of potential range completely unused.  2db you will hear as significantly quieter, though the difference between .2db and 0db isn't really noticeable. 
Title: Re: Measure max\average amplitude?
Post by: StarkRavingCalm on July 17, 2015, 03:29:38 PM
Ok, so I can adjust to .2db

But I am still a little confused as the role MF plays as it doesnt always seem to limit the levels.
In other words, my resulting files are not always equal to what the MF is set at.
Title: Re: Measure max\average amplitude?
Post by: Gutbucket on July 17, 2015, 03:41:09 PM
The -1.5dB indication on the masterbus fader is the gain applied at that point- which is simply a relative measure of the gain change it is providing at that stage.  Since the program is operating internally with floating-point math, that relative level change may or may not be appropriate for preventing overs in the fixed, lower bit-depth file output.

Process depends somewhat on the software you are using.  Most modern Digital Audio Workstation software works with floating-point mathmatics, which means you typically needn't worry about internal headroom or clipping within the software, only on it's way in or out of the DAW.  Typically you will have control over the signal level of each individual mono channel or stereo channel as well as separate level control over the 2-channel mix bus (maybe called the master bus).  Since the program itself is working internally with higher floating-point bit-depth math, you don't really need to normalize the individual parts to be mixed, although doing so may can help manage things for you.  What is more important is making sure that the final output level from the master bus is the correct level- not to high, not to low, but just right Goldilocks. 

Basically, my "mix and master method" is:

Bring SBD to 0db
Bring AUD mics up to where I like the sound
Mix them down into one file where the resulting file is -2db (mainly to give headroom)

Or if straight AUD:

Bring AUD to 0db
Mix it down into one file where the resulting file is -2db (mainly to give headroom)

Just a reminder that the most appropriate "mix and master method" depends on the qualities of both your AUD source and SBD source.  With a really good AUD, you'll probably do best with a lot more AUD than SBD in your matrix.  Usually some SBD will be beneficial for even a fantastic AUD, but with a really good AUD often very little SBD is necessary- just enough to bring up whatever elements may be a bit low in the AUD, and to crisp-up vocal clarity and transients and bring those elements forward a bit to make then more immediate and engaging rather than soft and distant sounding.  That's favoring the stew to taste by adding enough SBD spice to the base stock AUD.

If the SBD is better than the AUD then doing it other way around lie you mention may be more more appropriate- adding just enough AUD to bring the dry but better sounding SBD to life, with the AUD's room and audience contribution rounding things out.  In that case you're adding enough AUD spice to the SBD base stock to taste.

So, no hard rule concerning which component should be higher in level or normalized first, play that part by ear.  Just check to make sure that the final output bus level is where you want it before writing the output files.
Title: Re: Measure max\average amplitude?
Post by: StarkRavingCalm on July 17, 2015, 04:49:56 PM
Understood.


So I guess it's me not understanding the math of how we end up at a certain db level, especially when I am running 4 or 6 channels and a MF as well.
Title: Re: Measure max\average amplitude?
Post by: Gutbucket on July 17, 2015, 05:34:59 PM
You should to check the level out of the master in an absolute sense, relative to 0dbfs (indicated via the master buss meters, and/or 'over' indicators). 

The levels up to that point within the mixing software are all relative to each other.  That includes the gain applied by of the master fader.  The output gain indicated by the fader position (or any numeric indication of the fader gain) is relative to the input level of signal to that fader, not relative to 0dBfs which is absolute.
Title: Re: Measure max\average amplitude?
Post by: morst on July 27, 2015, 06:00:50 PM
So I guess it's me not understanding the math of how we end up at a certain db level, especially when I am running 4 or 6 channels and a MF as well.
I hope the following addresses the question: Please if someone could confirm my math- my impression is that summing two identical signals together will increase their peaks by +3 dB. Adding four together would increase peaks by +6dB.

So if you have a two-source mix that peaks at -3dB on each source, they should add up to approximately no more than -0dB when the peaks line up, and lower in all other spots. If you had two source recordings that peaked at -0dB, you could set each of them to -3dB and theoretically avoid any "overlevel" samples. Likewise (I think) you can take 4 channels at -0dB, and set each of their faders to -6dB and your output should wind up under -0dB.

Now, if you add a fudge factor of a .1dB, and drop two sources, say, -3.1dB, then I think they should peak out at -0.1dB for the sum.

Other things to note are that if the peaks don't line up perfectly (since we have two very different sources, SBD & AUD, right?) then you might be able to run all sources at -0dB (full scale) and they won't peak higher than -0.0dB anyhow!? I've seen it happen!