Log in

View Full Version : Microphone recording -> range compression


Rash
20th May 2015, 17:50
Hello guys. I have been reading the other topics here related to dynamic range compression and automatic level control, specially tebasuna51's amazing experience with this. I just would like to get some more tips if possible for my very specific application.

I have audio files recorded from a microphone that is placed on a fixed location in a room. People talk in the room from different distances to the microphone (like a meeting) and I would like to make them all sound at relatively the same volume.

I can only use ffmpeg and whatever tools ffmpeg have so I was playing with the compand's filter. However, I am not exactly sure how the transfer points work. Do they apply a relative gain on their range or is it a fixed gain? Let me explain. If I set -70,-35, I know it will apply a gain of 35dB to -70 samples and make them sound like -35dB. But what about -65? Will it also apply a 35dB gain making it sound like -30 or does it apply a relative gain? So at a 1:2 ratio the -65 would sound like -32.5db?

-75,-35,-20,-20 is:
-75 | -35
-55 | -25
-45 | -15
-25 | 0 (clipping)
-20 | -20
-15 | -15
0 | 0

Or -75,-35,-20,-20 is:
-75 | -35
-55 | -27.5
-45 | -22.5
-25 | -12.5
-20 | -20
-15 | -15
0 | 0

I have been playing with compand's points, but I couldn't come up with good values myself. Moreover, do I need to know exactly the volume ranges of each person in the room to make good guesses on transfer points? Or do you think it is possible to come up with a transfer function that works for all my recordings? Thank you!

hello_hello
20th May 2015, 20:20
You're really restricted to ffmpeg? It'd be a pity if you couldn't at least try Levelator (http://web.archive.org/web/20130729204551id_/http://www.conversationsnetwork.org/levelator/)

There's several utilities for levelling out the volume. There's a thread dedicated to one here (http://forum.doom9.org/showthread.php?t=170980) and within it are a few links to similar utilities.

pandy
21st May 2015, 12:27
I have been playing with compand's points, but I couldn't come up with good values myself. Moreover, do I need to know exactly the volume ranges of each person in the room to make good guesses on transfer points? Or do you think it is possible to come up with a transfer function that works for all my recordings? Thank you!

I use something like this in ffmpeg:

compand=0.1|0.1:0.60|0.60:-76/-999|-60/-30|-30/-20|-20/-15|-9.309/-6.0206|0/-3.103:6:%ngain%:-90:0.6

This is heavy compression with some clipping protection, %ngain% usually in my case is equal to -6.0206 ( this is for preemphasis i use - highpass filter with +6dB gain and frequency samplerate/4 but it may be not OK for your needs - good luck

btw i'm not author for this trick

Rash
21st May 2015, 20:52
Thank you so much for the reply guys. I have been doing my tests as well and I believe I might have found a way out with compand. I haven't figured all the parameters yet (such as what do I use for soft-knee and a sweetspot to decay), but at least I do get a "normalized" audio on the output. This is my current compand filter (note, this is at ffmpeg filter order):

compand=.1:.2:-90/-900|-72.1/-12.1|-60.1/-12.1|-48.1/-12.1|-36.1/-12.1|-24.1/-12.1|-12/-12:.01:0:-90:.1

It has a completely mute noise gate at the beginning (which I love) and then it brings several 12dB sections to 12dB volume range. I've also tried adding some clipping protection but I believe it isn't perfect yet.

Moving forward, I want to try bringing the individual audio sections to -24->-12 range instead (and leave -12->0 untouched) or maybe do a broader range such as 24dB instead of 12dB. I'm also thinking about using 13dB instead of 12.1dB, which I believe may bring an overall better sound quality with a practically imperceivable volume change.