Motivated by the conjectures of Braverman-Kazhdan, Lafforgue, Ngˆo and Sakellaridis, we prove a summation formula for certain spaces of test functions on the zero locus of a quadratic form. The functions are built from the Whittaker coefficients of automorphic representations on $\mathrm{GL}_n$.