Periodic heat transfer through an inhomogeneous medium