An extension of the Karhunen-Loève decomposition (KLD) specifically aimed at the evaluation of the natural modes of -dimensional structures having nonhomogeneous density is presented. The KLD (also known as proper orthogonal decomposition) is a numerical method to obtain an “optimal” basis, capable of extracting from a data ensemble the maximum energy content. The extension under consideration consists of modifying the Hilbert space that embeds the formulation so as to have an inner product with a weight equal to the density. This yields a modified Karhunen-Loève integral operator, whose kernel is represented by the time-averaged autocorrelation tensor of the ensemble of data multiplied by the density function. The basis functions are obtained as the eigenfunctions of this operator; the corresponding eigenvalues represent the Hilbert-space-norm energy associated with each eigenfunction in the phenomenon analyzed. It is shown under what conditions the eigenfunctions, obtained using the proposed extension of the KLD, coincide with the natural modes of vibration of the structure (linear normal modes). An efficient numerical procedure for the implementation of the method is also presented.