The time and band limiting operator is introduced to optimize the reconstruction of a signal from only a partial part of its spectrum. In the discrete case, this operator commutes with the so-called algebraic Heun operator which appears in the context of the quantum integrable systems. The construction of both operators and the proof of their commutativity is recalled. A direct connection between their spectra is obtained. Then, the Bethe ansatz, a well-known method to diagonalize integrable quantum Hamiltonians, is used to diagonalize the Heun operator and to obtain insights on the spectrum of the time and band limiting operator.