Relaxation sounders have proved to be successful in measuring the electron density in dilute space plasmas. The resonances excited at the characteristic frequencies of the medium depend very much on the local plasma. We present here methods to determine automatically, by a computer, the plasma frequency in the various regions encountered. In the solar wind and in the magnetosheath, only one strong, long‐lasting resonance appears close to the plasma frequency fpe, yielding directly the electron density. We use a pattern recognition method based on Sebestyen';s discrimination approach, and each identified resonance is given with a quality criterion. From one year of data there is no drift of the resonance features, and the method is used with a success rate of 95% as determined by manual means. In the magnetosphere various types of resonances are excited at the characteristic frequencies of the medium (cyclotron harmonic frequencies nfce and maximum frequencies of the Bernstein';s modes fqn). We compare the dispersion relation of electrostatic waves, which contains fce and fpe as parameters, to the observed frequencies of the resonances. First fce is extracted using the harmonicity of the nfce resonances, and then the fqn series is compared to the dispersion relation for various values of fpe. In 93% of 250 cases the error for fpe is less than 10%. In the magnetotail where the resonances are closely spaced in frequency, the frequency resolution of the experiment does not allow us to use this method and we determine fpe by the enhancement of the resonances power.