Peak Controller: improve envelope calculation