I would like to map the envelope of a sound (which has max dB level = dbmax, and min dB level = dbmin) from [dbmin,dbmax]
to [-inf,dbmax]
.
Here is an example :
It's like some sort of dynamic compression (or rather dynamic range 'expansion' to be precise), but here the mapping is linear from [dbmin,dbmax]
to [-inf,dbmax]
.
What's the simplest way to do this with an x[n]
array? (my input is a soundfile, not an envelope. Is there a simple method for working on envelope (envelope follower ?))
Thank you.
PS : not realtime processing. Thus I can pre-compute dbmax, dbmin.