Fitting for an envelope curve

Duplicate of Obtaining an envelope curve