The algorithm operating in time and frequency domain, similar to multiresolution analysis is presented. Instead of wavelets, orthogonal, compactly supported Legendre polynomials were used for discretization of curl operator. The resulting scheme has low numerical dispersion, compared to finite difference method, and implementation of perfect boundary conditions is easier, contrary to waveletbased algorithms. The algorithm can be easily joined with finite difference method inside a single computational domain. This hybrid algorithm allow to reduce computational domain size and take advantage of different techniques developed for finite difference method.