We report on a theoretical model of the effect of coherent population trapping in alkali atoms in an optically thin gas cell with a buffer gas at a nonzero temperature in a pulsed laser field. The shape of the Ramsey resonance is analysed for two different temperature ranges, i. e. for a ‘cold’ atomic ensemble and for an ensemble of ‘hot’ atoms in a cell with a buffer gas. The influence of the hyperfine structure of the excited level on the shift of the central Ramsey resonance is investigated.