We introduce theoretically and demonstrate experimentally a contrast transfer function based phase retrieval algorithm that reconstructs the projected thickness of an homogeneous sample using a polychromatic x-ray source. We show excellent quantitative recovery of test samples in 2D using a synchrotron source with significant harmonic contamination, and in 3D using a laboratory source.