Three-minute oscillations are observed in the chromosphere above sunspot umbrae. One of the models used to explain these oscillations is that of a chromospheric acoustic resonator, where the cavity between the photosphere and transition region partially reflects slow magnetoacoustic waves to form resonances in the lower sunspot atmosphere. We present a phenomenological study that compares simulation results with observations. The ideal magnetohydrodynamic equations are used with a uniform vertical magnetic field and a temperature profile that models sunspot atmospheres above umbrae. The simulations are initialised with a single broadband pulse in the vertical velocity, inside the convection zone underneath the photosphere. The frequencies in the spectrum of the broadband pulse that lie below the acoustic cutoff frequency are filtered out so that frequencies equal and above the acoustic cutoff frequency resonate inside the chromospheric cavity. The chromospheric cavity resonates with approximately three-minute oscillations and is a leaky resonator, so that these oscillations generate travelling waves that propagate upward into the corona. Thus, there is no requirement that a narrowband three-minute signal is present in the photosphere to explain the narrowband three-minute oscillations in the chromosphere and corona. The oscillations in the chromospheric cavity have larger relative amplitudes (normalised to the local sound speed) than those in the corona and reproduce the intensity fluctuations of observations. Different umbral temperature pro�les lead to different peaks in the spectrum of the resonating chromospheric cavity, which can explain the frequency shift in sunspot oscillations over the solar cycle.