  We consider the techniques to distinguish normal star forming (NSF) galaxies
and active galactic nuclei (AGN) hosts using optical spectra. The observational
data base is a set of 20000 galaxies extracted from the Sloan Digital Sky
Survey, for which we have determined the emission line intensities after
subtracting the stellar continuum obtained from spectral synthesis. Our
analysis is based on photoionization models computed using the stellar ionizing
radiation predicted by Starburst 99 and, for the AGNs, a broken power-law
spectrum. We explain why, among the four classical emission line diagnostic
diagrams, the [OIII]/Hb vs [NII]/Ha one works best. We show however, that none
of these diagrams is efficient in detecting AGNs in metal poor galaxies, should
such cases exist. We propose a new divisory line between ``pure'' NSF galaxies
and AGN hosts. We also show that a classification into NSF and AGN galaxies
using only [NII]/Ha is feasible and useful. Finally, we propose a new
classification diagram, the DEW diagram, plotting D_n(4000) vs
max(EW[OII],EW[NeIII]). This diagram can be used with optical spectra for
galaxies with redshifts up to z = 1.3, meaning an important progress over
classifications proposed up to now. Since the DEW diagram requires only a small
range in wavelength, it can also be used at even larger redshifts in suitable
atmospheric windows. It also has the advantage of not requiring stellar
synthesis analysis to subtract the stars and of allowing one to see ALL the
galaxies in the same diagram, including passive galaxies.
