/Users/dbisig/programming/swarms/trunk/synth/trunk/code/unit/util/iso_synth_envelope_follower.h File Reference
#include "iso_synth_types.h"
#include "iso_synth_process_unit.h"
#include "iso_synth_channel.h"
#include "iso_synth_frame.h"
#include <iso_math/iso_math_includes.h>
Include dependency graph for iso_synth_envelope_follower.h:
This graph shows which files directly or indirectly include this file:
Detailed Description
This implementation of simple envelope filter. A decay parameter will let you set a decay time. This is the timespan it would take a peak value of 1 to drop down to 0, if no new peaks are found in the source signal. Most of us know this phenomena from the digital volume display of our hifi stereo.
One of the main problems with envelope follower units is the distinction between low frequencies and the actual envelope. Therefor it is advisable to prepend a highpassfilter to the EnvelopeFollowerUnit. Here is how to calculate the needed cutoff frequency:
freq_cutoff = SAMPLE_RATE_OF_ENV_FOLLOWER / PROCESS_FRAMECOUNT_OF_ENV_FOLLOWER (usually: 512/44100) = 86 Hz
to be really on the safe side, multiply this value by about 1.5 (130 Hz)
In cases where you actually need lower frequencies to be tracked, you could obmit this highpass filter and put a lowpass filter on the output of the envelope filter, set the cutoff frequency using the same formula. Keep in mind this will remove some of the ripples introduces by the low frequencies, but it will also remove the fast attacks in your envelope. The best results overall are obtained by combining a pre-highpass filter with a post-lowpass filter. But this will create an performance overhead of course. You could as well pre-calculate your envelope using a Hilbert transformation. This is not possible in real-time, because the standard frame count of 512 or even 1024 are not enough to create reliable results using Hilbert transformation.
Another usage hint: How to set the decay. Use a standard sound editor for this. Look at the signal and try to estimate the ideal decay ramp by eye. Visually extend this ramp to the point where it crosses 1 on the left side and 0 on the right side. Use these two points as markers and read the length of the selected interval. Expect it to be anywhere between 400 and 1000 miliseconds.
no ControlPorts.
SwitchPorts: name: active channelCount: n defaultValue: 1.0 resizable: false function: setActive
name: decay channelCount: n defaultValue: 0.1 (decay time in ms (!) form 1.0 to 0.0) resizable: true function setDecay
Created by John Flury on 01/03/08.
Generated on Fri Feb 25 14:18:35 2011 for synth by
1.5.1