A practical and simple stable method for calculating Fourier integrals is proposed, effective both at low and at high frequencies. An approach based on the fruitful idea of Levin, which allows the use of the collocation method to approximate the slowly oscillating part of the antiderivative of the desired integral, allows reducing the calculation of the integral of a rapidly oscillating function (with a linear phase) to solving a system of linear algebraic equations with a triangular or Hermitian matrix. The choice of Gauss-Lobatto grid nodes as collocation points let to increasing the efficiency of the numerical algorithm for solving the problem. To avoid possible numerical instability of the algorithm, we proceed to the solution of a normal system of linear algebraic equations. © Springer Nature Switzerland AG 2020.