Two related approximation problems are formulated and solved in Hardy spaces of the disc and annulus. With practical applications in mind, truncated versions of these problems are analysed, where the solutions are chosen to lie in finite-dimensional spaces of polynomials or rational functions, and are expressed in terms of truncated Toeplitz operators. The results are illustrated by numerical examples. The work has applications in systems identification and in inverse problems for PDEs.