Thanks for all the input, everyone. Just to follow up on the original question. In the end the compressor built into SoX satisfied my needs for scripted processing of audio signals. In particular, it was able to handle really fast attack times and remain surprisingly transparent.
On Thu, Jul 17, 2014 at 10:06 AM, robert bristow-johnson < [email protected]> wrote: > On 7/16/14 2:05 PM, Theo Verelst wrote: > > robert bristow-johnson wrote: > >> ... > >> > >> { x x - x0 < -4b/(1-r) > >> { > >> f(x) = { x - b*(1 + (1-r)/(4b)*(x-x0))^2 |x - x0| < 4b/(1-r) > >> { > >> { x0 + r*(x-x0) x - x0 > 4b/(1-r) > >> > >> ... > > > > Always interesting to figure out what the residual harmonic distortion > > for (all/some) frequencies are at various drive amplitudes around x0. > > > > Also, when the compressor starts to work, probably with some nice > > filter to smooth its operations, harmonics will be generated. > > sure, as you kick into the non-linear part (when x > x0 - 4b/(1-r)), > there is the potential for harmonic distortion. even with a good LPF on > the envelope follower (that "x" is derived from), *some* of the > waveshape (or |waveshape| or |waveshape|^2) will make it through the > LPF, then through the g(x) mapping (which is f(x)-x), so some of the > gain function multiplying your input samples will have some of the > original waveshape wiggling that gain, and just that will cause some > harmonic distortion. > > > An inversion of the chosen compression behavior could be interesting, > > as well as the idea that during a fast attack that makes the > > compressor kick in, the accuracy of the amplitude sensor, and the > > chosen filter accuracy will probably suggest a high sampling frequency > > to make sure the behavior of the compressor is compression as in the > > analog domain is popular, instead of a nearly static transient mangle > > as so often is the effect of digital ones. > > although f(x) is perfectly invertible, and the log and exp functions > going into the "x" domain are invertible, and maybe even the filtering > functions are invertible (but they don't need to be, e.g. a peak > envelope following filter has some non-linearity in it), i think > inverting the entire compressor precisely for each sample would be quite > difficult even allowing for delay. probably not possible, but i won't > say that for certain. > > > -- > > r b-j [email protected] > > "Imagination is more important than knowledge." > > > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, > dsp links > http://music.columbia.edu/cmc/music-dsp > http://music.columbia.edu/mailman/listinfo/music-dsp > -- Reid Oda Ph.D. Candidate Princeton University 858-349-2037 http://www.cs.princeton.edu/~roda -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://music.columbia.edu/cmc/music-dsp http://music.columbia.edu/mailman/listinfo/music-dsp
