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: Peak normalization when trascoding (Read 6343 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Peak normalization when trascoding

I would like to apply album-based peak normalization when transcoding from FLAC to MP3 for my portable player.

I am aware of the difference between peak and loudness normalization: as a matter of fact my FLAC files are already tagged with ReplayGain infos, as I rely on them when listening at home and I would not consider to alter the files with peak normalization.

Anyway when it come to my portable player(s) my main concern is not perceived loudness; instead my concern is about not enough power to drive my earplugs, especially with 24bit vinyl album rips with a very low album peak. And since I am transcoding from FLAC to MP3 I would have no problem about applying album-based peak normalization at this stage, preserving the original album dynamics.

Again: I do want loudness (ReplayGain) normalization; I want to squeeze as much volume as possible from the limited amp of my portable player. I am more than willing to turn the volume down if the perceived loudness would turn out to be too high.

It would be a plus if the solution could be foobar based

thank you

Peak normalization when trascoding

Reply #1
And since I am transcoding from FLAC to MP3 I would have no problem about applying album-based peak normalization at this stage, preserving the original album dynamics.

Again: I do want loudness (ReplayGain) normalization

You’re asking for something that comprises two premises that are opposed to each other. Album-based RG ? peak normalisation. RG is targeted at perceived loudness, not peaks, which could be huge outliers when compared to the rest of the track.

But… you can fool fb2k’s RG scanner into applying track-based peak normalisation using a method that I figured out a couple of days ago, and I would like to assume the same hack will work for album RG.

Peak normalization when trascoding

Reply #2
You’re asking for something that comprises two premises that are opposed to each other.
No, I bet that was a typo. "I do want loudness (ReplayGain) normalization" was suppose to be "I don't want loudness (ReplayGain) normalization".

Applying album gain with clipping prevention with the pre-amp maxed out to +20dB gives you what you want (that's what db1989 explains in the other thread) - unless the peak after RG album was below -20dBFS (unlikely).

Cheers,
David.

Peak normalization when trascoding

Reply #3
I would like to apply album-based peak normalization when transcoding from FLAC to MP3 for my portable player.

...And since I am transcoding from FLAC to MP3 I would have no problem about applying album-based peak normalization at this stage, preserving the original album dynamics.

Again: I do want loudness (ReplayGain) normalization; I want to squeeze as much volume as possible from the limited amp of my portable player. I am more than willing to turn the volume down if the perceived loudness would turn out to be too high.


I think that he wants ReplayGain normalization and db1989 method is the best in my opinion.

What I do in my case is applying vlevel in the DSP chain when converting to AAC if I use my phone but I only do this on chip music or MIDI converted to adl/opl synth, to have a good level and even compression and to not burn my ears if it peaks also.

Peak normalization when trascoding

Reply #4
This thread made me implement peak normalization in caudec SVN. It uses Replaygain metadata, and it can do it by album (caudec -G albumpeak) or by track (caudec -G trackpeak). Example:

Code: [Select]
$ caudec -g *.flac # compute Replaygain on the FLACs
$ caudec -c mp3 -G albumpeak *.flac # decode FLACs, peak normalize by album, encode to MP3


It works on existing MP3 and AAC files as well:

Code: [Select]
$ caudec -G albumpeak *.mp3

Peak normalization when trascoding

Reply #5
I would like to apply album-based peak normalization when transcoding from FLAC to MP3 for my portable player.


I would not recommend this, but if you do, make sure the peak is relatively low.  -3 or 4 dB would be best, otherwise you will get some distortion. 

Peak normalization when trascoding

Reply #6
I would not recommend this, but if you do, make sure the peak is relatively low.  -3 or 4 dB would be best, otherwise you will get some distortion.


Are you referring to lossy-induced clipping from peaks at 0dBFS (in the source)?

Peak normalization when trascoding

Reply #7
thank you, exactly what I was looking for. Good to know my typos didn't stop the solution :-)

Peak normalization when trascoding

Reply #8
I have yet to hear definitively that lossy-induced clipping is audible, i.e.that there is no audible clipping before encoding, but it is audible after.

Peak normalization when trascoding

Reply #9
Is it possible, to get Replaygain volume offset calculated, and also know that if you play back the music on a receiver which is calibrated, that the reference relative number, will never exceed the loudness being displayed by the receiver?

Somewhat like the clipping prevention feature?

Peak normalization when trascoding

Reply #10
No.

First, the algorithm provides for levels to go beyond the reference level.  Second, there will always be some combibation of source material/listener for which the algorithm will not work as intended.

Peak normalization when trascoding

Reply #11
I've normalized a lot of albums with foobar using "apply gain and prevent clipping according to peak", source mode: album, preamp with RG info +20.0dB.

Mostly they are vinyl rips at 24bit 96kHz with low album peak, and I'm applying this normalization when transcoding to MP3 CBR 320kbps or FLAC 16bit (dithered) 48kHz. As I wrote before I do this just to squeeze enough volume from the DAP amp for my hard-to-drive earphones.

I've noticed that while FLAC transcodes never peak above 1.0, MP3 transcodes do peak over 1.0 (e.g. 1.009), even if I cannot notice any evident distortion when listening.

Anyone able to clarify? Are these the non-audible "lossy-induced clipping" referred above?

btw I'm using LAME3.99r and reference libFLAC 1.3.0 20130526

Peak normalization when trascoding

Reply #12
FLAC is lossless. What comes out is exactly what goes in.

Mp3 is lossy. What comes out is only approximately what goes in, so peaks can be larger than in the original.

Peak normalization when trascoding

Reply #13
Quote
I've noticed that while FLAC transcodes never peak above 1.0, MP3 transcodes do peak over 1.0 (e.g. 1.009...
FLAC is an integer format.  It simply cannot go over 0dBFS (Like "regular" WAV files.)  0dBFS is defined as the biggest number* you can get with a given number of bits.    (Then, it is scaled by the DAC or driver, so that a 0dB 24-bit signal is the same loudness as a 0dB 8-bit signal.)

MP3 can go over 0dB without clipping.  It will only clip if your MP3 decoder decodes to integer, or if you send the decoded data full-scale (without digital volume reduction) to a DAC.  (DACs are integer.)

Quote
....even if I cannot notice any evident distortion when listening.

Anyone able to clarify? Are these the non-audible "lossy-induced clipping" referred above?
I believe so.  I've never heard of a case where an audible MP3 compression artifact became inaudible at a reduced encoding level.



* When you write "1.0" (or 100%), that's a floating-point representation.  It's not what you see in a regular (integer) WAV file.  For example, 16-bit WAV files hold values between -32,768 and +32,767.  A waveform with those positive & negative peaks would have 0dB peaks.    In a 32-bit floating-point WAV file, a 0dB peak is represented with a numerical value of 1.0.