The subject of this paper is the derivation of expressions describing envelopes of electromagnetic fields inside a 1D photonic crystal. The presented approach is based on an effective resonator model, which treats each layer of the photonic crystal as a resonant cavity. The model is analytic and allows one to derive parameters characterizing the photonic crystal and express electric and magnetic fields as their function. It is general enough to take into account defects of the crystal or even be used for an aperiodic structure. In the end of the paper, a few results are provided for the case of a source of radiation inside a photonic crystal along with a short discussion.