# Setting Up the Optimization

Before running an optimization, some setup is required. You must consider the upper and lower limits of filter parameter values and set the optimization options.

### Filter Parameter Limits

For this tutorial, you'll use the default parameter limits for all filters. For other applications, some experimentation may be needed.

### Optimization Options

You set the optimization options by choosing Tools, Optimization Options from the main menu. A folder representing the configuration name is shown on the left of the Optimization Options dialog, with Method selected. Set the options as shown below.

This option tells MSO that you want to make the frequency response at each listening position as flat as possible. You must also tell MSO the frequency range you wish to optimize. This is done by choosing Criteria below.

MSO only optimizes the flatness of the combined sub and main speaker responses over the frequency range specified in Frequency range to optimize. Uncheck the Auto checkbox and enter 20 and 150 for the minimum and maximum frequencies respectively. Frequency range to compute reference needs some explanation. MSO optimizes response flatness by minimizing the sum of the squares of the differences in dB between the response value at each frequency and a reference value. For each listening position, the reference value may be different because of the different response curve shapes at each position. For each position, the reference value is computed by taking the average over frequency of its frequency response values in dB over the Frequency range to compute reference above. This reference frequency range should be at the high end of the frequency band, where the response is nominally constant with frequency and not affected much by the filters being used. Using a reference frequency range of 150-300 Hz is a good rule of thumb. You could think of the optimization as “lining up” the response at each listening position from 20 Hz to 150 Hz with its corresponding average response from 150 Hz to 300 Hz while also trying to make the response from 20 Hz to 150 Hz as flat as possible.

Set Run optimization for a maximum of... to 30 minutes. This seems like a long time, but the optimizer has a lot of work to do, and the problem solved by MSO has no closed-form mathematical solution. For this particular project, tach sub channel has fifteen adjustable parameters (four PEQs with three parameters each, one delay, one gain and one LPF). Considering all four channels, that's a total of sixty adjustable parameters. When running an optimization, the status is shown and you can stop it at any time. The running status and the appearance of the graph gives an idea about the best solution the optimizer has found thus far, and you can stop early if need be. When the optimization stops, either automatically or manually, you are prompted for whether you want to keep or discard the modifications made.

Next, select Group Weights in the left-hand portion of the Optimization Options dialog. Weighting allows you to “score” errors higher for, say, the MLP than the other listening positions. On the Group Weights property page, set the weights for positions 2, 3 and 4 to 0.75 as shown below.

For this weighting, an error of (1 / 0.75) dB = 1.33 dB in positions 2, 3 and 4 counts the same toward the total error as a 1 dB error at the MLP. This will tend to make the frequency response at the MLP slightly flatter than the other positions.

For now, you won't use the Target Curve option, so the project is ready for optimization.