Measuring the spectra of high-energy cosmic-ray particles in the PAMELA experiment