A numerical method for correction of shift and gain instability in gam
ma-spectroscopy has been developed. It is proposed to apply the correc
tion to partial spectra obtained for a short counting time. The result
ing spectrum is then obtained by summing up the partial spectra. The p
rocedure does not change the peak parameters, such as peak area and th
e full-width-at-half-maximum (FWHM). The changes in the position of tw
o reference peaks are used for correction. To test the method, two spe
ctra were shifted by 0.5 channel: a standard spectrum obtained from th
e IAEA in Vienna and a spectrum of neutron activated geological sample
. The changes in peak area and FWHM after such shifting are much small
er than their relative standard deviations. The spectra were also modi
fied by changing the gain. The obtained results were similar to those
obtained by shifting.