Context. Sunspot umbrae show a change in the dominant period of their oscillations from five minutes (3.3 mHz) in the photosphere to three minutes (5.5 mHz) in the chromosphere. Aims. In this paper, we explore the two most popular models proposed to explain the three-minute oscillations: the chromospheric acoustic resonator and the propagation of waves with frequency above the cutoff value directly from lower layers. Methods. We employ numerical simulations of wave propagation from the solar interior to the corona. Waves are driven by a piston at the bottom boundary. We have performed a parametric study of the measured chromospheric power spectra in a large number of numerical simulations with differences in the driving method, the height of the transition region (or absence of transition region), the strength of the vertical magnetic field, and the value of the radiative cooling time.Results. We find that both mechanisms require the presence of waves with period in the three-minute band at the photosphere. These waves propagate upward and their amplitude increases due to the drop of the density. Their amplification is stronger than that of evanescent low-frequency waves. This effect is enough to explain the dominant period observed in chromospheric spectral lines. However, waves are partially trapped between the photosphere and the transition region, forming an acoustic resonator. This chromospheric resonant cavity strongly enhances the power in the three-minute band. Conclusions. The chromospheric acoustic resonator model and the propagation of waves in the three-minute band directly from the photosphere can explain the observed chromospheric three-minute oscillations. They are both important in different scenarios. Resonances are produced by waves trapped between the temperature minimum and the transition region. Strong magnetic fields and radiative losses remove energy from the waves inside the cavity, resulting in weaker amplitude resonances.