A tool for smoothing curves by connecting the local maxima/minima of the curve. The area between the local maximum curve and the local minimum curve is the „curve envelope“ of the input.

The macro project FBG.CurveEnvelope has a single method called OpenDialog. Running OpenDialog displays a GUI.

Fill the form and click OK to store the output curves to disk. To exit without saving anything to disk click cancel or close the form. There are three mandatory inputs.
An input file. There can be multiple input files separated by semi-colons. The user can enter the file paths directly into the text box or click on the select button to open and use the file browser. The input is not considered valid unless at least one file path is given and all input files exist. The input files have to be text files containing space delimited matrices with two columns. The two columns may have a single line header. All other lines should be number pairs. The first column must be monotonously increasing. The second column contains the evaluated function values.

An aggregation method. It can be either minimum, maximum or a both. If both methods are used, two different output curves are created.
An epsilon region. This value is tied to the concept of „local“ extreme (maximum or minimum) and determines the furthest index (in either direction) from the local extreme. All function values within this region must be smaller/larger than the local extreme. Changing the epsilon changes which points on the input curve qualify as local extrema. At epsilon equal to zero all points are considered extrema. In such case both output curves are the same as the input curve.
Before writing the envelope curve(s) to disk the user can click on the draw button to preview them in a separate window. Clicking the button again closes the preview window.