We propose an algorithm for the compression of ECG signals, in particular QRS complexes, based on the expansion of signals with compact support into a basis of discrete Hermite functions. These functions are obtained by sampling continuous Hermite functions, previously used for the compression of ECG signals. Our algorithm uses the theory of signal models based on orthogonal polynomials, and achieves higher compression ratios compared with previously reported algorithms, both those using Hermite functions, as well as those using the discrete Fourier and discrete cosine transforms.