Sound envelope is the overall amplitude rate of a sound from the moment it is generated to when it fades out. To introduce this concept we need to use a practical example. The best example is a string-instrument, once again a guitar.
When a guitarist plays a note, we perceive the note's first sound impact, and then gradually the note fades away. The rate of the amplitude of the note is called the ADSR envelope (an acronym of the words Attack, Decay, Sustain, Release), and has a behavioural pattern that can be applied to any sound and instrument.
Let's describe its 4 phases in detail:
Attack: the amplitude rapidly reaches its highest value.
Decay: after the attack, part of the initial energy is lost and the amplitude decreases.
Sustain: amplitude maintains an almost constant level for a certain amount of time.
Release: the amplitude progressively decreases until it expires.
The following is an example of ADSR envelope. The waveform of a sound is delimited by a curve that encloses the amplitude rate and which in mathematical terms is called envelope. A waveform is symmetrical, so we only need to take into account the positive part of the graph.
In the figure we have also highlighted the fact that the initial part of the sound has more high frequencies, which are the ones that effectively fade out first. Generally in the sustain phase the amplitude of high frequencies has decreased whereas low frequencies continue to be present.
This is the sound produced by the 5th string of an acoustic guitar (A) and its rate in time.
We can quite easily identify the ADSR envelope.
As we have already mentioned, this behavioural pattern can be applied to most musical instruments and sounds in general. What varies is how long the various phases last. For example a snare drum will have very short attack and decay phases. A violin on the other hand shall have far longer attack and decay phases.
Generally the attack-decay phase is the most important in terms of what characterizes a sound the most, and in fact in modern synthesis tecniques the attack-decay part is preferably a real sample of the instrument played and the sustain-release part is often synthetically produced. This has two aims: the first is to make the synthetic instrument get as close as possible to the real sound of the instrument, the second is in order to have greater control on the instrument itself. For example the simulation of a vibrato effect is very easily obtainable with a synthetic sound whereas it is a rather difficult to produce with a real sound sample.