  EChO is a dedicated mission to investigate exoplanetary atmospheres. When
extracting the planetary signal, one has to take care of the variability of the
hosting star, which introduces spectral distortion that can be mistaken as
planetary signal. Magnetic variability is a major deal in particular for M
stars. To this purpose, assuming a one spot dominant model for the stellar
photosphere, we develop a mixed observational-theoretical tool to extract the
spot's parameters from the observed optical spectrum. This method relies on a
robust library of spectral M templates, which we derive using the observed
spectra of quiet M dwarfs in the SDSS database. Our procedure allows to correct
the observed spectra for photospheric activity in most of the analyzed cases,
reducing the spectral distortion down to the noise levels. Ongoing refinements
of the template library and the algorithm will improve the efficiency of our
algorithm.
