Compressor Peak Detector Design

DSP related issues, mathematics, processing and techniques
Post Reply
OllieMarshall92
Posts: 16
Joined: Wed Oct 26, 2011 12:22 pm

Compressor Peak Detector Design

Post by OllieMarshall92 »

.
Last edited by OllieMarshall92 on Mon Jul 24, 2017 12:43 pm, edited 2 times in total.
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Compressor Peak Detector Design

Post 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/
OllieMarshall92
Posts: 16
Joined: Wed Oct 26, 2011 12:22 pm

Re: Compressor Peak Detector Design

Post 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
Rocko
Posts: 186
Joined: Tue May 15, 2012 12:42 pm

Re: Compressor Peak Detector Design

Post 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
Post Reply