  We show how spectral filters can improve the convergence of numerical schemes
which use discrete Hilbert transforms based on a sinc function expansion, and
thus ultimately on the fast Fourier transform. This is relevant, for example,
for the computation of fluctuation identities, which give the distribution of
the maximum or the minimum of a random path, or the joint distribution at
maturity with the extrema staying below or above barriers. We use as examples
the methods by Feng and Linetsky (2008) and Fusai, Germano and Marazzina (2016)
to price discretely monitored barrier options where the underlying asset price
is modelled by an exponential L\'evy process. Both methods show exponential
convergence with respect to the number of grid points in most cases, but are
limited to polynomial convergence under certain conditions. We relate these
rates of convergence to the Gibbs phenomenon for Fourier transforms and achieve
improved results with spectral filtering.
