# Graphing the response of an envelope follower

First off I want to apologize for not being very clear or technical in describing this question. I haven't had any formal DSP schooling.

It will probably be easier to explain what I'm trying to accomplish. In an audio plug-in I have a graph that displays the envelope used in a compressor. To do this currently, I create an envelope detector with the same attack and release values as the compressor and then feed it samples of 1 until it reaches the full attack time, and then feed it 0s until it almost fully decays to 0. I store the output at each sample point and use that to draw a plot. What I would like to do instead is just figure out how to graph this so that I can make use of smooth bezier curves.

Here is what it looks like currently

The detector uses a discrete function to calculate the envelope based on the gain/release constants and the previous envelope value.

T detect(T input)
{
T envIn = processInput(input);

if(_envelope < envIn)
_envelope = _envelope * _ga + (1 - _ga) * envIn;
else
_envelope = _envelope * _gr + (1 - _gr) * envIn;
return _envelope;
}


Is there a way to transform this from a discrete equation into something that can easily be graphed?

Again I apologize for not knowing how to describe this in a mathmatical way, and I hope I'm not out of place for asking for help on this.