Digital method of spectral peak analysis