Evaluation of electron bunch shapes using the spectra of the coherent radiation