The spectral classifications of galaxies studied by astrophysicists are gen
erally based on the knowledge of line ratio. No matter what method they use
, precise measurements of spectral lines are needed. In this paper, ive pro
pose serial automatic methods to get a more precise line spectrum from an o
bserved spectrum. The continuum of an observed spectrum is subtracted by wa
velet filter bank. The Hidden Markov Model in the wavelet domain is used to
estimate the spectral lines in a noisy spectrum, and the noise is deduced
by subtracting the estimated spectrum from the noisy spectrum. A new tying
method for obtaining reliable training data is suggested to make the model
estimation more robust. The local thresholds for detecting spectral lines a
re determined according to the noise distribution, Finally, the spectral li
nes of an observed spectrum axe marked automatically.