CalcWorldHub
Free online calculator · no signup

Attack release peak envelope follower calculator

Track amplitude changes with separate rise and fall smoothing for an audio or sensor level detector.

4,000 tools
Attack release peak envelope follower calculator — Uniform samples (signal units), Sampling frequency (Hz), Attack time constant (ms) and calculation method
Attack release peak envelope follower calculator: inputs and calculation method.

How to use this calculator

Track amplitude changes with separate rise and fall smoothing for an audio or sensor level detector.

  1. Enter Uniform samples (signal units), Sampling frequency (Hz), Attack time constant (ms), Release time constant (ms), then complete the remaining labeled fields. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Attack release peak envelope follower explained

Final detected envelope0.8392signal units
Final detected envelope: 0.839194 signal units in the worked scenario.

How the calculation works

e[n]=α e[n−1]+(1−α)|x[n]|, α=exp(−1/(fs τ)); choose τattack when |x[n]|>e[n−1], else τrelease.

Times are exponential time constants, not a promise to reach the target completely in that interval. Branch selection uses the previous envelope state.

Set up the calculation

x — Uniform samples (signal units)
Chronological real samples; use a comma-separated list in the same signal units. Use comma-separated values in the stated order.
fs — Sampling frequency (Hz)
Uniform samples per second; must be positive.
attack — Attack time constant (ms)
Positive exponential time constant for rising absolute level.
release — Release time constant (ms)
Positive exponential time constant for falling level.
initial — Initial envelope level
Nonnegative detector state before the first sample.

Limits of this model

This is an absolute-value peak follower, not an RMS detector, analytic-signal envelope or loudness meter.

Check this example

Uniform samples (signal units) = [0, 1, 0.2, 2, 0.1, 0, 0, 0]; Sampling frequency (Hz) = 1000; Attack time constant (ms) = 2; Release time constant (ms) = 20; Initial envelope level = 0.

  • Final detected envelope: 0.839194 signal units
  • Maximum detected envelope: 1.019867 signal units
  • Envelope sample 0: 0 signal units
  • Envelope sample 1: 0.393469 signal units
  • Envelope sample 2: 0.384034 signal units
  • Envelope sample 3: 1.019867 signal units
  • Envelope sample 4: 0.975004 signal units
  • Envelope sample 5: 0.927453 signal units
  • Envelope sample 6: 0.882221 signal units
  • Envelope sample 7: 0.839194 signal units

A record containing peaks one and two uses a fast 2 ms attack and slower 20 ms release at a 1 kHz sample rate.

Reading the outputs

All envelope samples are nonnegative; the maximum detector output can be below the largest input peak because attack is finite.

Frequently asked questions

Will it capture a one-sample peak exactly?

Usually not; a finite attack smooths that peak.

What fraction is reached after one time constant?

For a fixed new target, about 63.2 percent of the remaining difference.

Can release be faster than attack?

Yes. The two positive constants are independently specified.

How do I use the Attack release peak envelope follower calculator?

Enter Uniform samples (signal units), Sampling frequency (Hz), Attack time constant (ms), Release time constant (ms), then complete the remaining labeled fields. Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Attack release peak envelope follower?

Uniform samples (signal units) = [0, 1, 0.2, 2, 0.1, 0, 0, 0]; Sampling frequency (Hz) = 1000; Attack time constant (ms) = 2; Release time constant (ms) = 20; Initial envelope level = 0.