The problem of approximation of electrocardiograms has a great practical importance and it is constantly in the field of research. Solution of this problem allows us to automate and computerize the process of diagnosis and to detect timely deviations from normal characteristics of cardiograms of heartbeat in the early stages of appearance and development of a disease. There are different methods for approximation of cardiograms. All these methods have their drawbacks. The article deals with new methods of approximation of cardiograms, which do not have any disadvantages of the known methods. The developed mathematical models are based on new methods of approximation of step functions, and these methods can significantly reduce errors of the approximation of cardiograms. In this paper new methods of approximation of step functions with estimation of errors of the approximation are supposed. The proposed methods do not have any drawbacks of traditional expansions of step functions in Fourier series and can be used in problems of mathematical modeling of a wide class of processes and systems, in particular, for solution of medical and biological problems.