  We show that the spectrum of a flow field can be extracted within a local
region by straightforward filtering in physical space. We find that for a flow
with a certain level of regularity, the filtering kernel must have a sufficient
number of vanishing moments in order for the "filtering spectrum" to be
meaningful. Our derivation follows a similar analysis by Perrier et al. 1995
for the wavelet spectrum, where we show that the filtering kernel has to have
at least $p$ vanishing moments in order to correctly extract a spectrum
$k^{-\alpha}$ with $\alpha < p+2$. For example, any flow with a spectrum
shallower than $k^{-3}$ can be extracted by a straightforward average on
grid-cells of a stencil. We construct two new "simple stencil" kernels,
${\mathcal M}^{I}$ and ${\mathcal M}^{II}$, with only two and three fixed
stencil weight coefficients, respectively, and that have sufficient vanishing
moments to allow for extracting spectra steeper than $k^{-3}$. We demonstrate
our results using synthetic fields, 2D turbulence from a Direct Numerical
Simulation, and 3D turbulence from the JHU Database. Our method guarantees
energy conservation and can extract spectra of non-quadratic quantities
self-consistently, such as kinetic energy in variable density flows, which the
wavelet spectrum cannot. The method can be useful in both simulations and
experiments when a straightforward Fourier analysis is not justified, such as
within coherent flow structures covering non-rectangular regions, in
multi-phase flows, or in geophysical flows on Earth's curved surface.
