Page 1 of 1

Compressor Peak Detector Design

PostPosted: Mon Nov 14, 2016 10:58 am
by OllieMarshall92
.

Re: Compressor Peak Detector Design

PostPosted: Mon Nov 14, 2016 7:02 pm
by martinvicanek
Hi Ollie,

the generic formula for a one-pole filter coefficient a is

a = exp[-1/(t*Fs)]

where t is the attack or release time (in seconds) and Fs is the sample rate (in cycles per second). You want to have separate control of attack and release, so you would have two time constants denoted by tA and tR, say, and two filter coefficents given by

aA = exp[-1/(tA*Fs)]

aR = exp[-1/(tR*Fs)]

You set the values of tA and tR using sliders (as opposed to your code example, where you set t = 1 - 1/e). In the simplest case, you can configure the attack slider range to go from tAmin to tAmax (and accordingly for the release) and use its output directly.

That, however, may not be the best choice, refer to http://flowstone.guru/blog/mapping-of-c ... arameters/

Re: Compressor Peak Detector Design

PostPosted: Tue Nov 15, 2016 9:46 am
by OllieMarshall92
Hi martinvicanek,

Thanks for the reply, I will start with what you have suggested then look at mapping them so they feel right.

Cheers!

Ollie

Re: Compressor Peak Detector Design

PostPosted: Wed Nov 23, 2016 3:31 pm
by Rocko
Hi,

I also invite you to look up my 'K5' compressor and explanation. It is RMS based but it provides an answer to your question:

http://www.dsprobotics.com/support/viewtopic.php?f=3&t=5895