RokketBox
Engineering5 min read

Latin Hypercube Sampling: Why We Don't Use Brute Force

How quasi-random sampling explores a design space more efficiently than grid search — and why that matters for subwoofer optimization.

Contents

Optimising a subwoofer enclosure means searching a multi-dimensional space: box volume, tuning frequency, port width, port height, box length, box width and box height. Even with just those seven parameters, a brute-force grid search quickly becomes impractical.

This post explains why RokketBox uses Latin hypercube sampling (LHS) instead, how the refinement pass works, and why gradient methods don't suit this problem.

The grid search problem

A Cartesian grid search divides each parameter into evenly spaced steps and evaluates every combination. The number of combinations grows exponentially with each parameter you add. This is the curse of dimensionality.

With seven tuneable parameters, even a modest grid produces hundreds of thousands of combinations. Running a full circuit-domain simulation at each point is far too slow for interactive use, and wasteful, because most of the grid explores regions that are clearly suboptimal. Coarser grids are faster but miss good solutions that fall between the steps.

What Latin hypercube sampling is

LHS is a quasi-random sampling method that covers a multi-dimensional space well with far fewer samples than a grid search.

  1. Divide each parameter's range into N equal intervals.
  2. Place exactly one sample in each interval for each parameter.
  3. Pair the intervals across parameters at random.

Every parameter's range is covered uniformly, with no gaps or clusters along any single axis, while the multi-dimensional space is explored efficiently. Think of a Sudoku puzzle: in a Latin square, each row and column contains exactly one of each value. LHS extends this idea to N dimensions.

With a fraction of the samples, LHS outperforms a much denser Cartesian grid:

Better space-filling

A grid concentrates samples on the grid lines and leaves large regions unexplored between them. LHS distributes samples throughout the space, so there are no systematic gaps.

No aliasing

Grid search can miss optima that fall between grid points. If the optimal tuning frequency is 31.5 Hz but the grid only evaluates 30 and 33, the optimum is invisible. LHS's quasi-random spacing makes any particular value equally likely to be sampled.

Fewer evaluations

LHS achieves comparable coverage to a grid an order of magnitude larger, because it doesn't waste samples on the combinatorial explosion of axis-aligned points.

Room to refine

With the broad search finishing quickly, there's budget for a focused second pass in the most promising regions. You get the precision of a fine grid with the exploration efficiency of random sampling.

The refinement pass

After the initial LHS sweep, RokketBox narrows the search space around the most promising candidates and runs a more focused evaluation. The broad sweep has already eliminated the vast majority of the design space, so this refinement can be much more precise without being expensive.

Multi-objective scoring

LHS suits multi-objective optimization because it produces a diverse set of solutions across the parameter space. Instead of a single "best" answer, you get a population of good solutions that trade off different objectives: maximum output, flat response, deep extension or overall balance.

RokketBox's weight presets tell the optimizer what matters to you. Each preset scores the same simulation outputs (SPL, excursion, port velocity, group delay) with different priorities. The LHS population naturally includes solutions that excel at different trade-offs, and the scoring selects the best one for your chosen goal.

Why gradient-based optimization is a poor fit

Classical algorithms (gradient descent, Newton's method) are efficient for smooth, differentiable functions. Subwoofer optimization has three features that break that assumption:

  • Port routing discontinuities. A port configuration that fits at one set of dimensions might not fit at slightly different dimensions. The feasibility boundary is a step change, with no smooth slope.
  • Discrete choices. Port type (round, slot, kerfed), number of folds (0, 1, 2) and material thickness are discrete parameters, and gradient methods need continuous spaces.
  • Noisy objective space. The scoring function combines multiple physical metrics with different units and scales, and it has many local optima.

LHS handles all of these because it makes no assumptions about the objective's shape. It samples broadly and ranks.

The bottom line

RokketBox's optimizer completes in seconds on modern hardware. The broad LHS sweep followed by focused refinement finds well-optimised enclosure designs faster and more reliably than brute-force search, and you don't need to understand any of the maths behind it.

Common questions

What is Latin hypercube sampling in subwoofer optimization?

Latin hypercube sampling (LHS) is a quasi-random method that efficiently explores multi-dimensional design spaces. Each parameter range is divided into intervals with exactly one sample per interval, providing uniform coverage without the computational cost of a full grid search. It achieves comparable coverage with a fraction of the evaluations.

Why is brute-force grid search impractical for subwoofer optimization?

A subwoofer design has many tuneable parameters (volume, tuning, port dimensions, box ratios). The number of grid combinations grows exponentially with each parameter, quickly reaching hundreds of thousands of evaluations. LHS achieves comparable coverage with an order of magnitude fewer samples and avoids the aliasing problem where optima fall between grid points.

How does RokketBox find the optimal subwoofer design?

RokketBox uses a multi-stage approach: a broad quasi-random sweep efficiently explores the design space, then a focused refinement pass around the top candidates finds precise optima. Multi-objective scoring ranks each design against your chosen priority. The full process completes in seconds.

lhsoptimizationlatin-hypercubegrid-searchengineeringrokketbox

Related posts