In a klystron, an electron beam interacts with radio waves as it passes through resonant cavities, metal boxes along the length of a tube. The electron beam first passes through a cavity to which the input signal is applied. The energy of the electron beam amplifies the signal, and the amplified signal is taken from a cavity at the other end of the tube. The output signal can be coupled back into the input cavity to make an electronic oscillator to generate radio waves. The gain of klystrons can be high, 60 dB (one million) or more, with output power up to tens of megawatts, but the bandwidth is narrow, usually a few percent although it can be up to 10% in some devices.