  We introduce a method to reconstruct an element of a Hilbert space in terms
of an arbitrary finite collection of linearly independent reconstruction
vectors, given a finite number of its samples with respect to any Riesz basis.
As we establish, provided the dimension of the reconstruction space is chosen
suitably in relation to the number of samples, this procedure can be
numerically implemented in a stable manner. Moreover, the accuracy of the
resulting approximation is completely determined by the choice of
reconstruction basis, meaning that the reconstruction vectors can be tailored
to the particular problem at hand.
  An important example of this approach is the accurate recovery of a piecewise
analytic function from its first few Fourier coefficients. Whilst the standard
Fourier projection suffers from the Gibbs phenomenon, by reconstructing in a
piecewise polynomial basis, we obtain an approximation with root exponential
accuracy in terms of the number of Fourier samples and exponential accuracy in
terms of the degree of the reconstruction function. Numerical examples
illustrate the advantage of this approach over other existing methods.
