This paper aims at bridging existing theories in numerical and analytical homogenization. For this purpose the multiscale method of M\aalqvist and Peterseim [Math. Comp., 83 (2014), pp. 2583--2603], which is based on orthogonal subspace decomposition, is reinterpreted by means of a discrete integral operator acting on standard finite element spaces. The exponential decay of the involved integral kernel motivates the use of a diagonal approximation and, hence, a localized piecewise constant coefficient. In a periodic setting, the computed localized coefficient is proved to coincide with the classical homogenization limit. An a priori error analysis shows that the local numerical model is appropriate beyond the periodic setting when the localized coefficient satisfies a certain homogenization criterion, which can be verified a posteriori. The results are illustrated in numerical experiments.