We present a method to maximize the separation of two adjacent eigenfrequencies in structures with two material components. The method is based on finite element analysis and topology optimization where an iterative algorithm is used to find the optimal distribution of the materials. Results are presented for vibration problems governed by the 1D and 2D scalar wave equations. Two different objectives are used in the optimization; the difference between two adjacent eigenfrequencies and the ratio between the squared eigenfrequencies. In the 1D case we use simple interpolation of material parameters but in the 2D case the use of a more involved interpolation is needed, and results obtained with a new interpolation function are shown. In the 2D case the objective is reformulated into a double bound formulation due to the complication from multiple eigenfrequencies. It is shown that some general conclusions can be drawn that relate the material parameters to the obtainable objective values and the optimized designs.