The high-speed flow passing through an open cavity will generate complex wave structures. The propagation and evolution of these waves can lead to the self-sustained oscillation of the cavity flow and cause strong noise. The cavity noise may contain multiple acoustic modes with discrete frequencies in the spectrum. A clear understanding of the evolution of the oscillation mode will provide a theoretical basis for the study of the noise control method. By analyzing the waves scattering process at both ends of the cavity at subsonic speed and supersonic speed and considering the three-dimensional spanwise flow, the three-dimensional wave model for subsonic cavity flow and supersonic cavity flow are established respectively. The model involves the nonlinear interaction between different waves in the cavity, which may produce other components different from the Rossiter mode. Based on the pressure signal data measured from the experiments on cavity flow for Mach numbers 0.9 and 1.5, the parameters in the model are linearly estimated. The pressure signals are analyzed by using FFT, bispectral analysis, and continuous wavelet transform. The results show that there are nonlinear interactions between the main oscillation modes, thus producing strong harmonics. The mode-switch phenomenon is observed in both the subsonic case and the supersonic case. The mode-switching exhibits low-frequency behavior and shows randomness as a whole.