[pulseaudio-discuss] selective sound amplification by frequency @ PulseAudio.

Tanu Kaskinen tanuk at iki.fi
Tue Jan 8 15:04:43 PST 2008


On Tue, Jan 08, 2008 at 09:08:46PM +0100, Adam Sulmicki wrote:
> Hello,
> 
> I was wondering. Is there some way to do the following in PulseAudio:
> 
> SELECTIVE SOUND AMPLIFICATION BASED ON SOUND FREQUENCY.

Yes, PulseAudio can do equalization (which is the
established term for this), with help from some appropriate
LADSPA plugin. Documentation for loading LADSPA plugins to
the pulse server by editing default.pa (located in
/etc/pulse/ or ~/.pulse/) is available here:

http://www.pulseaudio.org/wiki/Modules#module-ladspa-sink

If you aren't familiar with doing manual pulse
configuration, feel free to ask further questions. Also, as
pointed out in the module documentation, experimenting with
different parameter values isn't necessarily exactly easy.

If all you want to do is to do amplification as shown in the
link you provided, it's easier, just use the same plugin as
in the example (mbeq) and assign appropriate amplification
values to the control values. The 15 numbers mean
amplifications in decibels, and map to the following
frequencies:

50 Hz and less
100 Hz
156 Hz
220 Hz
311 Hz
440 Hz
622 Hz
880 Hz
1250 Hz
1750 Hz
2500 Hz
3500 Hz
5000 Hz
10000 Hz
20000 Hz

There's one more thing adding complexity. Digital
amplification may cause distortion to the signal, if the
input is already maximally loud (which is the usual
situation). Therefore I recommend adding this line to
default.pa:

    load-module module-match

and then create file ~/.pulse/match.table with the following
line:

    .* 32000

As can be read from the same Modules page I already linked,
module-match sets playback streams' volumes automatically.
This particular line in match.table causes the volume to be
set to about 50% (the volume value range is 0-65535). 40dB
is quite a lot of amplifying, so if it still causes
distortion, lower this value further.

You mentioned that overall 10dB amplification on top of the
frequency-specific amplification would be desirable (like
the diagram showed). That can of course be accomplished by
turning the knob on the speakers :) Assuming that they have
one, that is...

> Can this be done on PC under Linux? without using DSP? I tried to Google for
> this but I got no useful hits.

The example I linked is from my own default.pa, and I use it
all the time. This is a PC machine and I'm running Linux, so
yes, it can be done. By DSP I assume you mean a separate DSP
card (or some ultra fancy sound card) - a DSP card isn't
required, equalizing doesn't eat CPU power awfully much.

Hope this helps.

-- 
Tanu Kaskinen



More information about the pulseaudio-discuss mailing list