Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: SoX - norm in combination with G (Read 2949 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

SoX - norm in combination with G

Hello, I would like to know how "norm" and "G" work together.

Let's say I use:
$ sox -G --norm=3 input.wav output.wav

Let's say that input.wav exceeds 0dB with a boost of 3dB.
Will -G prevent that? In other words, which option overrules which?

Thank you very much for help everybody!

SoX - norm in combination with G

Reply #1
I don't know but I think those two commands conflict so why would you do it?

SoX - norm in combination with G

Reply #2
Hello and thanks for your answer.
I have a bunch of wave files (digitisations from analogue tapes) that, for a number of reasons, were recorded with what would be generally considered a "low" level (ie, most dynamics range between -15 and -9dBFS).
If I normalised these files to 0, I would end with a very loud background noise. I don't want this.
So I need to give them all a little boost, which I cannot quantify in 3, 4 or 5 or whatever for all.
So I thought that if I go for an average value, say 3, I can achieve my goal with most files -- yet I thought that -G would keep me safe in the case of those few files which *may* clip with a boost of +3.

I hope it's clearer now 
Anyway, I always like to learn things. The fact that I may not need to use some options still has me curious to answer the theoretical question 

Thanks.

SoX - norm in combination with G

Reply #3
Quote
So I thought that if I go for an average value, say 3, I can achieve my goal with most files -- yet I thought that -G would keep me safe in the case of those few files which *may* clip with a boost of +3.
With norm=+3 it will clip every single time! *     If you normalize to 0dB or less it will not clip.  (Except if the waveform is already clipped, normalizing below 0dB won't repair the damage.  Or, you can clip if you normalize and then do some other processing that boosts the level.)

norm sets a target-peak level.  i.e. You normalize to a dB level, not by a dB level.    It scans the file to find the current peak and then adjusts the level up or down as required to hit the new target peak.  0dB is the "digital maximum" and if you normalize to 0dB your file will be "maximized".

You might want to play-around with a visual audio editor such as Audacity (FREE), even if you eventually decide to batch process with SOX.  Audacity will indicate clipping in red.    In Audacity, there is a Normalize effect or the Amplify effect will pre-scan and default to whatever gain adjustment needed for normalized 0dB peaks.


Quote
If I normalised these files to 0, I would end with a very loud background noise. I don't want this.
When you boost the volume digitally the signal-to-noise ratio doesn't change.    The signal goes up and the background noise goes up.    It's no different from turning-up the volume control during playback.  ...So, unless you intend to listen to the noisy tracks at lower volume you are not helping things by keeping the digital level down.

In case you don't know this, "loudness" does not correlate well with the peak level.    i.e. If you normalize all of your files at 0dB (generally the "digital maximum") some will still be louder than others.  Perceived loudness is more related to average or RMS and it also depends on the frequency content.  If you want to match volume/loudness you can do that by ear, or if there are too many files to do it by ear you can use ReplayGain or one of the ReplayGain related tools (such as WAVEgain or MP3gain) .




*  Some file formats can go over 0dBFS and most audio editors use floating-point for internal processing so they can go over 0dB temporarily/internally.  But, "normal" 16-bit and 24-bit WAV files, CDs, your analog-to-digital converter and digital-to-analog converter are all hard-limited to 0dB.

SoX - norm in combination with G

Reply #4
Wow, I thought that --norm=3 meant "boost by 3dB"! Thanks

As for peak vs. loudness, of course I'm aware of that.
And also about the unchanged SNR. What I meant is that, with a very low signal, most people won't hear the background noise (typical of analogue tapes) because they will listen to my files on their laptops or with cheap headphones. But if I normalise to 0, the noise is overwhelming. I don't say that it is louder than the useful signal, I know that both go up like you said. _Everything_ is just much louder. I'm sorry I can't explain better, but I've done this in the past and I know the effect very well.

I am a professional in audio preservation. Oftentimes it happens that a tape will apparently sound "worse" (more "noisy") _after_digitisation, on the performant amplification system of the studio, rather than played directly on the reel-to-reel recorder (and possibly amplified through the in-built speakers of the machine). That's because today's equipment is more accurate and less "forgiving" of the little details.

My problem is that if I normalise to 0 the digitised tapes, my clients (who are not aware of all technical aspects) will be very surprised at first and make a comment that it is very noisy.

I hope the context is a little clearer now.
As for Audacity: no, I want to do it in batch. I also know that Audacity can be scriptable in some way, but I have never tried so I just stick to SoX.

Thanks!!