This work is devoted to a theoretical investigation of the Ramsey method of detection of the coherent population trapping resonance in cold atomic clouds taking into account collective effects caused by finite optical depth of the considered clouds. The interaction of atoms with pulsed laser radiation is described in the formalism of density matrix by means of Maxwell-Bloch set of equations. The Ramsey signal of coherent population trapping resonance was calculated for the radiation passed through the medium and analyzed for different length of the atomic cloud. Also the population of excited level was calculated in dependence on the two-photon detuning and coordinate along the main optical axis. The light shift of sidebands and appearance of additional harmonics were discovered.