A crystal (4) is provided to channel electrons or positrons of precisely defined energy. The emission of photons takes place on the basis of the effect that periodically accelerated charged particles emit electromagnetic radiation. The emitted photons are tuned to X-ray energies of desired magnitude by setting the electron or positron confinement energy. The generation of the electrons or positrons can be performed in an accelerator (2) via a collimator (3). A filter system (6) can be connected downstream of the crystal.