A systematic technique for the derivation of subgrid scale models in the numerical solution of partial differential equations is described. The technique is based on Haar wavelet projections of the discrete operator followed by a sparse approximation. As numerical testing suggests, the resulting numerical method will accurately represent subgrid scale phenomena on a coarse grid. Applications to numerical homogenization and wave propagation in materials with subgrid inhomogeneities are presented.