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: Should I always normalize Impulse Response Samples when using them? (Read 2927 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Should I always normalize Impulse Response Samples when using them?

I came across these IRS files that can shape audio closer to the Harman curve for various headphones.

My question is should I normalize them for better effect? Or is leaving it as is the original intended effect?

ffmpeg syntax:

Code: [Select]
ffmpeg -i input.wav -i irs.wav -filter_complex "[0:0][1:0]afir=irfmt=input:irnorm=1" output.wav

irnorm accepts from -1 to 2 as values. I wonder what each of them actaully do.... Documentation says "-1" is off.

Re: Should I always normalize Impulse Response Samples when using them?

Reply #1
Sometimes IR files can be already normalized, otherwise if you know beforehand what gain IR should have, there is irgain option.
default irnorm=1 will normalize so that no clipping will ever happen with any input audio (even completely unrealistic ones like IR itself) in [-1,1] range.
If you do normalize IR or not output max volume of whole audio may be different - usually with less volume then before in case with irnorm set to >= 0, but if irnorm is set to off it will, for non-linear phase IRs, be probably much higher. So setting irnorm to some value in <1, 2] range is an attempt to reduce volume reduction while also avoiding clippings at same time.

The only way to avoid audio clippings with mix-phased IRs is to filter certain input audio in two passes, and than in second phase adjust irgain/wet gain so max output volume does not exceeds wanted target (either 1.0 or previous max peak) using volume/peak from first pass.

I can tell more if I know what exact IR file you gonna use. As they can be linear phase, mixed phase, min-phase...


Re: Should I always normalize Impulse Response Samples when using them?

Reply #3
Looking at spectrum of frequency response of IR its safe to use irnorm=-1, you might still boost output a little to reach previous peak, but that is input dependent and is doable in two-pass processing.

Re: Should I always normalize Impulse Response Samples when using them?

Reply #4
I don't think 2-pass processing is sensible here, OP wants to use headphone correction eq, this is best to do on-the-fly if possible (otherwise you'd have to re-encode everything whenever you pick a different pair of headphones? that would be bad)

Also you'd probably want to keep relative loudness across files, so if your "safe gain" is dependent on the files, strictly speaking it would need to be calculated over the whole set, and re-calculated every time you add more files to the set.

This probably means it has to be done with something other than ffmpeg. (some tools are listed on AutoEq readme; e.g. EasyEffects on Linux, EqualizerAPO on Windows, etc.)

In case of AutoEq, these impulses are pretty much equivalent to running a parametric eq with known parameters - estimating maximum peak increase is probably easier from these parameters. They also already include a global gain parameter. But I'm not sure if it's based on an estimated worst-case max peak increase, or on something that assumes "normal"/"usual" signals.

If you use it together with ReplayGain (without pushing the target level too high) and a limiter at the end, then I think this is not really worth worrying about.
a fan of AutoEq + Meier Crossfeed

Re: Should I always normalize Impulse Response Samples when using them?

Reply #5
Usually half-truths spreading again.

Re: Should I always normalize Impulse Response Samples when using them?

Reply #6
OP is using IR files, and that is done via FIR filtering/convolution.
Anything that supports libavfilter can use afir filter.
ffmpeg cli tool is irrelevant here.
libavfilter have better IIR filters than APO and similar products.
Using limiter may not always be wanted. And what limiter, there are many, from completely non-transparent to resource-hogs.

 

Re: Should I always normalize Impulse Response Samples when using them?

Reply #7
I
Looking at spectrum of frequency response of IR its safe to use irnorm=-1, you might still boost output a little to reach previous peak, but that is input dependent and is doable in two-pass processing.

I see thanks. I will go with " irnorm=-1".