To optimize the number, spacing and excitation of nonuniform linear array at the same time, a Fourier basis filter diagonalization method (FFDM) is proposed in this paper. By constructing a set of Hamiltonian operator functions that can be decomposed by orthogonal eigenvectors, the synthesis of nonuniform linear arrays is transformed into a generalized eigenvalue decomposition under Fourier basis. The introduction of Fourier basis can improve the computational rate. The least square method (LSM) is used to solve the array element excitation, which improves the matching accuracy. A number of numerical simulations shown that the proposed algorithm can improve the accuracy of the array factor (AF) pattern of many types of practical arrays reconstruction.